Mercurial > octave
annotate liboctave/array/CColVector.h @ 23219:3ac9f9ecfae5 stable
maint: Update copyright dates.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 22 Feb 2017 12:39:29 -0500 |
parents | e9a0469dedd9 |
children | 092078913d54 |
rev | line source |
---|---|
458 | 1 /* |
2 | |
23219
3ac9f9ecfae5
maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents:
23083
diff
changeset
|
3 Copyright (C) 1994-2017 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 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
24 #if ! defined (octave_CColVector_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17769
diff
changeset
|
25 #define octave_CColVector_h 1 |
458 | 26 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
27 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
28 |
1214 | 29 #include "MArray.h" |
458 | 30 |
31 #include "mx-defs.h" | |
32 | |
3585 | 33 class |
6108 | 34 OCTAVE_API |
3585 | 35 ComplexColumnVector : public MArray<Complex> |
458 | 36 { |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
37 friend class ComplexMatrix; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
38 friend class ComplexRowVector; |
458 | 39 |
40 public: | |
41 | |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
42 ComplexColumnVector (void) : MArray<Complex> (dim_vector (0, 1)) { } |
3585 | 43 |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
44 explicit ComplexColumnVector (octave_idx_type n) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
45 : MArray<Complex> (dim_vector (n, 1)) { } |
3585 | 46 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11574
diff
changeset
|
47 explicit ComplexColumnVector (const dim_vector& dv) |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
48 : MArray<Complex> (dv.as_column ()) { } |
9612
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9237
diff
changeset
|
49 |
5275 | 50 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
|
51 : MArray<Complex> (dim_vector (n, 1), val) { } |
3585 | 52 |
53 ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { } | |
54 | |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
55 ComplexColumnVector (const MArray<Complex>& a) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
56 : MArray<Complex> (a.as_column ()) { } |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
57 |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
58 ComplexColumnVector (const Array<Complex>& a) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
59 : MArray<Complex> (a.as_column ()) { } |
3585 | 60 |
61 explicit ComplexColumnVector (const ColumnVector& a); | |
458 | 62 |
63 ComplexColumnVector& operator = (const ComplexColumnVector& a) | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
64 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
65 MArray<Complex>::operator = (a); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
66 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
67 } |
458 | 68 |
2386 | 69 bool operator == (const ComplexColumnVector& a) const; |
70 bool operator != (const ComplexColumnVector& a) const; | |
458 | 71 |
1359 | 72 // destructive insert/delete/reorder operations |
458 | 73 |
5275 | 74 ComplexColumnVector& insert (const ColumnVector& a, octave_idx_type r); |
75 ComplexColumnVector& insert (const ComplexColumnVector& a, octave_idx_type r); | |
458 | 76 |
77 ComplexColumnVector& fill (double val); | |
78 ComplexColumnVector& fill (const Complex& val); | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
79 ComplexColumnVector& fill (double val, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
80 octave_idx_type r1, octave_idx_type r2); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
81 ComplexColumnVector& fill (const Complex& val, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
82 octave_idx_type r1, octave_idx_type r2); |
458 | 83 |
84 ComplexColumnVector stack (const ColumnVector& a) const; | |
85 ComplexColumnVector stack (const ComplexColumnVector& a) const; | |
86 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
87 ComplexRowVector hermitian (void) const; |
458 | 88 ComplexRowVector transpose (void) const; |
89 | |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
90 friend OCTAVE_API ComplexColumnVector conj (const ComplexColumnVector& a); |
458 | 91 |
1359 | 92 // resize is the destructive equivalent for this one |
458 | 93 |
5275 | 94 ComplexColumnVector extract (octave_idx_type r1, octave_idx_type r2) const; |
458 | 95 |
5275 | 96 ComplexColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const; |
4316 | 97 |
1359 | 98 // column vector by column vector -> column vector operations |
458 | 99 |
100 ComplexColumnVector& operator += (const ColumnVector& a); | |
101 ComplexColumnVector& operator -= (const ColumnVector& a); | |
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 ComplexMatrix& a, |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
106 const ColumnVector& b); |
1205 | 107 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
108 friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a, |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
109 const ComplexColumnVector& b); |
458 | 110 |
1359 | 111 // matrix by column vector -> column vector operations |
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 Matrix& a, |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
114 const ComplexColumnVector& b); |
1205 | 115 |
1359 | 116 // diagonal matrix by column vector -> column vector operations |
1205 | 117 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
118 friend OCTAVE_API ComplexColumnVector operator * (const DiagMatrix& a, |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
119 const ComplexColumnVector& b); |
1205 | 120 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
121 friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
122 const ColumnVector& b); |
1205 | 123 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
124 friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a, |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
125 const ComplexColumnVector& b); |
1205 | 126 |
1359 | 127 // other operations |
458 | 128 |
129 Complex min (void) const; | |
130 Complex max (void) const; | |
131 | |
10363
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10350
diff
changeset
|
132 ColumnVector abs (void) const; |
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10350
diff
changeset
|
133 |
1359 | 134 // i/o |
458 | 135 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
136 friend OCTAVE_API std::ostream& operator << (std::ostream& os, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
137 const ComplexColumnVector& a); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
138 friend OCTAVE_API std::istream& operator >> (std::istream& is, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
139 ComplexColumnVector& a); |
458 | 140 |
14616
13cc11418393
improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
141 void resize (octave_idx_type n, const Complex& rfv = Complex (0)) |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
142 { |
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
143 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
|
144 } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
145 |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
146 void clear (octave_idx_type n) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
147 { Array<Complex>::clear (n, 1); } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
148 |
458 | 149 }; |
150 | |
3573 | 151 MARRAY_FORWARD_DEFS (MArray, ComplexColumnVector, Complex) |
152 | |
458 | 153 #endif |