Mercurial > hg > octave-nkf
annotate liboctave/CMatrix.h @ 11523:fd0a3ac60b0e
update copyright notices
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 14 Jan 2011 05:47:45 -0500 |
parents | 96ed7c629bbd |
children | 57632dea2446 |
rev | line source |
---|---|
458 | 1 /* |
2 | |
11523 | 3 Copyright (C) 1994-2011 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_ComplexMatrix_h) | |
24 #define octave_ComplexMatrix_h 1 | |
25 | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
26 #include "MArray.h" |
1989 | 27 #include "MDiagArray2.h" |
5785 | 28 #include "MatrixType.h" |
458 | 29 |
30 #include "mx-defs.h" | |
8774
b756ce0002db
split implementation and interface in mx-op-defs and MArray-defs
Jaroslav Hajek <highegg@gmail.com>
parents:
8650
diff
changeset
|
31 #include "mx-op-decl.h" |
1650 | 32 #include "oct-cmplx.h" |
8335 | 33 #include "DET.h" |
458 | 34 |
3585 | 35 class |
6108 | 36 OCTAVE_API |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
37 ComplexMatrix : public MArray<Complex> |
458 | 38 { |
39 public: | |
40 | |
9656
b29504415a2e
provide NDArray->Matrix->Vector typedef mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
9653
diff
changeset
|
41 typedef ComplexColumnVector column_vector_type; |
b29504415a2e
provide NDArray->Matrix->Vector typedef mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
9653
diff
changeset
|
42 typedef ComplexRowVector row_vector_type; |
b29504415a2e
provide NDArray->Matrix->Vector typedef mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
9653
diff
changeset
|
43 |
7788 | 44 typedef void (*solve_singularity_handler) (double rcon); |
3480 | 45 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
46 ComplexMatrix (void) : MArray<Complex> () { } |
3585 | 47 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
48 ComplexMatrix (octave_idx_type r, octave_idx_type c) : MArray<Complex> (r, c) { } |
3585 | 49 |
5275 | 50 ComplexMatrix (octave_idx_type r, octave_idx_type c, const Complex& val) |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
51 : MArray<Complex> (r, c, val) { } |
3585 | 52 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
53 ComplexMatrix (const dim_vector& dv) : MArray<Complex> (dv.redim (2)) { } |
6979 | 54 |
55 ComplexMatrix (const dim_vector& dv, const Complex& val) | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
56 : MArray<Complex> (dv.redim (2), val) { } |
6979 | 57 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
58 ComplexMatrix (const ComplexMatrix& a) : MArray<Complex> (a) { } |
3585 | 59 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7788
diff
changeset
|
60 template <class U> |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
61 ComplexMatrix (const MArray<U>& a) : MArray<Complex> (a.as_matrix ()) { } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7788
diff
changeset
|
62 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7788
diff
changeset
|
63 template <class U> |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
64 ComplexMatrix (const Array<U>& a) : MArray<Complex> (a.as_matrix ()) { } |
10301
9e0ec19df4bc
commit accidentally omitted parts of previous change
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
65 |
9663
7e5b4de5fbfe
improve mixed real x complex ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9661
diff
changeset
|
66 ComplexMatrix (const Matrix& re, const Matrix& im); |
7e5b4de5fbfe
improve mixed real x complex ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9661
diff
changeset
|
67 |
3585 | 68 explicit ComplexMatrix (const Matrix& a); |
69 | |
70 explicit ComplexMatrix (const RowVector& rv); | |
71 | |
72 explicit ComplexMatrix (const ColumnVector& cv); | |
458 | 73 |
3585 | 74 explicit ComplexMatrix (const DiagMatrix& a); |
75 | |
76 explicit ComplexMatrix (const ComplexRowVector& rv); | |
77 | |
78 explicit ComplexMatrix (const ComplexColumnVector& cv); | |
79 | |
80 explicit ComplexMatrix (const ComplexDiagMatrix& a); | |
81 | |
82 explicit ComplexMatrix (const boolMatrix& a); | |
83 | |
84 explicit ComplexMatrix (const charMatrix& a); | |
1574 | 85 |
458 | 86 ComplexMatrix& operator = (const ComplexMatrix& a) |
87 { | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
88 MArray<Complex>::operator = (a); |
458 | 89 return *this; |
90 } | |
91 | |
2384 | 92 bool operator == (const ComplexMatrix& a) const; |
93 bool operator != (const ComplexMatrix& a) const; | |
458 | 94 |
2815 | 95 bool is_hermitian (void) const; |
96 | |
1359 | 97 // destructive insert/delete/reorder operations |
458 | 98 |
5275 | 99 ComplexMatrix& insert (const Matrix& a, octave_idx_type r, octave_idx_type c); |
100 ComplexMatrix& insert (const RowVector& a, octave_idx_type r, octave_idx_type c); | |
101 ComplexMatrix& insert (const ColumnVector& a, octave_idx_type r, octave_idx_type c); | |
102 ComplexMatrix& insert (const DiagMatrix& a, octave_idx_type r, octave_idx_type c); | |
458 | 103 |
5275 | 104 ComplexMatrix& insert (const ComplexMatrix& a, octave_idx_type r, octave_idx_type c); |
105 ComplexMatrix& insert (const ComplexRowVector& a, octave_idx_type r, octave_idx_type c); | |
106 ComplexMatrix& insert (const ComplexColumnVector& a, octave_idx_type r, octave_idx_type c); | |
107 ComplexMatrix& insert (const ComplexDiagMatrix& a, octave_idx_type r, octave_idx_type c); | |
458 | 108 |
109 ComplexMatrix& fill (double val); | |
110 ComplexMatrix& fill (const Complex& val); | |
5275 | 111 ComplexMatrix& fill (double val, octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2); |
112 ComplexMatrix& fill (const Complex& val, octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2); | |
458 | 113 |
114 ComplexMatrix append (const Matrix& a) const; | |
115 ComplexMatrix append (const RowVector& a) const; | |
116 ComplexMatrix append (const ColumnVector& a) const; | |
117 ComplexMatrix append (const DiagMatrix& a) const; | |
118 | |
119 ComplexMatrix append (const ComplexMatrix& a) const; | |
120 ComplexMatrix append (const ComplexRowVector& a) const; | |
121 ComplexMatrix append (const ComplexColumnVector& a) const; | |
122 ComplexMatrix append (const ComplexDiagMatrix& a) const; | |
123 | |
124 ComplexMatrix stack (const Matrix& a) const; | |
125 ComplexMatrix stack (const RowVector& a) const; | |
126 ComplexMatrix stack (const ColumnVector& a) const; | |
127 ComplexMatrix stack (const DiagMatrix& a) const; | |
128 | |
129 ComplexMatrix stack (const ComplexMatrix& a) const; | |
130 ComplexMatrix stack (const ComplexRowVector& a) const; | |
131 ComplexMatrix stack (const ComplexColumnVector& a) const; | |
132 ComplexMatrix stack (const ComplexDiagMatrix& a) const; | |
133 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7788
diff
changeset
|
134 ComplexMatrix hermitian (void) const |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
135 { return MArray<Complex>::hermitian (std::conj); } |
3225 | 136 ComplexMatrix transpose (void) const |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
137 { return MArray<Complex>::transpose (); } |
458 | 138 |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
139 friend OCTAVE_API ComplexMatrix conj (const ComplexMatrix& a); |
458 | 140 |
1359 | 141 // resize is the destructive equivalent for this one |
458 | 142 |
5275 | 143 ComplexMatrix extract (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const; |
458 | 144 |
5275 | 145 ComplexMatrix extract_n (octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const; |
4316 | 146 |
1359 | 147 // extract row or column i. |
458 | 148 |
5275 | 149 ComplexRowVector row (octave_idx_type i) const; |
458 | 150 |
5275 | 151 ComplexColumnVector column (octave_idx_type i) const; |
458 | 152 |
6207 | 153 private: |
154 ComplexMatrix tinverse (MatrixType &mattype, octave_idx_type& info, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
155 double& rcon, int force, int calc_cond) const; |
6207 | 156 |
157 ComplexMatrix finverse (MatrixType &mattype, octave_idx_type& info, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
158 double& rcon, int force, int calc_cond) const; |
6207 | 159 |
160 public: | |
458 | 161 ComplexMatrix inverse (void) const; |
6479 | 162 ComplexMatrix inverse (octave_idx_type& info) const; |
7788 | 163 ComplexMatrix inverse (octave_idx_type& info, double& rcon, int force = 0, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
164 int calc_cond = 1) const; |
6479 | 165 |
6207 | 166 ComplexMatrix inverse (MatrixType &mattype) const; |
167 ComplexMatrix inverse (MatrixType &mattype, octave_idx_type& info) const; | |
168 ComplexMatrix inverse (MatrixType &mattype, octave_idx_type& info, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
169 double& rcon, int force = 0, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
170 int calc_cond = 1) const; |
458 | 171 |
4384 | 172 ComplexMatrix pseudo_inverse (double tol = 0.0) const; |
740 | 173 |
458 | 174 ComplexMatrix fourier (void) const; |
175 ComplexMatrix ifourier (void) const; | |
176 | |
677 | 177 ComplexMatrix fourier2d (void) const; |
178 ComplexMatrix ifourier2d (void) const; | |
179 | |
458 | 180 ComplexDET determinant (void) const; |
5275 | 181 ComplexDET determinant (octave_idx_type& info) const; |
7788 | 182 ComplexDET determinant (octave_idx_type& info, double& rcon, int calc_cond = 1) const; |
8336
9813c07ca946
make det take advantage of matrix type
Jaroslav Hajek <highegg@gmail.com>
parents:
8335
diff
changeset
|
183 ComplexDET determinant (MatrixType &mattype, octave_idx_type& info, |
9813c07ca946
make det take advantage of matrix type
Jaroslav Hajek <highegg@gmail.com>
parents:
8335
diff
changeset
|
184 double& rcon, int calc_cond = 1) const; |
7788 | 185 |
186 double rcond (void) const; | |
187 double rcond (MatrixType &mattype) const; | |
458 | 188 |
5785 | 189 private: |
190 // Upper triangular matrix solvers | |
191 ComplexMatrix utsolve (MatrixType &typ, const ComplexMatrix& b, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
192 octave_idx_type& info, double& rcon, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
193 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
194 bool calc_cond = false, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
195 blas_trans_type transt = blas_no_trans) const; |
5785 | 196 |
197 // Lower triangular matrix solvers | |
198 ComplexMatrix ltsolve (MatrixType &typ, const ComplexMatrix& b, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
199 octave_idx_type& info, double& rcon, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
200 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
201 bool calc_cond = false, blas_trans_type transt = blas_no_trans) const; |
5785 | 202 |
203 // Full matrix solvers (umfpack/cholesky) | |
204 ComplexMatrix fsolve (MatrixType &typ, const ComplexMatrix& b, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
205 octave_idx_type& info, double& rcon, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
206 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
207 bool calc_cond = false) const; |
5785 | 208 |
209 public: | |
210 // Generic interface to solver with no probing of type | |
211 ComplexMatrix solve (MatrixType &typ, const Matrix& b) const; | |
212 ComplexMatrix solve (MatrixType &typ, const Matrix& b, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
213 octave_idx_type& info) const; |
5785 | 214 ComplexMatrix solve (MatrixType &typ, const Matrix& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
215 octave_idx_type& info, double& rcon) const; |
5785 | 216 ComplexMatrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
217 double& rcon, solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
218 bool singular_fallback = true, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
219 blas_trans_type transt = blas_no_trans) const; |
5785 | 220 |
221 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b) const; | |
222 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
223 octave_idx_type& info) const; |
5785 | 224 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
225 octave_idx_type& info, double& rcon) const; |
5785 | 226 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
227 octave_idx_type& info, double& rcon, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
228 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
229 bool singular_fallback = true, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
230 blas_trans_type transt = blas_no_trans) const; |
5785 | 231 |
232 ComplexColumnVector solve (MatrixType &typ, const ColumnVector& b) const; | |
233 ComplexColumnVector solve (MatrixType &typ, const ColumnVector& b, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
234 octave_idx_type& info) const; |
5785 | 235 ComplexColumnVector solve (MatrixType &typ, const ColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
236 octave_idx_type& info, double& rcon) const; |
5785 | 237 ComplexColumnVector solve (MatrixType &typ, const ColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
238 octave_idx_type& info, double& rcon, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
239 solve_singularity_handler sing_handler, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
240 blas_trans_type transt = blas_no_trans) const; |
5785 | 241 |
242 ComplexColumnVector solve (MatrixType &typ, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
243 const ComplexColumnVector& b) const; |
5785 | 244 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
245 octave_idx_type& info) const; |
5785 | 246 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
247 octave_idx_type& info, double& rcon) const; |
5785 | 248 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
249 octave_idx_type& info, double& rcon, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
250 solve_singularity_handler sing_handler, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
251 blas_trans_type transt = blas_no_trans) const; |
5785 | 252 |
253 // Generic interface to solver with probing of type | |
458 | 254 ComplexMatrix solve (const Matrix& b) const; |
5275 | 255 ComplexMatrix solve (const Matrix& b, octave_idx_type& info) const; |
7788 | 256 ComplexMatrix solve (const Matrix& b, octave_idx_type& info, double& rcon) const; |
257 ComplexMatrix solve (const Matrix& b, octave_idx_type& info, double& rcon, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
258 solve_singularity_handler sing_handler, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
259 blas_trans_type transt = blas_no_trans) const; |
458 | 260 |
261 ComplexMatrix solve (const ComplexMatrix& b) const; | |
5275 | 262 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info) const; |
7788 | 263 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, double& rcon) const; |
264 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, double& rcon, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
265 solve_singularity_handler sing_handler, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
266 blas_trans_type transt = blas_no_trans) const; |
458 | 267 |
3585 | 268 ComplexColumnVector solve (const ColumnVector& b) const; |
5275 | 269 ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info) const; |
270 ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
271 double& rcon) const; |
7788 | 272 ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info, double& rcon, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
273 solve_singularity_handler sing_handler, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
274 blas_trans_type transt = blas_no_trans) const; |
3585 | 275 |
458 | 276 ComplexColumnVector solve (const ComplexColumnVector& b) const; |
5275 | 277 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info) const; |
278 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
279 double& rcon) const; |
5275 | 280 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
281 double& rcon, solve_singularity_handler sing_handler, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
282 blas_trans_type transt = blas_no_trans) const; |
458 | 283 |
3585 | 284 ComplexMatrix lssolve (const Matrix& b) const; |
5275 | 285 ComplexMatrix lssolve (const Matrix& b, octave_idx_type& info) const; |
7076 | 286 ComplexMatrix lssolve (const Matrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
287 octave_idx_type& rank) const; |
7076 | 288 ComplexMatrix lssolve (const Matrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
289 octave_idx_type& rank, double& rcon) const; |
3585 | 290 |
458 | 291 ComplexMatrix lssolve (const ComplexMatrix& b) const; |
5275 | 292 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info) const; |
293 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
294 octave_idx_type& rank) const; |
7076 | 295 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
296 octave_idx_type& rank, double& rcon) const; |
458 | 297 |
3585 | 298 ComplexColumnVector lssolve (const ColumnVector& b) const; |
7076 | 299 ComplexColumnVector lssolve (const ColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
300 octave_idx_type& info) const; |
5275 | 301 ComplexColumnVector lssolve (const ColumnVector& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
302 octave_idx_type& rank) const; |
7076 | 303 ComplexColumnVector lssolve (const ColumnVector& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
304 octave_idx_type& rank, double& rcon) const; |
3585 | 305 |
458 | 306 ComplexColumnVector lssolve (const ComplexColumnVector& b) const; |
7076 | 307 ComplexColumnVector lssolve (const ComplexColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
308 octave_idx_type& info) const; |
7076 | 309 ComplexColumnVector lssolve (const ComplexColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
310 octave_idx_type& info, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
311 octave_idx_type& rank) const; |
7076 | 312 ComplexColumnVector lssolve (const ComplexColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
313 octave_idx_type& info, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10301
diff
changeset
|
314 octave_idx_type& rank, double& rcon) const; |
458 | 315 |
1359 | 316 // matrix by diagonal matrix -> matrix operations |
458 | 317 |
318 ComplexMatrix& operator += (const DiagMatrix& a); | |
319 ComplexMatrix& operator -= (const DiagMatrix& a); | |
320 | |
321 ComplexMatrix& operator += (const ComplexDiagMatrix& a); | |
322 ComplexMatrix& operator -= (const ComplexDiagMatrix& a); | |
323 | |
1359 | 324 // matrix by matrix -> matrix operations |
458 | 325 |
326 ComplexMatrix& operator += (const Matrix& a); | |
327 ComplexMatrix& operator -= (const Matrix& a); | |
328 | |
1359 | 329 // unary operations |
458 | 330 |
2964 | 331 boolMatrix operator ! (void) const; |
458 | 332 |
1359 | 333 // other operations |
458 | 334 |
7922
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7800
diff
changeset
|
335 bool any_element_is_nan (void) const; |
2384 | 336 bool any_element_is_inf_or_nan (void) const; |
2408 | 337 bool all_elements_are_real (void) const; |
2384 | 338 bool all_integers (double& max_val, double& min_val) const; |
339 bool too_large_for_float (void) const; | |
1963 | 340 |
4017 | 341 boolMatrix all (int dim = -1) const; |
342 boolMatrix any (int dim = -1) const; | |
458 | 343 |
4017 | 344 ComplexMatrix cumprod (int dim = -1) const; |
345 ComplexMatrix cumsum (int dim = -1) const; | |
346 ComplexMatrix prod (int dim = -1) const; | |
347 ComplexMatrix sum (int dim = -1) const; | |
348 ComplexMatrix sumsq (int dim = -1) const; | |
4329 | 349 Matrix abs (void) const; |
458 | 350 |
7620
36594d5bbe13
Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
351 ComplexMatrix diag (octave_idx_type k = 0) const; |
458 | 352 |
5275 | 353 bool row_is_real_only (octave_idx_type) const; |
354 bool column_is_real_only (octave_idx_type) const; | |
458 | 355 |
2354 | 356 ComplexColumnVector row_min (void) const; |
458 | 357 ComplexColumnVector row_max (void) const; |
2354 | 358 |
5275 | 359 ComplexColumnVector row_min (Array<octave_idx_type>& index) const; |
360 ComplexColumnVector row_max (Array<octave_idx_type>& index) const; | |
458 | 361 |
362 ComplexRowVector column_min (void) const; | |
2354 | 363 ComplexRowVector column_max (void) const; |
458 | 364 |
5275 | 365 ComplexRowVector column_min (Array<octave_idx_type>& index) const; |
366 ComplexRowVector column_max (Array<octave_idx_type>& index) const; | |
458 | 367 |
1359 | 368 // i/o |
458 | 369 |
6108 | 370 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const ComplexMatrix& a); |
371 friend OCTAVE_API std::istream& operator >> (std::istream& is, ComplexMatrix& a); | |
458 | 372 |
3933 | 373 static Complex resize_fill_value (void) { return Complex (0.0, 0.0); } |
374 | |
458 | 375 }; |
376 | |
8650
a1ae2aae903e
abs,real,imag,conj: use code from mx-inlines rather than the generic map
Jaroslav Hajek <highegg@gmail.com>
parents:
8392
diff
changeset
|
377 extern OCTAVE_API ComplexMatrix conj (const ComplexMatrix& a); |
a1ae2aae903e
abs,real,imag,conj: use code from mx-inlines rather than the generic map
Jaroslav Hajek <highegg@gmail.com>
parents:
8392
diff
changeset
|
378 |
5508 | 379 // column vector by row vector -> matrix operations |
380 | |
6108 | 381 extern OCTAVE_API ComplexMatrix |
5508 | 382 operator * (const ColumnVector& a, const ComplexRowVector& b); |
383 | |
6108 | 384 extern OCTAVE_API ComplexMatrix |
5508 | 385 operator * (const ComplexColumnVector& a, const RowVector& b); |
1819 | 386 |
6108 | 387 extern OCTAVE_API ComplexMatrix |
5508 | 388 operator * (const ComplexColumnVector& a, const ComplexRowVector& b); |
389 | |
6108 | 390 extern OCTAVE_API ComplexMatrix |
5508 | 391 Givens (const Complex&, const Complex&); |
392 | |
6108 | 393 extern OCTAVE_API ComplexMatrix |
5508 | 394 Sylvester (const ComplexMatrix&, const ComplexMatrix&, const ComplexMatrix&); |
1819 | 395 |
7800
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
396 extern OCTAVE_API ComplexMatrix |
9665
1dba57e9d08d
use blas_trans_type for xgemm
Jaroslav Hajek <highegg@gmail.com>
parents:
9663
diff
changeset
|
397 xgemm (const ComplexMatrix& a, const ComplexMatrix& b, |
1dba57e9d08d
use blas_trans_type for xgemm
Jaroslav Hajek <highegg@gmail.com>
parents:
9663
diff
changeset
|
398 blas_trans_type transa = blas_no_trans, |
1dba57e9d08d
use blas_trans_type for xgemm
Jaroslav Hajek <highegg@gmail.com>
parents:
9663
diff
changeset
|
399 blas_trans_type transb = blas_no_trans); |
7800
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
400 |
6108 | 401 extern OCTAVE_API ComplexMatrix operator * (const Matrix&, const ComplexMatrix&); |
402 extern OCTAVE_API ComplexMatrix operator * (const ComplexMatrix&, const Matrix&); | |
403 extern OCTAVE_API ComplexMatrix operator * (const ComplexMatrix&, const ComplexMatrix&); | |
2828 | 404 |
6108 | 405 extern OCTAVE_API ComplexMatrix min (const Complex& c, const ComplexMatrix& m); |
406 extern OCTAVE_API ComplexMatrix min (const ComplexMatrix& m, const Complex& c); | |
407 extern OCTAVE_API ComplexMatrix min (const ComplexMatrix& a, const ComplexMatrix& b); | |
4309 | 408 |
6108 | 409 extern OCTAVE_API ComplexMatrix max (const Complex& c, const ComplexMatrix& m); |
410 extern OCTAVE_API ComplexMatrix max (const ComplexMatrix& m, const Complex& c); | |
411 extern OCTAVE_API ComplexMatrix max (const ComplexMatrix& a, const ComplexMatrix& b); | |
4309 | 412 |
9653
e087d7c77ff9
improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
9237
diff
changeset
|
413 extern OCTAVE_API ComplexMatrix linspace (const ComplexColumnVector& x1, |
e087d7c77ff9
improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
9237
diff
changeset
|
414 const ComplexColumnVector& x2, |
e087d7c77ff9
improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
9237
diff
changeset
|
415 octave_idx_type n); |
e087d7c77ff9
improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
9237
diff
changeset
|
416 |
e087d7c77ff9
improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
9237
diff
changeset
|
417 |
6708 | 418 MS_CMP_OP_DECLS (ComplexMatrix, Complex, OCTAVE_API) |
419 MS_BOOL_OP_DECLS (ComplexMatrix, Complex, OCTAVE_API) | |
2870 | 420 |
6708 | 421 SM_CMP_OP_DECLS (Complex, ComplexMatrix, OCTAVE_API) |
422 SM_BOOL_OP_DECLS (Complex, ComplexMatrix, OCTAVE_API) | |
2870 | 423 |
6708 | 424 MM_CMP_OP_DECLS (ComplexMatrix, ComplexMatrix, OCTAVE_API) |
425 MM_BOOL_OP_DECLS (ComplexMatrix, ComplexMatrix, OCTAVE_API) | |
2870 | 426 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
427 MARRAY_FORWARD_DEFS (MArray, ComplexMatrix, Complex) |
3573 | 428 |
458 | 429 #endif |