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