Mercurial > octave
annotate liboctave/array/CRowVector.h @ 22323:bac0d6f07a3e
maint: Update copyright notices for 2016.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 17 Aug 2016 01:05:19 -0400 |
parents | 1473547f50f5 |
children | 4caa7b28d183 |
rev | line source |
---|---|
458 | 1 /* |
2 | |
22323
bac0d6f07a3e
maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
3 Copyright (C) 1994-2016 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 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
23 #if ! defined (octave_CRowVector_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17769
diff
changeset
|
24 #define octave_CRowVector_h 1 |
458 | 25 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
27 |
1214 | 28 #include "MArray.h" |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
29 #include "dRowVector.h" |
458 | 30 |
31 #include "mx-defs.h" | |
32 | |
3585 | 33 class |
6108 | 34 OCTAVE_API |
3585 | 35 ComplexRowVector : 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 ComplexColumnVector; |
458 | 38 |
39 public: | |
40 | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
41 ComplexRowVector (void) : MArray<Complex> (dim_vector (1, 0)) { } |
3585 | 42 |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
43 explicit ComplexRowVector (octave_idx_type n) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
44 : MArray<Complex> (dim_vector (1, n)) { } |
3585 | 45 |
9612
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
46 explicit ComplexRowVector (const dim_vector& dv) : MArray<Complex> (dv) { } |
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
47 |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
48 ComplexRowVector (octave_idx_type n, const Complex& val) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
49 : MArray<Complex> (dim_vector (1, n), val) { } |
3585 | 50 |
51 ComplexRowVector (const ComplexRowVector& 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 ComplexRowVector (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_row ()) { } |
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 ComplexRowVector (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_row ()) { } |
3585 | 58 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
59 explicit ComplexRowVector (const RowVector& a) : MArray<Complex> (a) { } |
458 | 60 |
61 ComplexRowVector& operator = (const ComplexRowVector& a) | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
62 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
63 MArray<Complex>::operator = (a); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
64 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
65 } |
458 | 66 |
2386 | 67 bool operator == (const ComplexRowVector& a) const; |
68 bool operator != (const ComplexRowVector& a) const; | |
458 | 69 |
1359 | 70 // destructive insert/delete/reorder operations |
458 | 71 |
5275 | 72 ComplexRowVector& insert (const RowVector& a, octave_idx_type c); |
73 ComplexRowVector& insert (const ComplexRowVector& a, octave_idx_type c); | |
458 | 74 |
75 ComplexRowVector& fill (double val); | |
76 ComplexRowVector& fill (const Complex& val); | |
5275 | 77 ComplexRowVector& fill (double val, octave_idx_type c1, octave_idx_type c2); |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
78 ComplexRowVector& fill (const Complex& val, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
79 octave_idx_type c1, octave_idx_type c2); |
458 | 80 |
81 ComplexRowVector append (const RowVector& a) const; | |
82 ComplexRowVector append (const ComplexRowVector& a) const; | |
83 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
84 ComplexColumnVector hermitian (void) const; |
458 | 85 ComplexColumnVector transpose (void) const; |
86 | |
87 friend ComplexRowVector conj (const ComplexRowVector& a); | |
88 | |
1359 | 89 // resize is the destructive equivalent for this one |
458 | 90 |
5275 | 91 ComplexRowVector extract (octave_idx_type c1, octave_idx_type c2) const; |
458 | 92 |
5275 | 93 ComplexRowVector extract_n (octave_idx_type c1, octave_idx_type n) const; |
4316 | 94 |
1359 | 95 // row vector by row vector -> row vector operations |
458 | 96 |
97 ComplexRowVector& operator += (const RowVector& a); | |
98 ComplexRowVector& operator -= (const RowVector& a); | |
99 | |
1359 | 100 // row vector by matrix -> row vector |
458 | 101 |
102 friend ComplexRowVector operator * (const ComplexRowVector& a, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
103 const ComplexMatrix& b); |
458 | 104 |
1205 | 105 friend ComplexRowVector operator * (const RowVector& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
106 const ComplexMatrix& b); |
1205 | 107 |
1359 | 108 // other operations |
458 | 109 |
110 Complex min (void) const; | |
111 Complex max (void) const; | |
112 | |
1359 | 113 // i/o |
458 | 114 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
115 friend 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
|
116 const ComplexRowVector& a); |
3504 | 117 friend std::istream& operator >> (std::istream& is, ComplexRowVector& a); |
458 | 118 |
14616
13cc11418393
improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
119 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
|
120 { |
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
121 Array<Complex>::resize (dim_vector (1, n), rfv); |
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
122 } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
123 |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
124 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
|
125 { Array<Complex>::clear (1, n); } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
126 |
458 | 127 }; |
128 | |
1205 | 129 // row vector by column vector -> scalar |
130 | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
131 Complex OCTAVE_API operator * (const ComplexRowVector& a, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
132 const ColumnVector& b); |
1205 | 133 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
134 Complex OCTAVE_API operator * (const ComplexRowVector& a, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
135 const ComplexColumnVector& b); |
1205 | 136 |
137 // other operations | |
138 | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
139 OCTAVE_API ComplexRowVector linspace (const Complex& x1, const Complex& x2, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
140 octave_idx_type n); |
1196 | 141 |
3573 | 142 MARRAY_FORWARD_DEFS (MArray, ComplexRowVector, Complex) |
143 | |
458 | 144 #endif |