Mercurial > hg > octave-lyh
annotate liboctave/dMatrix.h @ 9665:1dba57e9d08d
use blas_trans_type for xgemm
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sat, 26 Sep 2009 10:41:07 +0200 |
parents | afcf852256d2 |
children | f80c566bc751 |
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 |
64 explicit Matrix (const RowVector& rv); | |
458 | 65 |
3585 | 66 explicit Matrix (const ColumnVector& cv); |
67 | |
68 explicit Matrix (const DiagMatrix& a); | |
69 | |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8336
diff
changeset
|
70 explicit Matrix (const PermMatrix& a); |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8336
diff
changeset
|
71 |
3585 | 72 explicit Matrix (const boolMatrix& a); |
73 | |
74 explicit Matrix (const charMatrix& a); | |
1574 | 75 |
458 | 76 Matrix& operator = (const Matrix& a) |
77 { | |
1214 | 78 MArray2<double>::operator = (a); |
458 | 79 return *this; |
80 } | |
81 | |
2385 | 82 bool operator == (const Matrix& a) const; |
83 bool operator != (const Matrix& a) const; | |
458 | 84 |
3354 | 85 bool is_symmetric (void) const; |
86 | |
1359 | 87 // destructive insert/delete/reorder operations |
458 | 88 |
5275 | 89 Matrix& insert (const Matrix& a, octave_idx_type r, octave_idx_type c); |
90 Matrix& insert (const RowVector& a, octave_idx_type r, octave_idx_type c); | |
91 Matrix& insert (const ColumnVector& a, octave_idx_type r, octave_idx_type c); | |
92 Matrix& insert (const DiagMatrix& a, octave_idx_type r, octave_idx_type c); | |
458 | 93 |
94 Matrix& fill (double val); | |
5275 | 95 Matrix& fill (double val, octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2); |
458 | 96 |
97 Matrix append (const Matrix& a) const; | |
98 Matrix append (const RowVector& a) const; | |
99 Matrix append (const ColumnVector& a) const; | |
100 Matrix append (const DiagMatrix& a) const; | |
101 | |
102 Matrix stack (const Matrix& a) const; | |
103 Matrix stack (const RowVector& a) const; | |
104 Matrix stack (const ColumnVector& a) const; | |
105 Matrix stack (const DiagMatrix& a) const; | |
106 | |
6108 | 107 friend OCTAVE_API Matrix real (const ComplexMatrix& a); |
108 friend OCTAVE_API Matrix imag (const ComplexMatrix& a); | |
1205 | 109 |
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
|
110 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
|
111 |
3225 | 112 Matrix transpose (void) const { return MArray2<double>::transpose (); } |
113 | |
1359 | 114 // resize is the destructive equivalent for this one |
458 | 115 |
5275 | 116 Matrix extract (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const; |
458 | 117 |
5275 | 118 Matrix extract_n (octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const; |
4316 | 119 |
1359 | 120 // extract row or column i. |
458 | 121 |
5275 | 122 RowVector row (octave_idx_type i) const; |
458 | 123 |
5275 | 124 ColumnVector column (octave_idx_type i) const; |
458 | 125 |
6207 | 126 private: |
7788 | 127 Matrix tinverse (MatrixType &mattype, octave_idx_type& info, double& rcon, |
6207 | 128 int force, int calc_cond) const; |
129 | |
7788 | 130 Matrix finverse (MatrixType &mattype, octave_idx_type& info, double& rcon, |
6207 | 131 int force, int calc_cond) const; |
132 | |
133 public: | |
458 | 134 Matrix inverse (void) const; |
6479 | 135 Matrix inverse (octave_idx_type& info) const; |
7788 | 136 Matrix inverse (octave_idx_type& info, double& rcon, int force = 0, |
6479 | 137 int calc_cond = 1) const; |
138 | |
6207 | 139 Matrix inverse (MatrixType &mattype) const; |
140 Matrix inverse (MatrixType &mattype, octave_idx_type& info) const; | |
7788 | 141 Matrix inverse (MatrixType &mattype, octave_idx_type& info, double& rcon, |
6207 | 142 int force = 0, int calc_cond = 1) const; |
458 | 143 |
4384 | 144 Matrix pseudo_inverse (double tol = 0.0) const; |
740 | 145 |
458 | 146 ComplexMatrix fourier (void) const; |
147 ComplexMatrix ifourier (void) const; | |
148 | |
677 | 149 ComplexMatrix fourier2d (void) const; |
150 ComplexMatrix ifourier2d (void) const; | |
151 | |
458 | 152 DET determinant (void) const; |
5275 | 153 DET determinant (octave_idx_type& info) const; |
7788 | 154 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
|
155 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
|
156 double& rcon, int calc_cond = 1) const; |
7788 | 157 |
158 double rcond (void) const; | |
159 double rcond (MatrixType &mattype) const; | |
458 | 160 |
5785 | 161 private: |
162 // Upper triangular matrix solvers | |
163 Matrix utsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, | |
7788 | 164 double& rcon, solve_singularity_handler sing_handler, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
165 bool calc_cond = false, blas_trans_type transt = blas_no_trans) const; |
5785 | 166 |
167 // Lower triangular matrix solvers | |
168 Matrix ltsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, | |
7788 | 169 double& rcon, solve_singularity_handler sing_handler, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
170 bool calc_cond = false, blas_trans_type transt = blas_no_trans) const; |
5785 | 171 |
172 // Full matrix solvers (lu/cholesky) | |
173 Matrix fsolve (MatrixType &typ, const Matrix& b, octave_idx_type& info, | |
7788 | 174 double& rcon, solve_singularity_handler sing_handler, |
5785 | 175 bool calc_cond = false) const; |
176 | |
177 public: | |
178 // Generic interface to solver with no probing of type | |
179 Matrix solve (MatrixType &typ, const Matrix& b) const; | |
180 Matrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info) const; | |
181 Matrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info, | |
7788 | 182 double& rcon) const; |
5785 | 183 Matrix solve (MatrixType &typ, const Matrix& b, octave_idx_type& info, |
7788 | 184 double& rcon, solve_singularity_handler sing_handler, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
185 bool singular_fallback = true, blas_trans_type transt = blas_no_trans) const; |
5785 | 186 |
187 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b) const; | |
188 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, | |
189 octave_idx_type& info) const; | |
190 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, | |
7788 | 191 octave_idx_type& info, double& rcon) const; |
5785 | 192 ComplexMatrix solve (MatrixType &typ, const ComplexMatrix& b, |
7788 | 193 octave_idx_type& info, double& rcon, |
5785 | 194 solve_singularity_handler sing_handler, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
195 bool singular_fallback = true, |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
196 blas_trans_type transt = blas_no_trans) const; |
5785 | 197 |
198 ColumnVector solve (MatrixType &typ, const ColumnVector& b) const; | |
199 ColumnVector solve (MatrixType &typ, const ColumnVector& b, | |
200 octave_idx_type& info) const; | |
201 ColumnVector solve (MatrixType &typ, const ColumnVector& b, | |
7788 | 202 octave_idx_type& info, double& rcon) const; |
5785 | 203 ColumnVector solve (MatrixType &typ, const ColumnVector& b, |
7788 | 204 octave_idx_type& info, double& rcon, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
205 solve_singularity_handler sing_handler, |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
206 blas_trans_type transt = blas_no_trans) const; |
5785 | 207 |
208 ComplexColumnVector solve (MatrixType &typ, | |
209 const ComplexColumnVector& b) const; | |
210 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, | |
211 octave_idx_type& info) const; | |
212 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, | |
7788 | 213 octave_idx_type& info, double& rcon) const; |
5785 | 214 ComplexColumnVector solve (MatrixType &typ, const ComplexColumnVector& b, |
7788 | 215 octave_idx_type& info, double& rcon, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
216 solve_singularity_handler sing_handler, |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
217 blas_trans_type transt = blas_no_trans) const; |
5785 | 218 |
219 // Generic interface to solver with probing of type | |
458 | 220 Matrix solve (const Matrix& b) const; |
5275 | 221 Matrix solve (const Matrix& b, octave_idx_type& info) const; |
7788 | 222 Matrix solve (const Matrix& b, octave_idx_type& info, double& rcon) const; |
223 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
|
224 solve_singularity_handler sing_handler, |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
225 blas_trans_type transt = blas_no_trans) const; |
458 | 226 |
227 ComplexMatrix solve (const ComplexMatrix& b) const; | |
5275 | 228 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info) const; |
7788 | 229 ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, double& rcon) const; |
230 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
|
231 solve_singularity_handler sing_handler, |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
232 blas_trans_type transt = blas_no_trans) const; |
458 | 233 |
234 ColumnVector solve (const ColumnVector& b) const; | |
5275 | 235 ColumnVector solve (const ColumnVector& b, octave_idx_type& info) const; |
7788 | 236 ColumnVector solve (const ColumnVector& b, octave_idx_type& info, double& rcon) const; |
237 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
|
238 solve_singularity_handler sing_handler, |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
239 blas_trans_type transt = blas_no_trans) const; |
458 | 240 |
241 ComplexColumnVector solve (const ComplexColumnVector& b) const; | |
5275 | 242 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info) const; |
243 ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& info, | |
7788 | 244 double& rcon) const; |
5275 | 245 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
|
246 double& rcon, solve_singularity_handler sing_handler, |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9656
diff
changeset
|
247 blas_trans_type transt = blas_no_trans) const; |
458 | 248 |
5785 | 249 // Singular solvers |
458 | 250 Matrix lssolve (const Matrix& b) const; |
5275 | 251 Matrix lssolve (const Matrix& b, octave_idx_type& info) const; |
7076 | 252 Matrix lssolve (const Matrix& b, octave_idx_type& info, |
253 octave_idx_type& rank) const; | |
254 Matrix lssolve (const Matrix& b, octave_idx_type& info, | |
7788 | 255 octave_idx_type& rank, double& rcon) const; |
458 | 256 |
257 ComplexMatrix lssolve (const ComplexMatrix& b) const; | |
5275 | 258 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info) const; |
259 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info, | |
260 octave_idx_type& rank) const; | |
7076 | 261 ComplexMatrix lssolve (const ComplexMatrix& b, octave_idx_type& info, |
7788 | 262 octave_idx_type& rank, double &rcon) const; |
458 | 263 |
264 ColumnVector lssolve (const ColumnVector& b) const; | |
5275 | 265 ColumnVector lssolve (const ColumnVector& b, octave_idx_type& info) const; |
7076 | 266 ColumnVector lssolve (const ColumnVector& b, octave_idx_type& info, |
267 octave_idx_type& rank) const; | |
268 ColumnVector lssolve (const ColumnVector& b, octave_idx_type& info, | |
7788 | 269 octave_idx_type& rank, double& rcon) const; |
458 | 270 |
271 ComplexColumnVector lssolve (const ComplexColumnVector& b) const; | |
7076 | 272 ComplexColumnVector lssolve (const ComplexColumnVector& b, |
273 octave_idx_type& info) const; | |
274 ComplexColumnVector lssolve (const ComplexColumnVector& b, | |
275 octave_idx_type& info, | |
5275 | 276 octave_idx_type& rank) const; |
7076 | 277 ComplexColumnVector lssolve (const ComplexColumnVector& b, |
278 octave_idx_type& info, | |
7788 | 279 octave_idx_type& rank, double& rcon) const; |
458 | 280 |
281 Matrix& operator += (const DiagMatrix& a); | |
282 Matrix& operator -= (const DiagMatrix& a); | |
283 | |
1359 | 284 // unary operations |
458 | 285 |
2964 | 286 boolMatrix operator ! (void) const; |
458 | 287 |
1359 | 288 // other operations |
458 | 289 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7076
diff
changeset
|
290 typedef double (*dmapper) (double); |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7076
diff
changeset
|
291 typedef Complex (*cmapper) (const Complex&); |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7076
diff
changeset
|
292 typedef bool (*bmapper) (double); |
2676 | 293 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7076
diff
changeset
|
294 Matrix map (dmapper fcn) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7076
diff
changeset
|
295 ComplexMatrix map (cmapper fcn) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7076
diff
changeset
|
296 boolMatrix map (bmapper fcn) const; |
458 | 297 |
4431 | 298 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
|
299 bool any_element_is_nan (void) const; |
2385 | 300 bool any_element_is_inf_or_nan (void) const; |
5943 | 301 bool any_element_not_one_or_zero (void) const; |
2385 | 302 bool all_elements_are_int_or_inf_or_nan (void) const; |
303 bool all_integers (double& max_val, double& min_val) const; | |
304 bool too_large_for_float (void) const; | |
1963 | 305 |
4017 | 306 boolMatrix all (int dim = -1) const; |
307 boolMatrix any (int dim = -1) const; | |
458 | 308 |
4017 | 309 Matrix cumprod (int dim = -1) const; |
310 Matrix cumsum (int dim = -1) const; | |
311 Matrix prod (int dim = -1) const; | |
312 Matrix sum (int dim = -1) const; | |
313 Matrix sumsq (int dim = -1) const; | |
2385 | 314 Matrix abs (void) const; |
458 | 315 |
7620
36594d5bbe13
Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents:
7503
diff
changeset
|
316 Matrix diag (octave_idx_type k = 0) const; |
458 | 317 |
318 ColumnVector row_min (void) const; | |
2354 | 319 ColumnVector row_max (void) const; |
458 | 320 |
5275 | 321 ColumnVector row_min (Array<octave_idx_type>& index) const; |
322 ColumnVector row_max (Array<octave_idx_type>& index) const; | |
458 | 323 |
324 RowVector column_min (void) const; | |
2354 | 325 RowVector column_max (void) const; |
458 | 326 |
5275 | 327 RowVector column_min (Array<octave_idx_type>& index) const; |
328 RowVector column_max (Array<octave_idx_type>& index) const; | |
458 | 329 |
1359 | 330 // i/o |
458 | 331 |
6108 | 332 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const Matrix& a); |
333 friend OCTAVE_API std::istream& operator >> (std::istream& is, Matrix& a); | |
458 | 334 |
3933 | 335 static double resize_fill_value (void) { return 0; } |
336 | |
458 | 337 private: |
338 | |
5275 | 339 Matrix (double *d, octave_idx_type r, octave_idx_type c) : MArray2<double> (d, r, c) { } |
458 | 340 }; |
341 | |
5508 | 342 // Publish externally used friend functions. |
343 | |
6108 | 344 extern OCTAVE_API Matrix real (const ComplexMatrix& a); |
345 extern OCTAVE_API Matrix imag (const ComplexMatrix& a); | |
5508 | 346 |
347 // column vector by row vector -> matrix operations | |
348 | |
6108 | 349 extern OCTAVE_API Matrix operator * (const ColumnVector& a, const RowVector& b); |
5508 | 350 |
351 // Other functions. | |
352 | |
6108 | 353 extern OCTAVE_API Matrix Givens (double, double); |
1819 | 354 |
6108 | 355 extern OCTAVE_API Matrix Sylvester (const Matrix&, const Matrix&, const Matrix&); |
1959 | 356 |
9665
1dba57e9d08d
use blas_trans_type for xgemm
Jaroslav Hajek <highegg@gmail.com>
parents:
9661
diff
changeset
|
357 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
|
358 blas_trans_type transa = blas_no_trans, |
1dba57e9d08d
use blas_trans_type for xgemm
Jaroslav Hajek <highegg@gmail.com>
parents:
9661
diff
changeset
|
359 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
|
360 |
6108 | 361 extern OCTAVE_API Matrix operator * (const Matrix& a, const Matrix& b); |
2828 | 362 |
6108 | 363 extern OCTAVE_API Matrix min (double d, const Matrix& m); |
364 extern OCTAVE_API Matrix min (const Matrix& m, double d); | |
365 extern OCTAVE_API Matrix min (const Matrix& a, const Matrix& b); | |
4309 | 366 |
6108 | 367 extern OCTAVE_API Matrix max (double d, const Matrix& m); |
368 extern OCTAVE_API Matrix max (const Matrix& m, double d); | |
369 extern OCTAVE_API Matrix max (const Matrix& a, const Matrix& b); | |
4309 | 370 |
9653
e087d7c77ff9
improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
371 extern OCTAVE_API Matrix linspace (const ColumnVector& x1, |
e087d7c77ff9
improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
372 const ColumnVector& x2, |
e087d7c77ff9
improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
373 octave_idx_type n); |
e087d7c77ff9
improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
374 |
6708 | 375 MS_CMP_OP_DECLS (Matrix, double, OCTAVE_API) |
376 MS_BOOL_OP_DECLS (Matrix, double, OCTAVE_API) | |
2870 | 377 |
6708 | 378 SM_CMP_OP_DECLS (double, Matrix, OCTAVE_API) |
379 SM_BOOL_OP_DECLS (double, Matrix, OCTAVE_API) | |
2870 | 380 |
6708 | 381 MM_CMP_OP_DECLS (Matrix, Matrix, OCTAVE_API) |
382 MM_BOOL_OP_DECLS (Matrix, Matrix, OCTAVE_API) | |
2870 | 383 |
3573 | 384 MARRAY_FORWARD_DEFS (MArray2, Matrix, double) |
385 | |
3689 | 386 template <class T> |
387 void read_int (std::istream& is, bool swap_bytes, T& val); | |
388 | |
458 | 389 #endif |
390 | |
391 /* | |
392 ;;; Local Variables: *** | |
393 ;;; mode: C++ *** | |
394 ;;; End: *** | |
395 */ |