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