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