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 |
7016
|
9 Free Software Foundation; either version 3 of the License, or (at your |
|
10 option) any later version. |
458
|
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 |
7016
|
18 along with Octave; see the file COPYING. If not, see |
|
19 <http://www.gnu.org/licenses/>. |
458
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_ComplexColumnVector_h) |
|
24 #define octave_ComplexColumnVector_h 1 |
|
25 |
1214
|
26 #include "MArray.h" |
458
|
27 |
|
28 #include "mx-defs.h" |
|
29 |
3585
|
30 class |
6108
|
31 OCTAVE_API |
3585
|
32 ComplexColumnVector : public MArray<Complex> |
458
|
33 { |
1205
|
34 friend class ComplexMatrix; |
458
|
35 friend class ComplexRowVector; |
|
36 |
|
37 public: |
|
38 |
1214
|
39 ComplexColumnVector (void) : MArray<Complex> () { } |
3585
|
40 |
5275
|
41 explicit ComplexColumnVector (octave_idx_type n) : MArray<Complex> (n) { } |
3585
|
42 |
5275
|
43 ComplexColumnVector (octave_idx_type n, const Complex& val) |
3585
|
44 : MArray<Complex> (n, val) { } |
|
45 |
|
46 ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { } |
|
47 |
1214
|
48 ComplexColumnVector (const MArray<Complex>& a) : MArray<Complex> (a) { } |
3585
|
49 |
|
50 explicit ComplexColumnVector (const ColumnVector& a); |
458
|
51 |
|
52 ComplexColumnVector& operator = (const ComplexColumnVector& a) |
|
53 { |
1214
|
54 MArray<Complex>::operator = (a); |
458
|
55 return *this; |
|
56 } |
|
57 |
2386
|
58 bool operator == (const ComplexColumnVector& a) const; |
|
59 bool operator != (const ComplexColumnVector& a) const; |
458
|
60 |
1359
|
61 // destructive insert/delete/reorder operations |
458
|
62 |
5275
|
63 ComplexColumnVector& insert (const ColumnVector& a, octave_idx_type r); |
|
64 ComplexColumnVector& insert (const ComplexColumnVector& a, octave_idx_type r); |
458
|
65 |
|
66 ComplexColumnVector& fill (double val); |
|
67 ComplexColumnVector& fill (const Complex& val); |
5275
|
68 ComplexColumnVector& fill (double val, octave_idx_type r1, octave_idx_type r2); |
|
69 ComplexColumnVector& fill (const Complex& val, octave_idx_type r1, octave_idx_type r2); |
458
|
70 |
|
71 ComplexColumnVector stack (const ColumnVector& a) const; |
|
72 ComplexColumnVector stack (const ComplexColumnVector& a) const; |
|
73 |
|
74 ComplexRowVector hermitian (void) const; // complex conjugate transpose. |
|
75 ComplexRowVector transpose (void) const; |
|
76 |
|
77 friend ComplexColumnVector conj (const ComplexColumnVector& a); |
|
78 |
1359
|
79 // resize is the destructive equivalent for this one |
458
|
80 |
5275
|
81 ComplexColumnVector extract (octave_idx_type r1, octave_idx_type r2) const; |
458
|
82 |
5275
|
83 ComplexColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const; |
4316
|
84 |
1359
|
85 // column vector by column vector -> column vector operations |
458
|
86 |
|
87 ComplexColumnVector& operator += (const ColumnVector& a); |
|
88 ComplexColumnVector& operator -= (const ColumnVector& a); |
|
89 |
1359
|
90 // matrix by column vector -> column vector operations |
1205
|
91 |
|
92 friend ComplexColumnVector operator * (const ComplexMatrix& a, |
|
93 const ColumnVector& b); |
|
94 |
|
95 friend ComplexColumnVector operator * (const ComplexMatrix& a, |
|
96 const ComplexColumnVector& b); |
458
|
97 |
1359
|
98 // matrix by column vector -> column vector operations |
1205
|
99 |
|
100 friend ComplexColumnVector operator * (const Matrix& a, |
|
101 const ComplexColumnVector& b); |
|
102 |
1359
|
103 // diagonal matrix by column vector -> column vector operations |
1205
|
104 |
|
105 friend ComplexColumnVector operator * (const DiagMatrix& a, |
|
106 const ComplexColumnVector& b); |
|
107 |
|
108 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
109 const ColumnVector& b); |
|
110 |
|
111 friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
|
112 const ComplexColumnVector& b); |
|
113 |
1359
|
114 // other operations |
458
|
115 |
2676
|
116 ComplexColumnVector map (c_c_Mapper f) const; |
|
117 ColumnVector map (d_c_Mapper f) const; |
|
118 |
|
119 ComplexColumnVector& apply (c_c_Mapper f); |
458
|
120 |
|
121 Complex min (void) const; |
|
122 Complex max (void) const; |
|
123 |
1359
|
124 // i/o |
458
|
125 |
3504
|
126 friend std::ostream& operator << (std::ostream& os, const ComplexColumnVector& a); |
|
127 friend std::istream& operator >> (std::istream& is, ComplexColumnVector& a); |
458
|
128 |
1205
|
129 private: |
|
130 |
5275
|
131 ComplexColumnVector (Complex *d, octave_idx_type l) : MArray<Complex> (d, l) { } |
458
|
132 }; |
|
133 |
3573
|
134 MARRAY_FORWARD_DEFS (MArray, ComplexColumnVector, Complex) |
|
135 |
458
|
136 #endif |
|
137 |
|
138 /* |
|
139 ;;; Local Variables: *** |
|
140 ;;; mode: C++ *** |
|
141 ;;; End: *** |
|
142 */ |