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 |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
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 |
|
31 extern "C++" { |
|
32 |
1214
|
33 class 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> () { } |
|
41 ComplexColumnVector (int n) : MArray<Complex> (n) { } |
|
42 ComplexColumnVector (int n, const Complex& val) : MArray<Complex> (n, val) { } |
458
|
43 ComplexColumnVector (const ColumnVector& a); |
1214
|
44 ComplexColumnVector (const MArray<Complex>& a) : MArray<Complex> (a) { } |
|
45 ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { } |
458
|
46 |
|
47 ComplexColumnVector& operator = (const ComplexColumnVector& a) |
|
48 { |
1214
|
49 MArray<Complex>::operator = (a); |
458
|
50 return *this; |
|
51 } |
|
52 |
|
53 int operator == (const ComplexColumnVector& a) const; |
|
54 int operator != (const ComplexColumnVector& a) const; |
|
55 |
|
56 // destructive insert/delete/reorder operations |
|
57 |
|
58 ComplexColumnVector& insert (const ColumnVector& a, int r); |
|
59 ComplexColumnVector& insert (const ComplexColumnVector& a, int r); |
|
60 |
|
61 ComplexColumnVector& fill (double val); |
|
62 ComplexColumnVector& fill (const Complex& val); |
|
63 ComplexColumnVector& fill (double val, int r1, int r2); |
|
64 ComplexColumnVector& fill (const Complex& val, int r1, int r2); |
|
65 |
|
66 ComplexColumnVector stack (const ColumnVector& a) const; |
|
67 ComplexColumnVector stack (const ComplexColumnVector& a) const; |
|
68 |
|
69 ComplexRowVector hermitian (void) const; // complex conjugate transpose. |
|
70 ComplexRowVector transpose (void) const; |
|
71 |
|
72 friend ComplexColumnVector conj (const ComplexColumnVector& a); |
|
73 |
|
74 // resize is the destructive equivalent for this one |
|
75 |
|
76 ComplexColumnVector extract (int r1, int r2) const; |
|
77 |
|
78 // column vector by column vector -> column vector operations |
|
79 |
|
80 ComplexColumnVector& operator += (const ColumnVector& a); |
|
81 ComplexColumnVector& operator -= (const ColumnVector& a); |
|
82 |
|
83 ComplexColumnVector& operator += (const ComplexColumnVector& a); |
|
84 ComplexColumnVector& operator -= (const ComplexColumnVector& a); |
|
85 |
|
86 // column vector by scalar -> column vector operations |
|
87 |
|
88 friend ComplexColumnVector operator + (const ComplexColumnVector& a, |
|
89 double s); |
|
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 |
1205
|
97 friend ComplexColumnVector operator + (const ColumnVector& a, |
|
98 const Complex& s); |
|
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 |
458
|
106 // scalar by column vector -> column vector operations |
|
107 |
|
108 friend ComplexColumnVector operator + (double s, |
|
109 const ComplexColumnVector& a); |
|
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 |
1205
|
117 friend ComplexColumnVector operator + (const Complex& s, |
|
118 const ColumnVector& a); |
|
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); |
458
|
125 |
1205
|
126 // matrix by column vector -> column vector operations |
|
127 |
|
128 friend ComplexColumnVector operator * (const ComplexMatrix& a, |
|
129 const ColumnVector& b); |
|
130 |
|
131 friend ComplexColumnVector operator * (const ComplexMatrix& a, |
|
132 const ComplexColumnVector& b); |
458
|
133 |
|
134 // column vector by column vector -> column vector operations |
|
135 |
|
136 friend ComplexColumnVector operator + (const ComplexColumnVector& a, |
|
137 const ColumnVector& b); |
|
138 friend ComplexColumnVector operator - (const ComplexColumnVector& a, |
|
139 const ColumnVector& b); |
|
140 |
1205
|
141 friend ComplexColumnVector operator + (const ColumnVector& a, |
|
142 const ComplexColumnVector& b); |
|
143 friend ComplexColumnVector operator - (const ColumnVector& a, |
|
144 const ComplexColumnVector& b); |
|
145 |
458
|
146 friend ComplexColumnVector product (const ComplexColumnVector& a, |
|
147 const ColumnVector& b); |
|
148 friend ComplexColumnVector quotient (const ComplexColumnVector& a, |
|
149 const ColumnVector& b); |
|
150 |
1205
|
151 friend ComplexColumnVector product (const ColumnVector& a, |
|
152 const ComplexColumnVector& b); |
|
153 friend ComplexColumnVector quotient (const ColumnVector& a, |
|
154 const ComplexColumnVector& b); |
|
155 |
|
156 // matrix by column vector -> column vector operations |
|
157 |
|
158 friend ComplexColumnVector operator * (const Matrix& a, |
|
159 const ComplexColumnVector& b); |
|
160 |
|
161 // diagonal matrix by column vector -> column vector operations |
|
162 |
|
163 friend ComplexColumnVector operator * (const DiagMatrix& a, |
|
164 const ComplexColumnVector& b); |
|
165 |
|
166 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
167 const ColumnVector& b); |
|
168 |
|
169 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
170 const ComplexColumnVector& b); |
|
171 |
458
|
172 // other operations |
|
173 |
|
174 friend ComplexColumnVector map (c_c_Mapper f, const ComplexColumnVector& a); |
|
175 void map (c_c_Mapper f); |
|
176 |
|
177 Complex min (void) const; |
|
178 Complex max (void) const; |
|
179 |
|
180 // i/o |
|
181 |
|
182 friend ostream& operator << (ostream& os, const ComplexColumnVector& a); |
532
|
183 friend istream& operator >> (istream& is, ComplexColumnVector& a); |
458
|
184 |
1205
|
185 private: |
|
186 |
1214
|
187 ComplexColumnVector (Complex *d, int l) : MArray<Complex> (d, l) { } |
458
|
188 }; |
|
189 |
|
190 } // extern "C++" |
|
191 |
|
192 #endif |
|
193 |
|
194 /* |
|
195 ;;; Local Variables: *** |
|
196 ;;; mode: C++ *** |
|
197 ;;; page-delimiter: "^/\\*" *** |
|
198 ;;; End: *** |
|
199 */ |