Mercurial > hg > octave-lyh
annotate liboctave/dSparse.h @ 14819:67b6b47a22f6
doc: Clarify docstrings for canonicalize_file_name, make_absolute_filename
* syscalls.cc (canonicalize_file_name): Clarify docstring.
* utils.cc (make_absolute_filename): Clarify docstring.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Fri, 29 Jun 2012 13:38:28 -0700 |
parents | 72c96de7a403 |
children |
rev | line source |
---|---|
5164 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13030
diff
changeset
|
3 Copyright (C) 2004-2012 David Bateman |
11523 | 4 Copyright (C) 1998-2004 Andy Adler |
7016 | 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_dSparse_h) | |
25 #define octave_dSparse_h 1 | |
26 | |
27 #include "dMatrix.h" | |
28 #include "dNDArray.h" | |
29 #include "CMatrix.h" | |
30 #include "dColVector.h" | |
31 #include "CColVector.h" | |
32 | |
8335 | 33 #include "DET.h" |
5164 | 34 #include "MSparse.h" |
35 #include "MSparse-defs.h" | |
36 #include "Sparse-op-defs.h" | |
5785 | 37 #include "MatrixType.h" |
5164 | 38 |
8968
91d53dc37f79
Add perm * sparse, perm \ sparse, sparse * perm, and sparse / perm operations.
Jason Riedy <jason@acm.org>
parents:
8966
diff
changeset
|
39 class PermMatrix; |
8964
f4f4d65faaa0
Implement sparse * diagonal and diagonal * sparse operations, double-prec only.
Jason Riedy <jason@acm.org>
parents:
8920
diff
changeset
|
40 class DiagMatrix; |
5164 | 41 class SparseComplexMatrix; |
42 class SparseBoolMatrix; | |
43 | |
44 class | |
6108 | 45 OCTAVE_API |
5164 | 46 SparseMatrix : public MSparse<double> |
47 { | |
48 public: | |
49 | |
50 typedef void (*solve_singularity_handler) (double rcond); | |
51 | |
52 SparseMatrix (void) : MSparse<double> () { } | |
53 | |
5275 | 54 SparseMatrix (octave_idx_type r, octave_idx_type c) : MSparse<double> (r, c) { } |
5164 | 55 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
56 SparseMatrix (const dim_vector& dv, octave_idx_type nz = 0) : |
6823 | 57 MSparse<double> (dv, nz) { } |
58 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
59 explicit SparseMatrix (octave_idx_type r, octave_idx_type c, double val) |
5164 | 60 : MSparse<double> (r, c, val) { } |
61 | |
62 SparseMatrix (const SparseMatrix& a) : MSparse<double> (a) { } | |
63 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
64 SparseMatrix (const SparseMatrix& a, const dim_vector& dv) |
5164 | 65 : MSparse<double> (a, dv) { } |
66 | |
67 SparseMatrix (const MSparse<double>& a) : MSparse<double> (a) { } | |
68 | |
10983
4b51c0a20a98
optimize sum of sparse logical matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
10785
diff
changeset
|
69 SparseMatrix (const Sparse<double>& a) : MSparse<double> (a) { } |
4b51c0a20a98
optimize sum of sparse logical matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
10785
diff
changeset
|
70 |
5164 | 71 explicit SparseMatrix (const SparseBoolMatrix& a); |
72 | |
73 explicit SparseMatrix (const Matrix& a) : MSparse<double> (a) { } | |
74 | |
75 explicit SparseMatrix (const NDArray& a) : MSparse<double> (a) { } | |
76 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
77 SparseMatrix (const Array<double>& a, const idx_vector& r, |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
78 const idx_vector& c, octave_idx_type nr = -1, |
10527
b4d2080b6df7
Replace nzmax by nnz as needed
David Bateman <dbateman@free.fr>
parents:
10480
diff
changeset
|
79 octave_idx_type nc = -1, bool sum_terms = true, |
b4d2080b6df7
Replace nzmax by nnz as needed
David Bateman <dbateman@free.fr>
parents:
10480
diff
changeset
|
80 octave_idx_type nzm = -1) |
b4d2080b6df7
Replace nzmax by nnz as needed
David Bateman <dbateman@free.fr>
parents:
10480
diff
changeset
|
81 : MSparse<double> (a, r, c, nr, nc, sum_terms, nzm) { } |
10479
ded9beac7582
optimize sparse matrix assembly
Jaroslav Hajek <highegg@gmail.com>
parents:
10421
diff
changeset
|
82 |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8335
diff
changeset
|
83 explicit SparseMatrix (const DiagMatrix& a); |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8335
diff
changeset
|
84 |
13030
b646413c3d0e
Make operators do smarter sparse conversions on permutation matrices.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
85 explicit SparseMatrix (const PermMatrix& a) : MSparse<double>(a) { } |
8910
6e9f26506804
optimize diag -> sparse and perm -> sparse conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8366
diff
changeset
|
86 |
5275 | 87 SparseMatrix (octave_idx_type r, octave_idx_type c, octave_idx_type num_nz) : MSparse<double> (r, c, num_nz) { } |
5164 | 88 |
89 SparseMatrix& operator = (const SparseMatrix& a) | |
90 { | |
91 MSparse<double>::operator = (a); | |
92 return *this; | |
93 } | |
94 | |
95 bool operator == (const SparseMatrix& a) const; | |
96 bool operator != (const SparseMatrix& a) const; | |
97 | |
98 bool is_symmetric (void) const; | |
99 | |
9790
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8968
diff
changeset
|
100 SparseMatrix max (int dim = -1) const; |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8968
diff
changeset
|
101 SparseMatrix max (Array<octave_idx_type>& index, int dim = -1) const; |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8968
diff
changeset
|
102 SparseMatrix min (int dim = -1) const; |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8968
diff
changeset
|
103 SparseMatrix min (Array<octave_idx_type>& index, int dim = -1) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
104 |
5164 | 105 // destructive insert/delete/reorder operations |
106 | |
5275 | 107 SparseMatrix& insert (const SparseMatrix& a, octave_idx_type r, octave_idx_type c); |
5164 | 108 |
6823 | 109 SparseMatrix& insert (const SparseMatrix& a, const Array<octave_idx_type>& indx); |
110 | |
5275 | 111 SparseMatrix concat (const SparseMatrix& rb, const Array<octave_idx_type>& ra_idx); |
5164 | 112 SparseComplexMatrix concat (const SparseComplexMatrix& rb, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
113 const Array<octave_idx_type>& ra_idx); |
5164 | 114 |
6108 | 115 friend OCTAVE_API SparseMatrix real (const SparseComplexMatrix& a); |
116 friend OCTAVE_API SparseMatrix imag (const SparseComplexMatrix& a); | |
5164 | 117 |
6108 | 118 friend OCTAVE_API SparseMatrix atan2 (const double& x, const SparseMatrix& y); |
119 friend OCTAVE_API SparseMatrix atan2 (const SparseMatrix& x, const double& y); | |
120 friend OCTAVE_API SparseMatrix atan2 (const SparseMatrix& x, const SparseMatrix& y); | |
5164 | 121 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
122 SparseMatrix transpose (void) const |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
123 { |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
124 return MSparse<double>::transpose (); |
5164 | 125 } |
5506 | 126 SparseMatrix hermitian (void) const { return transpose (); } |
5164 | 127 |
8303
b11c31849b44
improve norm computation capabilities
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
128 // extract row or column i. |
b11c31849b44
improve norm computation capabilities
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
129 |
b11c31849b44
improve norm computation capabilities
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
130 RowVector row (octave_idx_type i) const; |
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 ColumnVector column (octave_idx_type i) const; |
b11c31849b44
improve norm computation capabilities
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
133 |
5506 | 134 private: |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
135 SparseMatrix dinverse (MatrixType &mattyp, octave_idx_type& info, |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
136 double& rcond, const bool force = false, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
137 const bool calccond = true) const; |
5506 | 138 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
139 SparseMatrix tinverse (MatrixType &mattyp, octave_idx_type& info, |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
140 double& rcond, const bool force = false, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
141 const bool calccond = true) const; |
5506 | 142 |
143 public: | |
5164 | 144 SparseMatrix inverse (void) const; |
5785 | 145 SparseMatrix inverse (MatrixType& mattype) const; |
146 SparseMatrix inverse (MatrixType& mattype, octave_idx_type& info) const; | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
147 SparseMatrix inverse (MatrixType& mattype, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
148 double& rcond, int force = 0, int calc_cond = 1) const; |
5164 | 149 |
150 DET determinant (void) const; | |
5275 | 151 DET determinant (octave_idx_type& info) const; |
152 DET determinant (octave_idx_type& info, double& rcond, int calc_cond = 1) const; | |
5164 | 153 |
154 private: | |
155 // Diagonal matrix solvers | |
5785 | 156 Matrix dsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
157 double& rcond, solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
158 bool calc_cond = false) const; |
5164 | 159 |
5785 | 160 ComplexMatrix dsolve (MatrixType &typ, const ComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
161 octave_idx_type& info, double& rcond, |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
162 solve_singularity_handler sing_handler, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
163 bool calc_cond = false) const; |
5164 | 164 |
5785 | 165 SparseMatrix dsolve (MatrixType &typ, const SparseMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
166 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
167 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
168 bool calc_cond = false) const; |
5164 | 169 |
5785 | 170 SparseComplexMatrix dsolve (MatrixType &typ, const SparseComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
171 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
172 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
173 bool calc_cond = false) const; |
5164 | 174 |
175 // Upper triangular matrix solvers | |
5785 | 176 Matrix utsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
177 double& rcond, solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
178 bool calc_cond = false) const; |
5164 | 179 |
5785 | 180 ComplexMatrix utsolve (MatrixType &typ, const ComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
181 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
182 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
183 bool calc_cond = false) const; |
5164 | 184 |
5785 | 185 SparseMatrix utsolve (MatrixType &typ, const SparseMatrix& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
186 octave_idx_type& info, double& rcond, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
187 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
188 bool calc_cond = false) const; |
5164 | 189 |
5785 | 190 SparseComplexMatrix utsolve (MatrixType &typ, const SparseComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
191 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
192 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
193 bool calc_cond = false) const; |
5164 | 194 |
195 // Lower triangular matrix solvers | |
5785 | 196 Matrix ltsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
197 double& rcond, solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
198 bool calc_cond = false) const; |
5164 | 199 |
5785 | 200 ComplexMatrix ltsolve (MatrixType &typ, const ComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
201 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
202 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
203 bool calc_cond = false) const; |
5164 | 204 |
5785 | 205 SparseMatrix ltsolve (MatrixType &typ, const SparseMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
206 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
207 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
208 bool calc_cond = false) const; |
5164 | 209 |
5785 | 210 SparseComplexMatrix ltsolve (MatrixType &typ, const SparseComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
211 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
212 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
213 bool calc_cond = false) const; |
5164 | 214 |
215 // Tridiagonal matrix solvers | |
5785 | 216 Matrix trisolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
217 double& rcond, solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
218 bool calc_cond = false) const; |
5164 | 219 |
5785 | 220 ComplexMatrix trisolve (MatrixType &typ, const ComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
221 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
222 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
223 bool calc_cond = false) const; |
5164 | 224 |
5785 | 225 SparseMatrix trisolve (MatrixType &typ, const SparseMatrix& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
226 octave_idx_type& info, double& rcond, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
227 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
228 bool calc_cond = false) const; |
5164 | 229 |
5785 | 230 SparseComplexMatrix trisolve (MatrixType &typ, const SparseComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
231 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
232 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
233 bool calc_cond = false) const; |
5164 | 234 |
235 // Banded matrix solvers (umfpack/cholesky) | |
5785 | 236 Matrix bsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
237 double& rcond, solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
238 bool calc_cond = false) const; |
5164 | 239 |
5785 | 240 ComplexMatrix bsolve (MatrixType &typ, const ComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
241 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
242 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
243 bool calc_cond = false) const; |
5164 | 244 |
5785 | 245 SparseMatrix bsolve (MatrixType &typ, const SparseMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
246 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
247 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
248 bool calc_cond = false) const; |
5164 | 249 |
5785 | 250 SparseComplexMatrix bsolve (MatrixType &typ, const SparseComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
251 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
252 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
253 bool calc_cond = false) const; |
5164 | 254 |
255 // Full matrix solvers (umfpack/cholesky) | |
5681 | 256 void * factorize (octave_idx_type& err, double &rcond, Matrix &Control, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
257 Matrix &Info, solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
258 bool calc_cond = false) const; |
5164 | 259 |
5785 | 260 Matrix fsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
261 double& rcond, solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
262 bool calc_cond = false) const; |
5164 | 263 |
5785 | 264 ComplexMatrix fsolve (MatrixType &typ, const ComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
265 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
266 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
267 bool calc_cond = false) const; |
5164 | 268 |
5785 | 269 SparseMatrix fsolve (MatrixType &typ, const SparseMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
270 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
271 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
272 bool calc_cond = false) const; |
5164 | 273 |
5785 | 274 SparseComplexMatrix fsolve (MatrixType &typ, const SparseComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
275 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
276 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
277 bool calc_cond = false) const; |
5164 | 278 |
279 public: | |
280 // Generic interface to solver with no probing of type | |
5785 | 281 Matrix solve (MatrixType &typ, const Matrix& b) const; |
282 Matrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info) const; | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
283 Matrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
284 double& rcond) const; |
5785 | 285 Matrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
286 double& rcond, solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
287 bool singular_fallback = true) const; |
5164 | 288 |
5785 | 289 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
290 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
291 octave_idx_type& info) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
292 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
293 octave_idx_type& info, double& rcond) const; |
5785 | 294 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
295 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
296 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
297 bool singular_fallback = true) const; |
5164 | 298 |
5785 | 299 SparseMatrix solve (MatrixType &typ, const SparseMatrix& b) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
300 SparseMatrix solve (MatrixType &typ, const SparseMatrix& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
301 octave_idx_type& info) const; |
5785 | 302 SparseMatrix solve (MatrixType &typ, const SparseMatrix& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
303 octave_idx_type& info, double& rcond) const; |
5785 | 304 SparseMatrix solve (MatrixType &typ, const SparseMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
305 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
306 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
307 bool singular_fallback = true) const; |
5164 | 308 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
309 SparseComplexMatrix solve (MatrixType &typ, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
310 const SparseComplexMatrix& b) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
311 SparseComplexMatrix solve (MatrixType &typ, const SparseComplexMatrix& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
312 octave_idx_type& info) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
313 SparseComplexMatrix solve (MatrixType &typ, const SparseComplexMatrix& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
314 octave_idx_type& info, double& rcond) const; |
5785 | 315 SparseComplexMatrix solve (MatrixType &typ, const SparseComplexMatrix& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
316 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
317 solve_singularity_handler sing_handler, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
318 bool singular_fallabck = true) const; |
5164 | 319 |
5785 | 320 ColumnVector solve (MatrixType &typ, const ColumnVector& b) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
321 ColumnVector solve (MatrixType &typ, const ColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
322 octave_idx_type& info) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
323 ColumnVector solve (MatrixType &typ, const ColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
324 octave_idx_type& info, double& rcond) const; |
5785 | 325 ColumnVector solve (MatrixType &typ, const ColumnVector& b, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
326 octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
327 solve_singularity_handler sing_handler) const; |
5164 | 328 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
329 ComplexColumnVector solve (MatrixType &typ, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
330 const ComplexColumnVector& b) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
331 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
332 octave_idx_type& info) const; |
5785 | 333 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
334 octave_idx_type& info, double& rcond) const; |
5785 | 335 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
336 octave_idx_type& info, double& rcond, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
337 solve_singularity_handler sing_handler) const; |
5164 | 338 |
339 // Generic interface to solver with probing of type | |
340 Matrix solve (const Matrix& b) const; | |
5275 | 341 Matrix solve (const Matrix& b, octave_idx_type& info) const; |
342 Matrix solve (const Matrix& b, octave_idx_type& info, double& rcond) const; | |
343 Matrix solve (const Matrix& b, octave_idx_type& info, double& rcond, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
344 solve_singularity_handler sing_handler) const; |
5164 | 345 |
346 ComplexMatrix solve (const ComplexMatrix& b) const; | |
5275 | 347 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
348 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
349 double& rcond) const; |
5275 | 350 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
351 solve_singularity_handler sing_handler) const; |
5164 | 352 |
353 SparseMatrix solve (const SparseMatrix& b) const; | |
5275 | 354 SparseMatrix solve (const SparseMatrix& b, octave_idx_type& info) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
355 SparseMatrix solve (const SparseMatrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
356 double& rcond) const; |
5275 | 357 SparseMatrix solve (const SparseMatrix& b, octave_idx_type& info, double& rcond, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
358 solve_singularity_handler sing_handler) const; |
5164 | 359 |
360 SparseComplexMatrix solve (const SparseComplexMatrix& b) const; | |
5275 | 361 SparseComplexMatrix solve (const SparseComplexMatrix& b, octave_idx_type& info) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
362 SparseComplexMatrix solve (const SparseComplexMatrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
363 double& rcond) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
364 SparseComplexMatrix solve (const SparseComplexMatrix& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
365 double& rcond, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
366 solve_singularity_handler sing_handler) const; |
5164 | 367 |
368 ColumnVector solve (const ColumnVector& b) const; | |
5275 | 369 ColumnVector solve (const ColumnVector& b, octave_idx_type& info) const; |
370 ColumnVector solve (const ColumnVector& b, octave_idx_type& info, double& rcond) const; | |
371 ColumnVector solve (const ColumnVector& b, octave_idx_type& info, double& rcond, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
372 solve_singularity_handler sing_handler) const; |
5164 | 373 |
374 ComplexColumnVector solve (const ComplexColumnVector& b) const; | |
5275 | 375 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info) const; |
376 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
377 double& rcond) const; |
5275 | 378 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
379 double& rcond, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
380 solve_singularity_handler sing_handler) const; |
5164 | 381 |
382 // other operations | |
383 | |
384 bool any_element_is_negative (bool = false) const; | |
7922
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7802
diff
changeset
|
385 bool any_element_is_nan (void) const; |
5164 | 386 bool any_element_is_inf_or_nan (void) const; |
9852
aabf7a8c2e57
implement sparse logical conversion
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
387 bool any_element_not_one_or_zero (void) const; |
6989 | 388 bool all_elements_are_zero (void) const; |
5164 | 389 bool all_elements_are_int_or_inf_or_nan (void) const; |
390 bool all_integers (double& max_val, double& min_val) const; | |
391 bool too_large_for_float (void) const; | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
392 |
5164 | 393 SparseBoolMatrix operator ! (void) const; |
394 | |
395 SparseBoolMatrix all (int dim = -1) const; | |
396 SparseBoolMatrix any (int dim = -1) const; | |
397 | |
398 SparseMatrix cumprod (int dim = -1) const; | |
399 SparseMatrix cumsum (int dim = -1) const; | |
400 SparseMatrix prod (int dim = -1) const; | |
401 SparseMatrix sum (int dim = -1) const; | |
402 SparseMatrix sumsq (int dim = -1) const; | |
403 SparseMatrix abs (void) const; | |
404 | |
5275 | 405 SparseMatrix diag (octave_idx_type k = 0) const; |
5164 | 406 |
407 Matrix matrix_value (void) const; | |
408 | |
409 SparseMatrix squeeze (void) const; | |
410 | |
411 SparseMatrix reshape (const dim_vector& new_dims) const; | |
412 | |
5275 | 413 SparseMatrix permute (const Array<octave_idx_type>& vec, bool inv = false) const; |
5164 | 414 |
5275 | 415 SparseMatrix ipermute (const Array<octave_idx_type>& vec) const; |
5164 | 416 |
417 // i/o | |
418 | |
6108 | 419 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const SparseMatrix& a); |
420 friend OCTAVE_API std::istream& operator >> (std::istream& is, SparseMatrix& a); | |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
421 |
5164 | 422 }; |
423 | |
5509 | 424 // Publish externally used friend functions. |
425 | |
6108 | 426 extern OCTAVE_API SparseMatrix real (const SparseComplexMatrix& a); |
427 extern OCTAVE_API SparseMatrix imag (const SparseComplexMatrix& a); | |
5509 | 428 |
429 // Other operators. | |
430 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
431 extern OCTAVE_API SparseMatrix operator * (const SparseMatrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
432 const SparseMatrix& b); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
433 extern OCTAVE_API Matrix operator * (const Matrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
434 const SparseMatrix& b); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
435 extern OCTAVE_API Matrix mul_trans (const Matrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
436 const SparseMatrix& b); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
437 extern OCTAVE_API Matrix operator * (const SparseMatrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
438 const Matrix& b); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
439 extern OCTAVE_API Matrix trans_mul (const SparseMatrix& a, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
440 const Matrix& b); |
5164 | 441 |
8964
f4f4d65faaa0
Implement sparse * diagonal and diagonal * sparse operations, double-prec only.
Jason Riedy <jason@acm.org>
parents:
8920
diff
changeset
|
442 extern OCTAVE_API SparseMatrix operator * (const DiagMatrix&, const SparseMatrix&); |
f4f4d65faaa0
Implement sparse * diagonal and diagonal * sparse operations, double-prec only.
Jason Riedy <jason@acm.org>
parents:
8920
diff
changeset
|
443 extern OCTAVE_API SparseMatrix operator * (const SparseMatrix&, const DiagMatrix&); |
f4f4d65faaa0
Implement sparse * diagonal and diagonal * sparse operations, double-prec only.
Jason Riedy <jason@acm.org>
parents:
8920
diff
changeset
|
444 |
8966
1bba53c0a38d
Implement diag + sparse, diag - sparse, sparse + diag, sparse - diag.
Jason Riedy <jason@acm.org>
parents:
8964
diff
changeset
|
445 extern OCTAVE_API SparseMatrix operator + (const DiagMatrix&, const SparseMatrix&); |
1bba53c0a38d
Implement diag + sparse, diag - sparse, sparse + diag, sparse - diag.
Jason Riedy <jason@acm.org>
parents:
8964
diff
changeset
|
446 extern OCTAVE_API SparseMatrix operator + (const SparseMatrix&, const DiagMatrix&); |
1bba53c0a38d
Implement diag + sparse, diag - sparse, sparse + diag, sparse - diag.
Jason Riedy <jason@acm.org>
parents:
8964
diff
changeset
|
447 extern OCTAVE_API SparseMatrix operator - (const DiagMatrix&, const SparseMatrix&); |
1bba53c0a38d
Implement diag + sparse, diag - sparse, sparse + diag, sparse - diag.
Jason Riedy <jason@acm.org>
parents:
8964
diff
changeset
|
448 extern OCTAVE_API SparseMatrix operator - (const SparseMatrix&, const DiagMatrix&); |
1bba53c0a38d
Implement diag + sparse, diag - sparse, sparse + diag, sparse - diag.
Jason Riedy <jason@acm.org>
parents:
8964
diff
changeset
|
449 |
8968
91d53dc37f79
Add perm * sparse, perm \ sparse, sparse * perm, and sparse / perm operations.
Jason Riedy <jason@acm.org>
parents:
8966
diff
changeset
|
450 extern OCTAVE_API SparseMatrix operator * (const PermMatrix&, const SparseMatrix&); |
91d53dc37f79
Add perm * sparse, perm \ sparse, sparse * perm, and sparse / perm operations.
Jason Riedy <jason@acm.org>
parents:
8966
diff
changeset
|
451 extern OCTAVE_API SparseMatrix operator * (const SparseMatrix&, const PermMatrix&); |
91d53dc37f79
Add perm * sparse, perm \ sparse, sparse * perm, and sparse / perm operations.
Jason Riedy <jason@acm.org>
parents:
8966
diff
changeset
|
452 |
6108 | 453 extern OCTAVE_API SparseMatrix min (double d, const SparseMatrix& m); |
454 extern OCTAVE_API SparseMatrix min (const SparseMatrix& m, double d); | |
455 extern OCTAVE_API SparseMatrix min (const SparseMatrix& a, const SparseMatrix& b); | |
5164 | 456 |
6108 | 457 extern OCTAVE_API SparseMatrix max (double d, const SparseMatrix& m); |
458 extern OCTAVE_API SparseMatrix max (const SparseMatrix& m, double d); | |
459 extern OCTAVE_API SparseMatrix max (const SparseMatrix& a, const SparseMatrix& b); | |
5164 | 460 |
6708 | 461 SPARSE_SMS_CMP_OP_DECLS (SparseMatrix, double, OCTAVE_API) |
462 SPARSE_SMS_BOOL_OP_DECLS (SparseMatrix, double, OCTAVE_API) | |
5164 | 463 |
6708 | 464 SPARSE_SSM_CMP_OP_DECLS (double, SparseMatrix, OCTAVE_API) |
465 SPARSE_SSM_BOOL_OP_DECLS (double, SparseMatrix, OCTAVE_API) | |
5164 | 466 |
6708 | 467 SPARSE_SMSM_CMP_OP_DECLS (SparseMatrix, SparseMatrix, OCTAVE_API) |
468 SPARSE_SMSM_BOOL_OP_DECLS (SparseMatrix, SparseMatrix, OCTAVE_API) | |
5164 | 469 |
470 SPARSE_FORWARD_DEFS (MSparse, SparseMatrix, Matrix, double) | |
471 | |
5351 | 472 #ifdef IDX_TYPE_LONG |
5322 | 473 #define UMFPACK_DNAME(name) umfpack_dl_ ## name |
474 #else | |
475 #define UMFPACK_DNAME(name) umfpack_di_ ## name | |
476 #endif | |
477 | |
5164 | 478 #endif |