Mercurial > hg > octave-lyh
annotate liboctave/CRowVector.h @ 11523:fd0a3ac60b0e
update copyright notices
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 14 Jan 2011 05:47:45 -0500 |
parents | 96ed7c629bbd |
children | 57632dea2446 |
rev | line source |
---|---|
458 | 1 /* |
2 | |
11523 | 3 Copyright (C) 1994-2011 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" |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
27 #include "dRowVector.h" |
458 | 28 |
29 #include "mx-defs.h" | |
30 | |
3585 | 31 class |
6108 | 32 OCTAVE_API |
3585 | 33 ComplexRowVector : public MArray<Complex> |
458 | 34 { |
35 friend class ComplexColumnVector; | |
36 | |
37 public: | |
38 | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
39 ComplexRowVector (void) : MArray<Complex> (1, 0) { } |
3585 | 40 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
41 explicit ComplexRowVector (octave_idx_type n) : MArray<Complex> (1, n) { } |
3585 | 42 |
9612
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
43 explicit ComplexRowVector (const dim_vector& dv) : MArray<Complex> (dv) { } |
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
44 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
45 ComplexRowVector (octave_idx_type n, const Complex& val) : MArray<Complex> (1, n, val) { } |
3585 | 46 |
47 ComplexRowVector (const ComplexRowVector& a) : MArray<Complex> (a) { } | |
48 | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
49 ComplexRowVector (const MArray<Complex>& a) : MArray<Complex> (a.as_row ()) { } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
50 ComplexRowVector (const Array<Complex>& a) : MArray<Complex> (a.as_row ()) { } |
3585 | 51 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
52 explicit ComplexRowVector (const RowVector& a) : MArray<Complex> (a) { } |
458 | 53 |
54 ComplexRowVector& operator = (const ComplexRowVector& a) | |
55 { | |
1214 | 56 MArray<Complex>::operator = (a); |
458 | 57 return *this; |
58 } | |
59 | |
2386 | 60 bool operator == (const ComplexRowVector& a) const; |
61 bool operator != (const ComplexRowVector& a) const; | |
458 | 62 |
1359 | 63 // destructive insert/delete/reorder operations |
458 | 64 |
5275 | 65 ComplexRowVector& insert (const RowVector& a, octave_idx_type c); |
66 ComplexRowVector& insert (const ComplexRowVector& a, octave_idx_type c); | |
458 | 67 |
68 ComplexRowVector& fill (double val); | |
69 ComplexRowVector& fill (const Complex& val); | |
5275 | 70 ComplexRowVector& fill (double val, octave_idx_type c1, octave_idx_type c2); |
71 ComplexRowVector& fill (const Complex& val, octave_idx_type c1, octave_idx_type c2); | |
458 | 72 |
73 ComplexRowVector append (const RowVector& a) const; | |
74 ComplexRowVector append (const ComplexRowVector& a) const; | |
75 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
76 ComplexColumnVector hermitian (void) const; |
458 | 77 ComplexColumnVector transpose (void) const; |
78 | |
79 friend ComplexRowVector conj (const ComplexRowVector& a); | |
80 | |
1359 | 81 // resize is the destructive equivalent for this one |
458 | 82 |
5275 | 83 ComplexRowVector extract (octave_idx_type c1, octave_idx_type c2) const; |
458 | 84 |
5275 | 85 ComplexRowVector extract_n (octave_idx_type c1, octave_idx_type n) const; |
4316 | 86 |
1359 | 87 // row vector by row vector -> row vector operations |
458 | 88 |
89 ComplexRowVector& operator += (const RowVector& a); | |
90 ComplexRowVector& operator -= (const RowVector& a); | |
91 | |
1359 | 92 // row vector by matrix -> row vector |
458 | 93 |
94 friend ComplexRowVector operator * (const ComplexRowVector& a, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
95 const ComplexMatrix& b); |
458 | 96 |
1205 | 97 friend ComplexRowVector operator * (const RowVector& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
98 const ComplexMatrix& b); |
1205 | 99 |
1359 | 100 // other operations |
458 | 101 |
102 Complex min (void) const; | |
103 Complex max (void) const; | |
104 | |
1359 | 105 // i/o |
458 | 106 |
3504 | 107 friend std::ostream& operator << (std::ostream& os, const ComplexRowVector& a); |
108 friend std::istream& operator >> (std::istream& is, ComplexRowVector& a); | |
458 | 109 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
110 void resize (octave_idx_type n, const Complex& rfv = Array<Complex>::resize_fill_value ()) |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
111 { Array<Complex>::resize (1, n, rfv); } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
112 |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
113 void clear (octave_idx_type n) |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
114 { Array<Complex>::clear (1, n); } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
115 |
458 | 116 }; |
117 | |
1205 | 118 // row vector by column vector -> scalar |
119 | |
120 Complex operator * (const ComplexRowVector& a, const ColumnVector& b); | |
121 | |
122 Complex operator * (const ComplexRowVector& a, const ComplexColumnVector& b); | |
123 | |
124 // other operations | |
125 | |
6108 | 126 OCTAVE_API ComplexRowVector linspace (const Complex& x1, const Complex& x2, octave_idx_type n); |
1196 | 127 |
3573 | 128 MARRAY_FORWARD_DEFS (MArray, ComplexRowVector, Complex) |
129 | |
458 | 130 #endif |