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