458
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 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 |
3585
|
34 class |
|
35 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> () { } |
3585
|
43 |
|
44 explicit ComplexColumnVector (int n) : MArray<Complex> (n) { } |
|
45 |
|
46 ComplexColumnVector (int n, const Complex& val) |
|
47 : MArray<Complex> (n, val) { } |
|
48 |
|
49 ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { } |
|
50 |
1214
|
51 ComplexColumnVector (const MArray<Complex>& a) : MArray<Complex> (a) { } |
3585
|
52 |
|
53 explicit ComplexColumnVector (const ColumnVector& a); |
458
|
54 |
|
55 ComplexColumnVector& operator = (const ComplexColumnVector& a) |
|
56 { |
1214
|
57 MArray<Complex>::operator = (a); |
458
|
58 return *this; |
|
59 } |
|
60 |
2386
|
61 bool operator == (const ComplexColumnVector& a) const; |
|
62 bool operator != (const ComplexColumnVector& a) const; |
458
|
63 |
1359
|
64 // destructive insert/delete/reorder operations |
458
|
65 |
|
66 ComplexColumnVector& insert (const ColumnVector& a, int r); |
|
67 ComplexColumnVector& insert (const ComplexColumnVector& a, int r); |
|
68 |
|
69 ComplexColumnVector& fill (double val); |
|
70 ComplexColumnVector& fill (const Complex& val); |
|
71 ComplexColumnVector& fill (double val, int r1, int r2); |
|
72 ComplexColumnVector& fill (const Complex& val, int r1, int r2); |
|
73 |
|
74 ComplexColumnVector stack (const ColumnVector& a) const; |
|
75 ComplexColumnVector stack (const ComplexColumnVector& a) const; |
|
76 |
|
77 ComplexRowVector hermitian (void) const; // complex conjugate transpose. |
|
78 ComplexRowVector transpose (void) const; |
|
79 |
|
80 friend ComplexColumnVector conj (const ComplexColumnVector& a); |
|
81 |
1359
|
82 // resize is the destructive equivalent for this one |
458
|
83 |
|
84 ComplexColumnVector extract (int r1, int r2) const; |
|
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 // column vector by column vector -> column vector operations |
458
|
100 |
|
101 friend ComplexColumnVector operator + (const ComplexColumnVector& a, |
|
102 const ColumnVector& b); |
|
103 friend ComplexColumnVector operator - (const ComplexColumnVector& a, |
|
104 const ColumnVector& b); |
|
105 |
1205
|
106 friend ComplexColumnVector operator + (const ColumnVector& a, |
|
107 const ComplexColumnVector& b); |
|
108 friend ComplexColumnVector operator - (const ColumnVector& a, |
|
109 const ComplexColumnVector& b); |
|
110 |
458
|
111 friend ComplexColumnVector product (const ComplexColumnVector& a, |
|
112 const ColumnVector& b); |
|
113 friend ComplexColumnVector quotient (const ComplexColumnVector& a, |
|
114 const ColumnVector& b); |
|
115 |
1205
|
116 friend ComplexColumnVector product (const ColumnVector& a, |
|
117 const ComplexColumnVector& b); |
|
118 friend ComplexColumnVector quotient (const ColumnVector& a, |
|
119 const ComplexColumnVector& b); |
|
120 |
1359
|
121 // matrix by column vector -> column vector operations |
1205
|
122 |
|
123 friend ComplexColumnVector operator * (const Matrix& a, |
|
124 const ComplexColumnVector& b); |
|
125 |
1359
|
126 // diagonal matrix by column vector -> column vector operations |
1205
|
127 |
|
128 friend ComplexColumnVector operator * (const DiagMatrix& a, |
|
129 const ComplexColumnVector& b); |
|
130 |
|
131 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
132 const ColumnVector& b); |
|
133 |
|
134 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
135 const ComplexColumnVector& b); |
|
136 |
1359
|
137 // other operations |
458
|
138 |
2676
|
139 ComplexColumnVector map (c_c_Mapper f) const; |
|
140 ColumnVector map (d_c_Mapper f) const; |
|
141 |
|
142 ComplexColumnVector& apply (c_c_Mapper f); |
458
|
143 |
|
144 Complex min (void) const; |
|
145 Complex max (void) const; |
|
146 |
1359
|
147 // i/o |
458
|
148 |
3504
|
149 friend std::ostream& operator << (std::ostream& os, const ComplexColumnVector& a); |
|
150 friend std::istream& operator >> (std::istream& is, ComplexColumnVector& a); |
458
|
151 |
1205
|
152 private: |
|
153 |
1214
|
154 ComplexColumnVector (Complex *d, int l) : MArray<Complex> (d, l) { } |
458
|
155 }; |
|
156 |
3573
|
157 MARRAY_FORWARD_DEFS (MArray, ComplexColumnVector, Complex) |
|
158 |
458
|
159 #endif |
|
160 |
|
161 /* |
|
162 ;;; Local Variables: *** |
|
163 ;;; mode: C++ *** |
|
164 ;;; End: *** |
|
165 */ |