Mercurial > hg > octave-nkf
annotate liboctave/array/CRowVector.h @ 17296:3a9efb68272d ss-3-7-6
snapshot 3.7.6
* configure.ac (OCTAVE_VERSION): Bump to 3.7.6.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 20 Aug 2013 15:17:54 -0400 |
parents | 648dabbb4c6b |
children | d63878346099 |
rev | line source |
---|---|
458 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13719
diff
changeset
|
3 Copyright (C) 1994-2012 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 | |
23 #if !defined (octave_ComplexRowVector_h) | |
24 #define octave_ComplexRowVector_h 1 | |
25 | |
1214 | 26 #include "MArray.h" |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
27 #include "dRowVector.h" |
458 | 28 |
29 #include "mx-defs.h" | |
30 | |
3585 | 31 class |
6108 | 32 OCTAVE_API |
3585 | 33 ComplexRowVector : public MArray<Complex> |
458 | 34 { |
35 friend class ComplexColumnVector; | |
36 | |
37 public: | |
38 | |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
39 ComplexRowVector (void) : MArray<Complex> (dim_vector (1, 0)) { } |
3585 | 40 |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
41 explicit ComplexRowVector (octave_idx_type n) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
42 : MArray<Complex> (dim_vector (1, n)) { } |
3585 | 43 |
9612
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
44 explicit ComplexRowVector (const dim_vector& dv) : MArray<Complex> (dv) { } |
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
45 |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
46 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
|
47 : MArray<Complex> (dim_vector (1, n), val) { } |
3585 | 48 |
49 ComplexRowVector (const ComplexRowVector& a) : MArray<Complex> (a) { } | |
50 | |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
51 ComplexRowVector (const MArray<Complex>& a) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
52 : MArray<Complex> (a.as_row ()) { } |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
53 |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
54 ComplexRowVector (const Array<Complex>& a) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
55 : MArray<Complex> (a.as_row ()) { } |
3585 | 56 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
57 explicit ComplexRowVector (const RowVector& a) : MArray<Complex> (a) { } |
458 | 58 |
59 ComplexRowVector& operator = (const ComplexRowVector& a) | |
60 { | |
1214 | 61 MArray<Complex>::operator = (a); |
458 | 62 return *this; |
63 } | |
64 | |
2386 | 65 bool operator == (const ComplexRowVector& a) const; |
66 bool operator != (const ComplexRowVector& a) const; | |
458 | 67 |
1359 | 68 // destructive insert/delete/reorder operations |
458 | 69 |
5275 | 70 ComplexRowVector& insert (const RowVector& a, octave_idx_type c); |
71 ComplexRowVector& insert (const ComplexRowVector& a, octave_idx_type c); | |
458 | 72 |
73 ComplexRowVector& fill (double val); | |
74 ComplexRowVector& fill (const Complex& val); | |
5275 | 75 ComplexRowVector& fill (double val, octave_idx_type c1, octave_idx_type c2); |
76 ComplexRowVector& fill (const Complex& val, octave_idx_type c1, octave_idx_type c2); | |
458 | 77 |
78 ComplexRowVector append (const RowVector& a) const; | |
79 ComplexRowVector append (const ComplexRowVector& a) const; | |
80 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
81 ComplexColumnVector hermitian (void) const; |
458 | 82 ComplexColumnVector transpose (void) const; |
83 | |
84 friend ComplexRowVector conj (const ComplexRowVector& a); | |
85 | |
1359 | 86 // resize is the destructive equivalent for this one |
458 | 87 |
5275 | 88 ComplexRowVector extract (octave_idx_type c1, octave_idx_type c2) const; |
458 | 89 |
5275 | 90 ComplexRowVector extract_n (octave_idx_type c1, octave_idx_type n) const; |
4316 | 91 |
1359 | 92 // row vector by row vector -> row vector operations |
458 | 93 |
94 ComplexRowVector& operator += (const RowVector& a); | |
95 ComplexRowVector& operator -= (const RowVector& a); | |
96 | |
1359 | 97 // row vector by matrix -> row vector |
458 | 98 |
99 friend ComplexRowVector operator * (const ComplexRowVector& a, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
100 const ComplexMatrix& b); |
458 | 101 |
1205 | 102 friend ComplexRowVector operator * (const RowVector& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
103 const ComplexMatrix& b); |
1205 | 104 |
1359 | 105 // other operations |
458 | 106 |
107 Complex min (void) const; | |
108 Complex max (void) const; | |
109 | |
1359 | 110 // i/o |
458 | 111 |
3504 | 112 friend std::ostream& operator << (std::ostream& os, const ComplexRowVector& a); |
113 friend std::istream& operator >> (std::istream& is, ComplexRowVector& a); | |
458 | 114 |
14616
13cc11418393
improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
115 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
|
116 { |
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
117 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
|
118 } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
119 |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
120 void clear (octave_idx_type n) |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
121 { Array<Complex>::clear (1, n); } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
122 |
458 | 123 }; |
124 | |
1205 | 125 // row vector by column vector -> scalar |
126 | |
13719
8547cde2a568
Export missing symbols.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
11574
diff
changeset
|
127 Complex OCTAVE_API operator * (const ComplexRowVector& a, const ColumnVector& b); |
1205 | 128 |
13719
8547cde2a568
Export missing symbols.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
11574
diff
changeset
|
129 Complex OCTAVE_API operator * (const ComplexRowVector& a, const ComplexColumnVector& b); |
1205 | 130 |
131 // other operations | |
132 | |
6108 | 133 OCTAVE_API ComplexRowVector linspace (const Complex& x1, const Complex& x2, octave_idx_type n); |
1196 | 134 |
3573 | 135 MARRAY_FORWARD_DEFS (MArray, ComplexRowVector, Complex) |
136 | |
458 | 137 #endif |