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