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