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