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