Mercurial > hg > octave-nkf
annotate liboctave/CColVector.h @ 12283:0664a7ddd944 release-3-4-x
README.MacOS: Spelling corrections.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Fri, 28 Jan 2011 22:27:17 -0500 |
parents | 12df7854fa7c |
children | 72c96de7a403 |
rev | line source |
---|---|
458 | 1 /* |
2 | |
11523 | 3 Copyright (C) 1994-2011 John W. Eaton |
10521
4d1fc073fbb7
add some missing copyright stmts
Jaroslav Hajek <highegg@gmail.com>
parents:
10364
diff
changeset
|
4 Copyright (C) 2010 VZLU Prague |
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 | |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
40 ComplexColumnVector (void) : MArray<Complex> (dim_vector (0, 1)) { } |
3585 | 41 |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
42 explicit ComplexColumnVector (octave_idx_type n) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
43 : MArray<Complex> (dim_vector (n, 1)) { } |
3585 | 44 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11574
diff
changeset
|
45 explicit ComplexColumnVector (const dim_vector& dv) |
10350
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) |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
49 : MArray<Complex> (dim_vector (n, 1), val) { } |
3585 | 50 |
51 ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { } | |
52 | |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
53 ComplexColumnVector (const MArray<Complex>& a) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
54 : MArray<Complex> (a.as_column ()) { } |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
55 |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
56 ComplexColumnVector (const Array<Complex>& a) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
57 : MArray<Complex> (a.as_column ()) { } |
3585 | 58 |
59 explicit ComplexColumnVector (const ColumnVector& a); | |
458 | 60 |
61 ComplexColumnVector& operator = (const ComplexColumnVector& a) | |
62 { | |
1214 | 63 MArray<Complex>::operator = (a); |
458 | 64 return *this; |
65 } | |
66 | |
2386 | 67 bool operator == (const ComplexColumnVector& a) const; |
68 bool operator != (const ComplexColumnVector& a) const; | |
458 | 69 |
1359 | 70 // destructive insert/delete/reorder operations |
458 | 71 |
5275 | 72 ComplexColumnVector& insert (const ColumnVector& a, octave_idx_type r); |
73 ComplexColumnVector& insert (const ComplexColumnVector& a, octave_idx_type r); | |
458 | 74 |
75 ComplexColumnVector& fill (double val); | |
76 ComplexColumnVector& fill (const Complex& val); | |
5275 | 77 ComplexColumnVector& fill (double val, octave_idx_type r1, octave_idx_type r2); |
78 ComplexColumnVector& fill (const Complex& val, octave_idx_type r1, octave_idx_type r2); | |
458 | 79 |
80 ComplexColumnVector stack (const ColumnVector& a) const; | |
81 ComplexColumnVector stack (const ComplexColumnVector& a) const; | |
82 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
83 ComplexRowVector hermitian (void) const; |
458 | 84 ComplexRowVector transpose (void) const; |
85 | |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
86 friend OCTAVE_API ComplexColumnVector conj (const ComplexColumnVector& a); |
458 | 87 |
1359 | 88 // resize is the destructive equivalent for this one |
458 | 89 |
5275 | 90 ComplexColumnVector extract (octave_idx_type r1, octave_idx_type r2) const; |
458 | 91 |
5275 | 92 ComplexColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const; |
4316 | 93 |
1359 | 94 // column vector by column vector -> column vector operations |
458 | 95 |
96 ComplexColumnVector& operator += (const ColumnVector& a); | |
97 ComplexColumnVector& operator -= (const ColumnVector& a); | |
98 | |
1359 | 99 // matrix by column vector -> column vector operations |
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 ColumnVector& b); |
1205 | 103 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
104 friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
105 const ComplexColumnVector& b); |
458 | 106 |
1359 | 107 // matrix by column vector -> column vector operations |
1205 | 108 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
109 friend OCTAVE_API ComplexColumnVector operator * (const Matrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
110 const ComplexColumnVector& b); |
1205 | 111 |
1359 | 112 // diagonal matrix by column vector -> column vector operations |
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 DiagMatrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
115 const ComplexColumnVector& 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 ColumnVector& b); |
1205 | 119 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
120 friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
121 const ComplexColumnVector& b); |
1205 | 122 |
1359 | 123 // other operations |
458 | 124 |
125 Complex min (void) const; | |
126 Complex max (void) const; | |
127 | |
10363
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10350
diff
changeset
|
128 ColumnVector abs (void) const; |
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10350
diff
changeset
|
129 |
1359 | 130 // i/o |
458 | 131 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
132 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
|
133 friend OCTAVE_API std::istream& operator >> (std::istream& is, ComplexColumnVector& a); |
458 | 134 |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
135 void resize (octave_idx_type n, |
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
136 const Complex& rfv = Array<Complex>::resize_fill_value ()) |
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
137 { |
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
138 Array<Complex>::resize (dim_vector (n, 1), rfv); |
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
139 } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
140 |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
141 void clear (octave_idx_type n) |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
142 { Array<Complex>::clear (n, 1); } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
143 |
458 | 144 }; |
145 | |
3573 | 146 MARRAY_FORWARD_DEFS (MArray, ComplexColumnVector, Complex) |
147 | |
458 | 148 #endif |