Mercurial > hg > octave-lyh
annotate liboctave/CColVector.h @ 10437:0a210203481b
update NEWS
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 23 Mar 2010 13:03:06 +0100 |
parents | 96ed7c629bbd |
children | 4d1fc073fbb7 |
rev | line source |
---|---|
458 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2003, 2004, 2005, |
8920 | 4 2006, 2007, 2008 John W. Eaton |
458 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
458 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
458 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_ComplexColumnVector_h) | |
25 #define octave_ComplexColumnVector_h 1 | |
26 | |
1214 | 27 #include "MArray.h" |
458 | 28 |
29 #include "mx-defs.h" | |
30 | |
3585 | 31 class |
6108 | 32 OCTAVE_API |
3585 | 33 ComplexColumnVector : public MArray<Complex> |
458 | 34 { |
1205 | 35 friend class ComplexMatrix; |
458 | 36 friend class ComplexRowVector; |
37 | |
38 public: | |
39 | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
40 ComplexColumnVector (void) : MArray<Complex> (0, 1) { } |
3585 | 41 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
42 explicit ComplexColumnVector (octave_idx_type n) : MArray<Complex> (n, 1) { } |
3585 | 43 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
44 explicit ComplexColumnVector (const dim_vector& dv) |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
45 : MArray<Complex> (dv.as_column ()) { } |
9612
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9237
diff
changeset
|
46 |
5275 | 47 ComplexColumnVector (octave_idx_type n, const Complex& val) |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
48 : MArray<Complex> (n, 1, val) { } |
3585 | 49 |
50 ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { } | |
51 | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
52 ComplexColumnVector (const MArray<Complex>& a) : MArray<Complex> (a.as_column ()) { } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
53 ComplexColumnVector (const Array<Complex>& a) : MArray<Complex> (a.as_column ()) { } |
3585 | 54 |
55 explicit ComplexColumnVector (const ColumnVector& a); | |
458 | 56 |
57 ComplexColumnVector& operator = (const ComplexColumnVector& a) | |
58 { | |
1214 | 59 MArray<Complex>::operator = (a); |
458 | 60 return *this; |
61 } | |
62 | |
2386 | 63 bool operator == (const ComplexColumnVector& a) const; |
64 bool operator != (const ComplexColumnVector& a) const; | |
458 | 65 |
1359 | 66 // destructive insert/delete/reorder operations |
458 | 67 |
5275 | 68 ComplexColumnVector& insert (const ColumnVector& a, octave_idx_type r); |
69 ComplexColumnVector& insert (const ComplexColumnVector& a, octave_idx_type r); | |
458 | 70 |
71 ComplexColumnVector& fill (double val); | |
72 ComplexColumnVector& fill (const Complex& val); | |
5275 | 73 ComplexColumnVector& fill (double val, octave_idx_type r1, octave_idx_type r2); |
74 ComplexColumnVector& fill (const Complex& val, octave_idx_type r1, octave_idx_type r2); | |
458 | 75 |
76 ComplexColumnVector stack (const ColumnVector& a) const; | |
77 ComplexColumnVector stack (const ComplexColumnVector& a) const; | |
78 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
79 ComplexRowVector hermitian (void) const; |
458 | 80 ComplexRowVector transpose (void) const; |
81 | |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
82 friend OCTAVE_API ComplexColumnVector conj (const ComplexColumnVector& a); |
458 | 83 |
1359 | 84 // resize is the destructive equivalent for this one |
458 | 85 |
5275 | 86 ComplexColumnVector extract (octave_idx_type r1, octave_idx_type r2) const; |
458 | 87 |
5275 | 88 ComplexColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const; |
4316 | 89 |
1359 | 90 // column vector by column vector -> column vector operations |
458 | 91 |
92 ComplexColumnVector& operator += (const ColumnVector& a); | |
93 ComplexColumnVector& operator -= (const ColumnVector& a); | |
94 | |
1359 | 95 // matrix by column vector -> column vector operations |
1205 | 96 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
97 friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
98 const ColumnVector& b); |
1205 | 99 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
100 friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
101 const ComplexColumnVector& b); |
458 | 102 |
1359 | 103 // matrix by column vector -> column vector operations |
1205 | 104 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
105 friend OCTAVE_API ComplexColumnVector operator * (const Matrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
106 const ComplexColumnVector& b); |
1205 | 107 |
1359 | 108 // diagonal matrix by column vector -> column vector operations |
1205 | 109 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
110 friend OCTAVE_API ComplexColumnVector operator * (const DiagMatrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
111 const ComplexColumnVector& b); |
1205 | 112 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
113 friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
114 const ColumnVector& b); |
1205 | 115 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
116 friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
117 const ComplexColumnVector& b); |
1205 | 118 |
1359 | 119 // other operations |
458 | 120 |
121 Complex min (void) const; | |
122 Complex max (void) const; | |
123 | |
10363
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10350
diff
changeset
|
124 ColumnVector abs (void) const; |
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10350
diff
changeset
|
125 |
1359 | 126 // i/o |
458 | 127 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
128 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const ComplexColumnVector& a); |
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
129 friend OCTAVE_API std::istream& operator >> (std::istream& is, ComplexColumnVector& a); |
458 | 130 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
131 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
|
132 { Array<Complex>::resize (n, 1, rfv); } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
133 |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
134 void clear (octave_idx_type n) |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
135 { Array<Complex>::clear (n, 1); } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
136 |
458 | 137 }; |
138 | |
3573 | 139 MARRAY_FORWARD_DEFS (MArray, ComplexColumnVector, Complex) |
140 | |
458 | 141 #endif |