Mercurial > hg > octave-lyh
annotate liboctave/CSparse.h @ 8303:b11c31849b44
improve norm computation capabilities
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 31 Oct 2008 08:05:32 +0100 |
parents | 935be827eaf8 |
children | 64cf956a109c |
rev | line source |
---|---|
5164 | 1 /* |
2 | |
7017 | 3 Copyright (C) 2004, 2005, 2006, 2007 David Bateman |
7016 | 4 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Andy Adler |
5 | |
6 This file is part of Octave. | |
5164 | 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. | |
5164 | 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/>. | |
5164 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_CSparse_h) | |
25 #define octave_CSparse_h 1 | |
26 | |
27 #include "dMatrix.h" | |
28 #include "dNDArray.h" | |
29 #include "CNDArray.h" | |
30 #include "dColVector.h" | |
31 #include "CColVector.h" | |
32 #include "oct-cmplx.h" | |
33 | |
34 #include "CmplxDET.h" | |
35 #include "MSparse.h" | |
36 #include "MSparse-defs.h" | |
37 #include "Sparse-op-defs.h" | |
5785 | 38 #include "MatrixType.h" |
5164 | 39 |
40 class SparseMatrix; | |
41 class SparseBoolMatrix; | |
42 | |
43 class | |
6108 | 44 OCTAVE_API |
5164 | 45 SparseComplexMatrix : public MSparse<Complex> |
46 { | |
47 public: | |
48 | |
49 typedef void (*solve_singularity_handler) (double rcond); | |
50 | |
51 SparseComplexMatrix (void) : MSparse<Complex> () { } | |
52 | |
5275 | 53 SparseComplexMatrix (octave_idx_type r, octave_idx_type c) : MSparse<Complex> (r, c) { } |
5164 | 54 |
6823 | 55 SparseComplexMatrix (const dim_vector& dv, octave_idx_type nz = 0) : |
56 MSparse<Complex> (dv, nz) { } | |
57 | |
5275 | 58 explicit SparseComplexMatrix (octave_idx_type r, octave_idx_type c, Complex val) |
5164 | 59 : MSparse<Complex> (r, c, val) { } |
60 | |
5275 | 61 SparseComplexMatrix (octave_idx_type r, octave_idx_type c, double val) |
5164 | 62 : MSparse<Complex> (r, c, Complex (val)) { } |
63 | |
64 SparseComplexMatrix (const SparseComplexMatrix& a) | |
65 : MSparse<Complex> (a) { } | |
66 | |
67 SparseComplexMatrix (const SparseComplexMatrix& a, const dim_vector& dv) | |
68 : MSparse<Complex> (a, dv) { } | |
69 | |
70 SparseComplexMatrix (const MSparse<Complex>& a) : MSparse<Complex> (a) { } | |
71 | |
72 explicit SparseComplexMatrix (const ComplexMatrix& a) | |
73 : MSparse<Complex> (a) { } | |
74 | |
75 explicit SparseComplexMatrix (const ComplexNDArray& a) | |
76 : MSparse<Complex> (a) { } | |
77 | |
5275 | 78 explicit SparseComplexMatrix (const Array<Complex> a, const Array<octave_idx_type>& r, |
79 const Array<octave_idx_type>& c, octave_idx_type nr = -1, | |
80 octave_idx_type nc = -1, bool sum_terms = true) | |
5164 | 81 : MSparse<Complex> (a, r, c, nr, nc, sum_terms) { } |
82 | |
83 explicit SparseComplexMatrix (const Array<Complex> a, | |
84 const Array<double>& r, | |
5275 | 85 const Array<double>& c, octave_idx_type nr = -1, |
86 octave_idx_type nc = -1, bool sum_terms = true) | |
5164 | 87 : MSparse<Complex> (a, r, c, nr, nc, sum_terms) { } |
88 | |
89 explicit SparseComplexMatrix (const SparseMatrix& a); | |
90 | |
91 explicit SparseComplexMatrix (const SparseBoolMatrix& a); | |
92 | |
5275 | 93 SparseComplexMatrix (octave_idx_type r, octave_idx_type c, octave_idx_type num_nz) |
5164 | 94 : MSparse<Complex> (r, c, num_nz) { } |
95 | |
96 SparseComplexMatrix& operator = (const SparseComplexMatrix& a) | |
97 { | |
98 MSparse<Complex>::operator = (a); | |
99 return *this; | |
100 } | |
101 | |
102 bool operator == (const SparseComplexMatrix& a) const; | |
103 bool operator != (const SparseComplexMatrix& a) const; | |
104 | |
105 bool is_hermitian (void) const; | |
106 | |
107 SparseComplexMatrix max (int dim = 0) const; | |
5275 | 108 SparseComplexMatrix max (Array2<octave_idx_type>& index, int dim = 0) const; |
5164 | 109 SparseComplexMatrix min (int dim = 0) const; |
5275 | 110 SparseComplexMatrix min (Array2<octave_idx_type>& index, int dim = 0) const; |
5164 | 111 |
5275 | 112 SparseComplexMatrix& insert (const SparseComplexMatrix& a, octave_idx_type r, octave_idx_type c); |
113 SparseComplexMatrix& insert (const SparseMatrix& a, octave_idx_type r, octave_idx_type c); | |
6823 | 114 SparseComplexMatrix& insert (const SparseComplexMatrix& a, const Array<octave_idx_type>& indx); |
115 SparseComplexMatrix& insert (const SparseMatrix& a, const Array<octave_idx_type>& indx); | |
5164 | 116 |
117 SparseComplexMatrix concat (const SparseComplexMatrix& rb, | |
5275 | 118 const Array<octave_idx_type>& ra_idx); |
5164 | 119 SparseComplexMatrix concat (const SparseMatrix& rb, |
5275 | 120 const Array<octave_idx_type>& ra_idx); |
5164 | 121 |
122 ComplexMatrix matrix_value (void) const; | |
123 | |
124 SparseComplexMatrix hermitian (void) const; // complex conjugate transpose | |
125 SparseComplexMatrix transpose (void) const | |
126 { return MSparse<Complex>::transpose (); } | |
127 | |
128 friend SparseComplexMatrix conj (const SparseComplexMatrix& a); | |
129 | |
8303
b11c31849b44
improve norm computation capabilities
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
130 // extract row or column i. |
b11c31849b44
improve norm computation capabilities
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
131 |
b11c31849b44
improve norm computation capabilities
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
132 ComplexRowVector row (octave_idx_type i) const; |
b11c31849b44
improve norm computation capabilities
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
133 |
b11c31849b44
improve norm computation capabilities
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
134 ComplexColumnVector column (octave_idx_type i) const; |
b11c31849b44
improve norm computation capabilities
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
135 |
5506 | 136 private: |
5785 | 137 SparseComplexMatrix dinverse (MatrixType &mattyp, octave_idx_type& info, |
5506 | 138 double& rcond, const bool force = false, |
139 const bool calccond = true) const; | |
140 | |
5785 | 141 SparseComplexMatrix tinverse (MatrixType &mattyp, octave_idx_type& info, |
5506 | 142 double& rcond, const bool force = false, |
143 const bool calccond = true) const; | |
144 | |
145 public: | |
5164 | 146 SparseComplexMatrix inverse (void) const; |
5785 | 147 SparseComplexMatrix inverse (MatrixType& mattype) const; |
148 SparseComplexMatrix inverse (MatrixType& mattype, | |
5506 | 149 octave_idx_type& info) const; |
5785 | 150 SparseComplexMatrix inverse (MatrixType& mattype, octave_idx_type& info, |
5506 | 151 double& rcond, int force = 0, |
5164 | 152 int calc_cond = 1) const; |
153 | |
154 ComplexDET determinant (void) const; | |
5275 | 155 ComplexDET determinant (octave_idx_type& info) const; |
156 ComplexDET determinant (octave_idx_type& info, double& rcond, | |
5164 | 157 int calc_cond = 1) const; |
158 | |
159 private: | |
160 // Diagonal matrix solvers | |
5785 | 161 ComplexMatrix dsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
5681 | 162 double& rcond, solve_singularity_handler sing_handler, |
163 bool calc_cond = false) const; | |
5164 | 164 |
5785 | 165 ComplexMatrix dsolve (MatrixType &typ, const ComplexMatrix& b, |
5681 | 166 octave_idx_type& info, double& rcond, |
167 solve_singularity_handler sing_handler, | |
168 bool calc_cond = false) const; | |
5164 | 169 |
5785 | 170 SparseComplexMatrix dsolve (MatrixType &typ, const SparseMatrix& b, |
5681 | 171 octave_idx_type& info, double& rcond, |
172 solve_singularity_handler sing_handler, | |
173 bool calc_cond = false) const; | |
5164 | 174 |
5785 | 175 SparseComplexMatrix dsolve (MatrixType &typ, const SparseComplexMatrix& b, |
5275 | 176 octave_idx_type& info, double& rcond, |
5681 | 177 solve_singularity_handler sing_handler, |
178 bool calc_cond = false) const; | |
5164 | 179 |
180 // Upper triangular matrix solvers | |
5785 | 181 ComplexMatrix utsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
5681 | 182 double& rcond, solve_singularity_handler sing_handler, |
183 bool calc_cond = false) const; | |
5164 | 184 |
5785 | 185 ComplexMatrix utsolve (MatrixType &typ, const ComplexMatrix& b, |
5681 | 186 octave_idx_type& info, double& rcond, |
187 solve_singularity_handler sing_handler, | |
188 bool calc_cond = false) const; | |
5164 | 189 |
5785 | 190 SparseComplexMatrix utsolve (MatrixType &typ, const SparseMatrix& b, |
5681 | 191 octave_idx_type& info, double& rcond, |
192 solve_singularity_handler sing_handler, | |
193 bool calc_cond = false) const; | |
5164 | 194 |
5785 | 195 SparseComplexMatrix utsolve (MatrixType &typ, const SparseComplexMatrix& b, |
5275 | 196 octave_idx_type& info, double& rcond, |
5681 | 197 solve_singularity_handler sing_handler, |
198 bool calc_cond = false) const; | |
5164 | 199 |
200 // Lower triangular matrix solvers | |
5785 | 201 ComplexMatrix ltsolve (MatrixType &typ, const Matrix& b, |
5681 | 202 octave_idx_type& info, double& rcond, |
203 solve_singularity_handler sing_handler, | |
204 bool calc_cond = false) const; | |
5164 | 205 |
5785 | 206 ComplexMatrix ltsolve (MatrixType &typ, const ComplexMatrix& b, |
5681 | 207 octave_idx_type& info, double& rcond, |
208 solve_singularity_handler sing_handler, | |
209 bool calc_cond = false) const; | |
5164 | 210 |
5785 | 211 SparseComplexMatrix ltsolve (MatrixType &typ, const SparseMatrix& b, |
5681 | 212 octave_idx_type& info, double& rcond, |
213 solve_singularity_handler sing_handler, | |
214 bool calc_cond = false) const; | |
5164 | 215 |
5785 | 216 SparseComplexMatrix ltsolve (MatrixType &typ, const SparseComplexMatrix& b, |
5275 | 217 octave_idx_type& info, double& rcond, |
5681 | 218 solve_singularity_handler sing_handler, |
219 bool calc_cond = false) const; | |
5164 | 220 |
221 // Tridiagonal matrix solvers | |
5785 | 222 ComplexMatrix trisolve (MatrixType &typ, const Matrix& b, |
5681 | 223 octave_idx_type& info, double& rcond, |
224 solve_singularity_handler sing_handler, | |
225 bool calc_cond = false) const; | |
5164 | 226 |
5785 | 227 ComplexMatrix trisolve (MatrixType &typ, const ComplexMatrix& b, |
5681 | 228 octave_idx_type& info, double& rcond, |
229 solve_singularity_handler sing_handler, | |
230 bool calc_cond = false) const; | |
5164 | 231 |
5785 | 232 SparseComplexMatrix trisolve (MatrixType &typ, const SparseMatrix& b, |
5681 | 233 octave_idx_type& info, double& rcond, |
234 solve_singularity_handler sing_handler, | |
235 bool calc_cond = false) const; | |
5164 | 236 |
5785 | 237 SparseComplexMatrix trisolve (MatrixType &typ, const SparseComplexMatrix& b, |
5275 | 238 octave_idx_type& info, double& rcond, |
5681 | 239 solve_singularity_handler sing_handler, |
240 bool calc_cond = false) const; | |
5164 | 241 |
242 // Banded matrix solvers (umfpack/cholesky) | |
5785 | 243 ComplexMatrix bsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
5681 | 244 double& rcond, solve_singularity_handler sing_handler, |
245 bool calc_cond = false) const; | |
5164 | 246 |
5785 | 247 ComplexMatrix bsolve (MatrixType &typ, const ComplexMatrix& b, |
5681 | 248 octave_idx_type& info, double& rcond, |
249 solve_singularity_handler sing_handler, | |
250 bool calc_cond = false) const; | |
5164 | 251 |
5785 | 252 SparseComplexMatrix bsolve (MatrixType &typ, const SparseMatrix& b, |
5681 | 253 octave_idx_type& info, double& rcond, |
254 solve_singularity_handler sing_handler, | |
255 bool calc_cond = false) const; | |
5164 | 256 |
5785 | 257 SparseComplexMatrix bsolve (MatrixType &typ, const SparseComplexMatrix& b, |
5275 | 258 octave_idx_type& info, double& rcond, |
5681 | 259 solve_singularity_handler sing_handler, |
260 bool calc_cond = false) const; | |
5164 | 261 |
262 // Full matrix solvers (umfpack/cholesky) | |
5681 | 263 void * factorize (octave_idx_type& err, double &rcond, Matrix &Control, |
264 Matrix &Info, solve_singularity_handler sing_handler, | |
265 bool calc_cond) const; | |
5164 | 266 |
5785 | 267 ComplexMatrix fsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
5681 | 268 double& rcond, solve_singularity_handler sing_handler, |
269 bool calc_cond = false) const; | |
5164 | 270 |
5785 | 271 ComplexMatrix fsolve (MatrixType &typ, const ComplexMatrix& b, |
5681 | 272 octave_idx_type& info, double& rcond, |
273 solve_singularity_handler sing_handler, | |
274 bool calc_cond = false) const; | |
5164 | 275 |
5785 | 276 SparseComplexMatrix fsolve (MatrixType &typ, const SparseMatrix& b, |
5681 | 277 octave_idx_type& info, double& rcond, |
278 solve_singularity_handler sing_handler, | |
279 bool calc_cond = false) const; | |
5164 | 280 |
5785 | 281 SparseComplexMatrix fsolve (MatrixType &typ, const SparseComplexMatrix& b, |
5275 | 282 octave_idx_type& info, double& rcond, |
5681 | 283 solve_singularity_handler sing_handler, |
284 bool calc_cond = false) const; | |
5164 | 285 |
286 public: | |
287 // Generic interface to solver with no probing of type | |
5785 | 288 ComplexMatrix solve (MatrixType &typ, const Matrix& b) const; |
289 ComplexMatrix solve (MatrixType &typ, const Matrix& b, | |
5697 | 290 octave_idx_type& info) const; |
5785 | 291 ComplexMatrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
5697 | 292 double& rcond) const; |
5785 | 293 ComplexMatrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
5697 | 294 double& rcond, solve_singularity_handler sing_handler, |
295 bool singular_fallback = true) const; | |
5164 | 296 |
5785 | 297 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b) const; |
298 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, | |
5275 | 299 octave_idx_type& info) const; |
5785 | 300 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, |
5697 | 301 octave_idx_type& info, double& rcond) const; |
5785 | 302 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, |
5697 | 303 octave_idx_type& info, double& rcond, |
304 solve_singularity_handler sing_handler, | |
305 bool singular_fallback = true) const; | |
5164 | 306 |
5785 | 307 SparseComplexMatrix solve (MatrixType &typ, const SparseMatrix& b) const; |
308 SparseComplexMatrix solve (MatrixType &typ, const SparseMatrix& b, | |
5697 | 309 octave_idx_type& info) const; |
5785 | 310 SparseComplexMatrix solve (MatrixType &typ, const SparseMatrix& b, |
5697 | 311 octave_idx_type& info, double& rcond) const; |
5785 | 312 SparseComplexMatrix solve (MatrixType &typ, const SparseMatrix& b, |
5697 | 313 octave_idx_type& info, double& rcond, |
314 solve_singularity_handler sing_handler, | |
315 bool singular_fallback = true) const; | |
5164 | 316 |
5785 | 317 SparseComplexMatrix solve (MatrixType &typ, |
5164 | 318 const SparseComplexMatrix& b) const; |
5785 | 319 SparseComplexMatrix solve (MatrixType &typ, const SparseComplexMatrix& b, |
5275 | 320 octave_idx_type& info) const; |
5785 | 321 SparseComplexMatrix solve (MatrixType &typ, const SparseComplexMatrix& b, |
5275 | 322 octave_idx_type& info, double& rcond) const; |
5785 | 323 SparseComplexMatrix solve (MatrixType &typ, const SparseComplexMatrix& b, |
5697 | 324 octave_idx_type& info, double& rcond, |
325 solve_singularity_handler sing_handler, | |
326 bool singular_fallback = true) const; | |
5164 | 327 |
5785 | 328 ComplexColumnVector solve (MatrixType &typ, const ColumnVector& b) const; |
329 ComplexColumnVector solve (MatrixType &typ, const ColumnVector& b, | |
5697 | 330 octave_idx_type& info) const; |
5785 | 331 ComplexColumnVector solve (MatrixType &typ, const ColumnVector& b, |
5697 | 332 octave_idx_type& info, double& rcond) const; |
5785 | 333 ComplexColumnVector solve (MatrixType &typ, const ColumnVector& b, |
5697 | 334 octave_idx_type& info, double& rcond, |
335 solve_singularity_handler sing_handler) const; | |
5164 | 336 |
5785 | 337 ComplexColumnVector solve (MatrixType &typ, |
5164 | 338 const ComplexColumnVector& b) const; |
5785 | 339 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, |
5697 | 340 octave_idx_type& info) const; |
5785 | 341 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, |
5275 | 342 octave_idx_type& info, double& rcond) const; |
5785 | 343 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, |
5275 | 344 octave_idx_type& info, double& rcond, |
5164 | 345 solve_singularity_handler sing_handler) const; |
346 | |
347 // Generic interface to solver with probing of type | |
348 ComplexMatrix solve (const Matrix& b) const; | |
5275 | 349 ComplexMatrix solve (const Matrix& b, octave_idx_type& info) const; |
5697 | 350 ComplexMatrix solve (const Matrix& b, octave_idx_type& info, |
351 double& rcond) const; | |
5275 | 352 ComplexMatrix solve (const Matrix& b, octave_idx_type& info, double& rcond, |
5164 | 353 solve_singularity_handler sing_handler) const; |
354 | |
355 ComplexMatrix solve (const ComplexMatrix& b) const; | |
5275 | 356 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info) const; |
357 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, | |
5164 | 358 double& rcond) const; |
5697 | 359 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, |
360 double& rcond, solve_singularity_handler sing_handler) const; | |
5164 | 361 |
362 SparseComplexMatrix solve (const SparseMatrix& b) const; | |
5275 | 363 SparseComplexMatrix solve (const SparseMatrix& b, octave_idx_type& info) const; |
364 SparseComplexMatrix solve (const SparseMatrix& b, octave_idx_type& info, | |
5164 | 365 double& rcond) const; |
5275 | 366 SparseComplexMatrix solve (const SparseMatrix& b, octave_idx_type& info, |
5164 | 367 double& rcond, |
5697 | 368 solve_singularity_handler sing_handler) const; |
5164 | 369 |
370 SparseComplexMatrix solve (const SparseComplexMatrix& b) const; | |
5697 | 371 SparseComplexMatrix solve (const SparseComplexMatrix& b, |
372 octave_idx_type& info) const; | |
373 SparseComplexMatrix solve (const SparseComplexMatrix& b, | |
374 octave_idx_type& info, double& rcond) const; | |
375 SparseComplexMatrix solve (const SparseComplexMatrix& b, | |
376 octave_idx_type& info, double& rcond, | |
5164 | 377 solve_singularity_handler sing_handler) const; |
378 | |
379 ComplexColumnVector solve (const ColumnVector& b) const; | |
5275 | 380 ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info) const; |
381 ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info, | |
5164 | 382 double& rcond) const; |
5697 | 383 ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info, |
384 double& rcond, | |
5164 | 385 solve_singularity_handler sing_handler) const; |
386 | |
387 ComplexColumnVector solve (const ComplexColumnVector& b) const; | |
5697 | 388 ComplexColumnVector solve (const ComplexColumnVector& b, |
389 octave_idx_type& info) const; | |
5275 | 390 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info, |
5164 | 391 double& rcond) const; |
5275 | 392 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info, |
5164 | 393 double& rcond, |
394 solve_singularity_handler sing_handler) const; | |
395 | |
396 SparseComplexMatrix squeeze (void) const; | |
397 | |
398 SparseComplexMatrix index (idx_vector& i, int resize_ok) const; | |
399 | |
400 SparseComplexMatrix index (idx_vector& i, idx_vector& j, int resize_ok) const; | |
401 | |
402 SparseComplexMatrix index (Array<idx_vector>& ra_idx, int resize_ok) const; | |
403 | |
404 SparseComplexMatrix reshape (const dim_vector& new_dims) const; | |
405 | |
5697 | 406 SparseComplexMatrix permute (const Array<octave_idx_type>& vec, |
407 bool inv = false) const; | |
5164 | 408 |
5275 | 409 SparseComplexMatrix ipermute (const Array<octave_idx_type>& vec) const; |
5164 | 410 |
7922
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7802
diff
changeset
|
411 bool any_element_is_nan (void) const; |
5164 | 412 bool any_element_is_inf_or_nan (void) const; |
413 bool all_elements_are_real (void) const; | |
414 bool all_integers (double& max_val, double& min_val) const; | |
415 bool too_large_for_float (void) const; | |
416 | |
417 SparseBoolMatrix operator ! (void) const; | |
418 | |
419 SparseBoolMatrix all (int dim = -1) const; | |
420 SparseBoolMatrix any (int dim = -1) const; | |
421 | |
422 SparseComplexMatrix cumprod (int dim = -1) const; | |
423 SparseComplexMatrix cumsum (int dim = -1) const; | |
424 SparseComplexMatrix prod (int dim = -1) const; | |
425 SparseComplexMatrix sum (int dim = -1) const; | |
426 SparseComplexMatrix sumsq (int dim = -1) const; | |
427 SparseMatrix abs (void) const; | |
428 | |
5275 | 429 SparseComplexMatrix diag (octave_idx_type k = 0) const; |
5164 | 430 |
431 // i/o | |
6108 | 432 friend OCTAVE_API std::ostream& operator << (std::ostream& os, |
5164 | 433 const SparseComplexMatrix& a); |
6108 | 434 friend OCTAVE_API std::istream& operator >> (std::istream& is, |
5164 | 435 SparseComplexMatrix& a); |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
436 |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
437 typedef double (*dmapper) (const Complex&); |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
438 typedef Complex (*cmapper) (const Complex&); |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
439 typedef bool (*bmapper) (const Complex&); |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
440 SparseMatrix map (dmapper fcn) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
441 SparseComplexMatrix map (cmapper fcn) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
442 SparseBoolMatrix map (bmapper fcn) const; |
5164 | 443 }; |
444 | |
6108 | 445 extern OCTAVE_API SparseComplexMatrix operator * (const SparseMatrix&, |
5164 | 446 const SparseComplexMatrix&); |
6108 | 447 extern OCTAVE_API SparseComplexMatrix operator * (const SparseComplexMatrix&, |
5164 | 448 const SparseMatrix&); |
6108 | 449 extern OCTAVE_API SparseComplexMatrix operator * (const SparseComplexMatrix&, |
5164 | 450 const SparseComplexMatrix&); |
451 | |
6108 | 452 extern OCTAVE_API ComplexMatrix operator * (const Matrix&, |
5429 | 453 const SparseComplexMatrix&); |
6108 | 454 extern OCTAVE_API ComplexMatrix operator * (const ComplexMatrix&, |
5429 | 455 const SparseMatrix&); |
6108 | 456 extern OCTAVE_API ComplexMatrix operator * (const ComplexMatrix&, |
5429 | 457 const SparseComplexMatrix&); |
7802
1a446f28ce68
implement optimized sparse-dense transposed multiplication
Jaroslav Hajek <highegg@gmail.com>
parents:
7503
diff
changeset
|
458 extern OCTAVE_API ComplexMatrix mul_trans (const ComplexMatrix&, |
1a446f28ce68
implement optimized sparse-dense transposed multiplication
Jaroslav Hajek <highegg@gmail.com>
parents:
7503
diff
changeset
|
459 const SparseComplexMatrix&); |
1a446f28ce68
implement optimized sparse-dense transposed multiplication
Jaroslav Hajek <highegg@gmail.com>
parents:
7503
diff
changeset
|
460 extern OCTAVE_API ComplexMatrix mul_herm (const ComplexMatrix&, |
1a446f28ce68
implement optimized sparse-dense transposed multiplication
Jaroslav Hajek <highegg@gmail.com>
parents:
7503
diff
changeset
|
461 const SparseComplexMatrix&); |
5429 | 462 |
6108 | 463 extern OCTAVE_API ComplexMatrix operator * (const SparseMatrix&, |
5429 | 464 const ComplexMatrix&); |
6108 | 465 extern OCTAVE_API ComplexMatrix operator * (const SparseComplexMatrix&, |
5429 | 466 const Matrix&); |
6108 | 467 extern OCTAVE_API ComplexMatrix operator * (const SparseComplexMatrix&, |
5429 | 468 const ComplexMatrix&); |
7802
1a446f28ce68
implement optimized sparse-dense transposed multiplication
Jaroslav Hajek <highegg@gmail.com>
parents:
7503
diff
changeset
|
469 extern OCTAVE_API ComplexMatrix trans_mul (const SparseComplexMatrix&, |
1a446f28ce68
implement optimized sparse-dense transposed multiplication
Jaroslav Hajek <highegg@gmail.com>
parents:
7503
diff
changeset
|
470 const ComplexMatrix&); |
1a446f28ce68
implement optimized sparse-dense transposed multiplication
Jaroslav Hajek <highegg@gmail.com>
parents:
7503
diff
changeset
|
471 extern OCTAVE_API ComplexMatrix herm_mul (const SparseComplexMatrix&, |
1a446f28ce68
implement optimized sparse-dense transposed multiplication
Jaroslav Hajek <highegg@gmail.com>
parents:
7503
diff
changeset
|
472 const ComplexMatrix&); |
5429 | 473 |
6108 | 474 extern OCTAVE_API SparseComplexMatrix min (const Complex& c, |
5164 | 475 const SparseComplexMatrix& m); |
6108 | 476 extern OCTAVE_API SparseComplexMatrix min (const SparseComplexMatrix& m, |
5164 | 477 const Complex& c); |
6108 | 478 extern OCTAVE_API SparseComplexMatrix min (const SparseComplexMatrix& a, |
5164 | 479 const SparseComplexMatrix& b); |
480 | |
6108 | 481 extern OCTAVE_API SparseComplexMatrix max (const Complex& c, |
5164 | 482 const SparseComplexMatrix& m); |
6108 | 483 extern OCTAVE_API SparseComplexMatrix max (const SparseComplexMatrix& m, |
5164 | 484 const Complex& c); |
6108 | 485 extern OCTAVE_API SparseComplexMatrix max (const SparseComplexMatrix& a, |
5164 | 486 const SparseComplexMatrix& b); |
487 | |
6708 | 488 SPARSE_SMS_CMP_OP_DECLS (SparseComplexMatrix, Complex, OCTAVE_API) |
489 SPARSE_SMS_BOOL_OP_DECLS (SparseComplexMatrix, Complex, OCTAVE_API) | |
5164 | 490 |
6708 | 491 SPARSE_SSM_CMP_OP_DECLS (Complex, SparseComplexMatrix, OCTAVE_API) |
492 SPARSE_SSM_BOOL_OP_DECLS (Complex, SparseComplexMatrix, OCTAVE_API) | |
5164 | 493 |
6708 | 494 SPARSE_SMSM_CMP_OP_DECLS (SparseComplexMatrix, SparseComplexMatrix, OCTAVE_API) |
495 SPARSE_SMSM_BOOL_OP_DECLS (SparseComplexMatrix, SparseComplexMatrix, OCTAVE_API) | |
5164 | 496 |
497 SPARSE_FORWARD_DEFS (MSparse, SparseComplexMatrix, ComplexMatrix, Complex) | |
498 | |
5351 | 499 #ifdef IDX_TYPE_LONG |
5322 | 500 #define UMFPACK_ZNAME(name) umfpack_zl_ ## name |
501 #else | |
502 #define UMFPACK_ZNAME(name) umfpack_zi_ ## name | |
503 #endif | |
504 | |
5164 | 505 #endif |
506 | |
507 /* | |
508 ;;; Local Variables: *** | |
509 ;;; mode: C++ *** | |
510 ;;; End: *** | |
511 */ |