Mercurial > hg > octave-nkf
annotate liboctave/array/CRowVector.h @ 19887:3db04b75c7c0
do not set text encoding for strings to utf-8 on windows (bug #44103)
* octave-gui.cc (octave_start_gui): only use setCodecForCStrings when not
building for windows
author | Torsten <ttl@justmail.de> |
---|---|
date | Mon, 09 Feb 2015 22:09:36 +0100 |
parents | ebb3ef964372 |
children | 4197fc428c7d |
rev | line source |
---|---|
458 | 1 /* |
2 | |
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
15271
diff
changeset
|
3 Copyright (C) 1994-2013 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 | |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17769
diff
changeset
|
23 #if !defined (octave_CRowVector_h) |
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 |
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 { |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
35 friend class ComplexColumnVector; |
458 | 36 |
37 public: | |
38 | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
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) | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
60 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
61 MArray<Complex>::operator = (a); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
62 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
63 } |
458 | 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); |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
76 ComplexRowVector& fill (const Complex& val, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
77 octave_idx_type c1, octave_idx_type c2); |
458 | 78 |
79 ComplexRowVector append (const RowVector& a) const; | |
80 ComplexRowVector append (const ComplexRowVector& a) const; | |
81 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
82 ComplexColumnVector hermitian (void) const; |
458 | 83 ComplexColumnVector transpose (void) const; |
84 | |
85 friend ComplexRowVector conj (const ComplexRowVector& a); | |
86 | |
1359 | 87 // resize is the destructive equivalent for this one |
458 | 88 |
5275 | 89 ComplexRowVector extract (octave_idx_type c1, octave_idx_type c2) const; |
458 | 90 |
5275 | 91 ComplexRowVector extract_n (octave_idx_type c1, octave_idx_type n) const; |
4316 | 92 |
1359 | 93 // row vector by row vector -> row vector operations |
458 | 94 |
95 ComplexRowVector& operator += (const RowVector& a); | |
96 ComplexRowVector& operator -= (const RowVector& a); | |
97 | |
1359 | 98 // row vector by matrix -> row vector |
458 | 99 |
100 friend ComplexRowVector operator * (const ComplexRowVector& a, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
101 const ComplexMatrix& b); |
458 | 102 |
1205 | 103 friend ComplexRowVector operator * (const RowVector& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
104 const ComplexMatrix& b); |
1205 | 105 |
1359 | 106 // other operations |
458 | 107 |
108 Complex min (void) const; | |
109 Complex max (void) const; | |
110 | |
1359 | 111 // i/o |
458 | 112 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
113 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
|
114 const ComplexRowVector& a); |
3504 | 115 friend std::istream& operator >> (std::istream& is, ComplexRowVector& a); |
458 | 116 |
14616
13cc11418393
improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
117 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
|
118 { |
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
119 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
|
120 } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
121 |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
122 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
|
123 { Array<Complex>::clear (1, n); } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
124 |
458 | 125 }; |
126 | |
1205 | 127 // row vector by column vector -> scalar |
128 | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
129 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
|
130 const ColumnVector& b); |
1205 | 131 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
132 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
|
133 const ComplexColumnVector& b); |
1205 | 134 |
135 // other operations | |
136 | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
137 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
|
138 octave_idx_type n); |
1196 | 139 |
3573 | 140 MARRAY_FORWARD_DEFS (MArray, ComplexRowVector, Complex) |
141 | |
458 | 142 #endif |