458
|
1 /* |
|
2 |
1882
|
3 Copyright (C) 1996 John W. Eaton |
458
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
458
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_ComplexColumnVector_h) |
|
24 #define octave_ComplexColumnVector_h 1 |
|
25 |
1296
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
1214
|
30 #include "MArray.h" |
458
|
31 |
|
32 #include "mx-defs.h" |
|
33 |
1214
|
34 class ComplexColumnVector : public MArray<Complex> |
458
|
35 { |
1205
|
36 friend class ComplexMatrix; |
458
|
37 friend class ComplexRowVector; |
|
38 |
|
39 public: |
|
40 |
1214
|
41 ComplexColumnVector (void) : MArray<Complex> () { } |
|
42 ComplexColumnVector (int n) : MArray<Complex> (n) { } |
|
43 ComplexColumnVector (int n, const Complex& val) : MArray<Complex> (n, val) { } |
458
|
44 ComplexColumnVector (const ColumnVector& a); |
1214
|
45 ComplexColumnVector (const MArray<Complex>& a) : MArray<Complex> (a) { } |
|
46 ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { } |
458
|
47 |
|
48 ComplexColumnVector& operator = (const ComplexColumnVector& a) |
|
49 { |
1214
|
50 MArray<Complex>::operator = (a); |
458
|
51 return *this; |
|
52 } |
|
53 |
2386
|
54 bool operator == (const ComplexColumnVector& a) const; |
|
55 bool operator != (const ComplexColumnVector& a) const; |
458
|
56 |
1359
|
57 // destructive insert/delete/reorder operations |
458
|
58 |
|
59 ComplexColumnVector& insert (const ColumnVector& a, int r); |
|
60 ComplexColumnVector& insert (const ComplexColumnVector& a, int r); |
|
61 |
|
62 ComplexColumnVector& fill (double val); |
|
63 ComplexColumnVector& fill (const Complex& val); |
|
64 ComplexColumnVector& fill (double val, int r1, int r2); |
|
65 ComplexColumnVector& fill (const Complex& val, int r1, int r2); |
|
66 |
|
67 ComplexColumnVector stack (const ColumnVector& a) const; |
|
68 ComplexColumnVector stack (const ComplexColumnVector& a) const; |
|
69 |
|
70 ComplexRowVector hermitian (void) const; // complex conjugate transpose. |
|
71 ComplexRowVector transpose (void) const; |
|
72 |
|
73 friend ComplexColumnVector conj (const ComplexColumnVector& a); |
|
74 |
1359
|
75 // resize is the destructive equivalent for this one |
458
|
76 |
|
77 ComplexColumnVector extract (int r1, int r2) const; |
|
78 |
1359
|
79 // column vector by column vector -> column vector operations |
458
|
80 |
|
81 ComplexColumnVector& operator += (const ColumnVector& a); |
|
82 ComplexColumnVector& operator -= (const ColumnVector& a); |
|
83 |
|
84 ComplexColumnVector& operator += (const ComplexColumnVector& a); |
|
85 ComplexColumnVector& operator -= (const ComplexColumnVector& a); |
|
86 |
1359
|
87 // column vector by scalar -> column vector operations |
458
|
88 |
|
89 friend ComplexColumnVector operator + (const ComplexColumnVector& a, |
|
90 double s); |
|
91 friend ComplexColumnVector operator - (const ComplexColumnVector& a, |
|
92 double s); |
|
93 friend ComplexColumnVector operator * (const ComplexColumnVector& a, |
|
94 double s); |
|
95 friend ComplexColumnVector operator / (const ComplexColumnVector& a, |
|
96 double s); |
|
97 |
1205
|
98 friend ComplexColumnVector operator + (const ColumnVector& a, |
|
99 const Complex& s); |
|
100 friend ComplexColumnVector operator - (const ColumnVector& a, |
|
101 const Complex& s); |
|
102 friend ComplexColumnVector operator * (const ColumnVector& a, |
|
103 const Complex& s); |
|
104 friend ComplexColumnVector operator / (const ColumnVector& a, |
|
105 const Complex& s); |
|
106 |
1359
|
107 // scalar by column vector -> column vector operations |
458
|
108 |
|
109 friend ComplexColumnVector operator + (double s, |
|
110 const ComplexColumnVector& a); |
|
111 friend ComplexColumnVector operator - (double s, |
|
112 const ComplexColumnVector& a); |
|
113 friend ComplexColumnVector operator * (double s, |
|
114 const ComplexColumnVector& a); |
|
115 friend ComplexColumnVector operator / (double s, |
|
116 const ComplexColumnVector& a); |
|
117 |
1205
|
118 friend ComplexColumnVector operator + (const Complex& s, |
|
119 const ColumnVector& a); |
|
120 friend ComplexColumnVector operator - (const Complex& s, |
|
121 const ColumnVector& a); |
|
122 friend ComplexColumnVector operator * (const Complex& s, |
|
123 const ColumnVector& a); |
|
124 friend ComplexColumnVector operator / (const Complex& s, |
|
125 const ColumnVector& a); |
458
|
126 |
1359
|
127 // matrix by column vector -> column vector operations |
1205
|
128 |
|
129 friend ComplexColumnVector operator * (const ComplexMatrix& a, |
|
130 const ColumnVector& b); |
|
131 |
|
132 friend ComplexColumnVector operator * (const ComplexMatrix& a, |
|
133 const ComplexColumnVector& b); |
458
|
134 |
1359
|
135 // column vector by column vector -> column vector operations |
458
|
136 |
|
137 friend ComplexColumnVector operator + (const ComplexColumnVector& a, |
|
138 const ColumnVector& b); |
|
139 friend ComplexColumnVector operator - (const ComplexColumnVector& a, |
|
140 const ColumnVector& b); |
|
141 |
1205
|
142 friend ComplexColumnVector operator + (const ColumnVector& a, |
|
143 const ComplexColumnVector& b); |
|
144 friend ComplexColumnVector operator - (const ColumnVector& a, |
|
145 const ComplexColumnVector& b); |
|
146 |
458
|
147 friend ComplexColumnVector product (const ComplexColumnVector& a, |
|
148 const ColumnVector& b); |
|
149 friend ComplexColumnVector quotient (const ComplexColumnVector& a, |
|
150 const ColumnVector& b); |
|
151 |
1205
|
152 friend ComplexColumnVector product (const ColumnVector& a, |
|
153 const ComplexColumnVector& b); |
|
154 friend ComplexColumnVector quotient (const ColumnVector& a, |
|
155 const ComplexColumnVector& b); |
|
156 |
1359
|
157 // matrix by column vector -> column vector operations |
1205
|
158 |
|
159 friend ComplexColumnVector operator * (const Matrix& a, |
|
160 const ComplexColumnVector& b); |
|
161 |
1359
|
162 // diagonal matrix by column vector -> column vector operations |
1205
|
163 |
|
164 friend ComplexColumnVector operator * (const DiagMatrix& a, |
|
165 const ComplexColumnVector& b); |
|
166 |
|
167 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
168 const ColumnVector& b); |
|
169 |
|
170 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
171 const ComplexColumnVector& b); |
|
172 |
1359
|
173 // other operations |
458
|
174 |
|
175 friend ComplexColumnVector map (c_c_Mapper f, const ComplexColumnVector& a); |
|
176 void map (c_c_Mapper f); |
|
177 |
|
178 Complex min (void) const; |
|
179 Complex max (void) const; |
|
180 |
1359
|
181 // i/o |
458
|
182 |
|
183 friend ostream& operator << (ostream& os, const ComplexColumnVector& a); |
532
|
184 friend istream& operator >> (istream& is, ComplexColumnVector& a); |
458
|
185 |
1205
|
186 private: |
|
187 |
1214
|
188 ComplexColumnVector (Complex *d, int l) : MArray<Complex> (d, l) { } |
458
|
189 }; |
|
190 |
|
191 #endif |
|
192 |
|
193 /* |
|
194 ;;; Local Variables: *** |
|
195 ;;; mode: C++ *** |
|
196 ;;; End: *** |
|
197 */ |