458
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2003, 2004, 2005, |
|
4 2006, 2007 John W. Eaton |
458
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
458
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
458
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_ComplexColumnVector_h) |
|
25 #define octave_ComplexColumnVector_h 1 |
|
26 |
1214
|
27 #include "MArray.h" |
458
|
28 |
|
29 #include "mx-defs.h" |
|
30 |
3585
|
31 class |
6108
|
32 OCTAVE_API |
3585
|
33 ComplexColumnVector : public MArray<Complex> |
458
|
34 { |
1205
|
35 friend class ComplexMatrix; |
458
|
36 friend class ComplexRowVector; |
|
37 |
|
38 public: |
|
39 |
1214
|
40 ComplexColumnVector (void) : MArray<Complex> () { } |
3585
|
41 |
5275
|
42 explicit ComplexColumnVector (octave_idx_type n) : MArray<Complex> (n) { } |
3585
|
43 |
5275
|
44 ComplexColumnVector (octave_idx_type n, const Complex& val) |
3585
|
45 : MArray<Complex> (n, val) { } |
|
46 |
|
47 ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { } |
|
48 |
1214
|
49 ComplexColumnVector (const MArray<Complex>& a) : MArray<Complex> (a) { } |
3585
|
50 |
|
51 explicit ComplexColumnVector (const ColumnVector& a); |
458
|
52 |
|
53 ComplexColumnVector& operator = (const ComplexColumnVector& a) |
|
54 { |
1214
|
55 MArray<Complex>::operator = (a); |
458
|
56 return *this; |
|
57 } |
|
58 |
2386
|
59 bool operator == (const ComplexColumnVector& a) const; |
|
60 bool operator != (const ComplexColumnVector& a) const; |
458
|
61 |
1359
|
62 // destructive insert/delete/reorder operations |
458
|
63 |
5275
|
64 ComplexColumnVector& insert (const ColumnVector& a, octave_idx_type r); |
|
65 ComplexColumnVector& insert (const ComplexColumnVector& a, octave_idx_type r); |
458
|
66 |
|
67 ComplexColumnVector& fill (double val); |
|
68 ComplexColumnVector& fill (const Complex& val); |
5275
|
69 ComplexColumnVector& fill (double val, octave_idx_type r1, octave_idx_type r2); |
|
70 ComplexColumnVector& fill (const Complex& val, octave_idx_type r1, octave_idx_type r2); |
458
|
71 |
|
72 ComplexColumnVector stack (const ColumnVector& a) const; |
|
73 ComplexColumnVector stack (const ComplexColumnVector& a) const; |
|
74 |
|
75 ComplexRowVector hermitian (void) const; // complex conjugate transpose. |
|
76 ComplexRowVector transpose (void) const; |
|
77 |
|
78 friend ComplexColumnVector conj (const ComplexColumnVector& a); |
|
79 |
1359
|
80 // resize is the destructive equivalent for this one |
458
|
81 |
5275
|
82 ComplexColumnVector extract (octave_idx_type r1, octave_idx_type r2) const; |
458
|
83 |
5275
|
84 ComplexColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const; |
4316
|
85 |
1359
|
86 // column vector by column vector -> column vector operations |
458
|
87 |
|
88 ComplexColumnVector& operator += (const ColumnVector& a); |
|
89 ComplexColumnVector& operator -= (const ColumnVector& a); |
|
90 |
1359
|
91 // matrix by column vector -> column vector operations |
1205
|
92 |
|
93 friend ComplexColumnVector operator * (const ComplexMatrix& a, |
|
94 const ColumnVector& b); |
|
95 |
|
96 friend ComplexColumnVector operator * (const ComplexMatrix& a, |
|
97 const ComplexColumnVector& b); |
458
|
98 |
1359
|
99 // matrix by column vector -> column vector operations |
1205
|
100 |
|
101 friend ComplexColumnVector operator * (const Matrix& a, |
|
102 const ComplexColumnVector& b); |
|
103 |
1359
|
104 // diagonal matrix by column vector -> column vector operations |
1205
|
105 |
|
106 friend ComplexColumnVector operator * (const DiagMatrix& a, |
|
107 const ComplexColumnVector& b); |
|
108 |
|
109 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
110 const ColumnVector& b); |
|
111 |
|
112 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
113 const ComplexColumnVector& b); |
|
114 |
1359
|
115 // other operations |
458
|
116 |
2676
|
117 ComplexColumnVector map (c_c_Mapper f) const; |
|
118 ColumnVector map (d_c_Mapper f) const; |
|
119 |
|
120 ComplexColumnVector& apply (c_c_Mapper f); |
458
|
121 |
|
122 Complex min (void) const; |
|
123 Complex max (void) const; |
|
124 |
1359
|
125 // i/o |
458
|
126 |
3504
|
127 friend std::ostream& operator << (std::ostream& os, const ComplexColumnVector& a); |
|
128 friend std::istream& operator >> (std::istream& is, ComplexColumnVector& a); |
458
|
129 |
1205
|
130 private: |
|
131 |
5275
|
132 ComplexColumnVector (Complex *d, octave_idx_type l) : MArray<Complex> (d, l) { } |
458
|
133 }; |
|
134 |
3573
|
135 MARRAY_FORWARD_DEFS (MArray, ComplexColumnVector, Complex) |
|
136 |
458
|
137 #endif |
|
138 |
|
139 /* |
|
140 ;;; Local Variables: *** |
|
141 ;;; mode: C++ *** |
|
142 ;;; End: *** |
|
143 */ |