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 |
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 |
1359
|
84 // matrix by column vector -> column vector operations |
1205
|
85 |
|
86 friend ComplexColumnVector operator * (const ComplexMatrix& a, |
|
87 const ColumnVector& b); |
|
88 |
|
89 friend ComplexColumnVector operator * (const ComplexMatrix& a, |
|
90 const ComplexColumnVector& b); |
458
|
91 |
1359
|
92 // column vector by column vector -> column vector operations |
458
|
93 |
|
94 friend ComplexColumnVector operator + (const ComplexColumnVector& a, |
|
95 const ColumnVector& b); |
|
96 friend ComplexColumnVector operator - (const ComplexColumnVector& a, |
|
97 const ColumnVector& b); |
|
98 |
1205
|
99 friend ComplexColumnVector operator + (const ColumnVector& a, |
|
100 const ComplexColumnVector& b); |
|
101 friend ComplexColumnVector operator - (const ColumnVector& a, |
|
102 const ComplexColumnVector& b); |
|
103 |
458
|
104 friend ComplexColumnVector product (const ComplexColumnVector& a, |
|
105 const ColumnVector& b); |
|
106 friend ComplexColumnVector quotient (const ComplexColumnVector& a, |
|
107 const ColumnVector& b); |
|
108 |
1205
|
109 friend ComplexColumnVector product (const ColumnVector& a, |
|
110 const ComplexColumnVector& b); |
|
111 friend ComplexColumnVector quotient (const ColumnVector& a, |
|
112 const ComplexColumnVector& b); |
|
113 |
1359
|
114 // matrix by column vector -> column vector operations |
1205
|
115 |
|
116 friend ComplexColumnVector operator * (const Matrix& a, |
|
117 const ComplexColumnVector& b); |
|
118 |
1359
|
119 // diagonal matrix by column vector -> column vector operations |
1205
|
120 |
|
121 friend ComplexColumnVector operator * (const DiagMatrix& a, |
|
122 const ComplexColumnVector& b); |
|
123 |
|
124 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
125 const ColumnVector& b); |
|
126 |
|
127 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
128 const ComplexColumnVector& b); |
|
129 |
1359
|
130 // other operations |
458
|
131 |
2676
|
132 ComplexColumnVector map (c_c_Mapper f) const; |
|
133 ColumnVector map (d_c_Mapper f) const; |
|
134 |
|
135 ComplexColumnVector& apply (c_c_Mapper f); |
458
|
136 |
|
137 Complex min (void) const; |
|
138 Complex max (void) const; |
|
139 |
1359
|
140 // i/o |
458
|
141 |
3504
|
142 friend std::ostream& operator << (std::ostream& os, const ComplexColumnVector& a); |
|
143 friend std::istream& operator >> (std::istream& is, ComplexColumnVector& a); |
458
|
144 |
1205
|
145 private: |
|
146 |
1214
|
147 ComplexColumnVector (Complex *d, int l) : MArray<Complex> (d, l) { } |
458
|
148 }; |
|
149 |
3573
|
150 MARRAY_FORWARD_DEFS (MArray, ComplexColumnVector, Complex) |
|
151 |
458
|
152 #endif |
|
153 |
|
154 /* |
|
155 ;;; Local Variables: *** |
|
156 ;;; mode: C++ *** |
|
157 ;;; End: *** |
|
158 */ |