annotate liboctave/fMatrix.h @ 11574:a83bad07f7e3

attempt better backward compatibility for Array resize functions
author John W. Eaton <jwe@octave.org>
date Thu, 20 Jan 2011 00:12:05 -0500
parents 57632dea2446
children 12df7854fa7c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
1 /*
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
2
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 10364
diff changeset
3 Copyright (C) 1994-2011 John W. Eaton
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
4
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
5 This file is part of Octave.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
6
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
10 option) any later version.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
11
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
15 for more details.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
16
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, see
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
20
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
21 */
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
22
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
23 #if !defined (octave_FloatMatrix_int_h)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
24 #define octave_FloatMatrix_int_h 1
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
25
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10312
diff changeset
26 #include "MArray.h"
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
27 #include "MDiagArray2.h"
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
28 #include "MatrixType.h"
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
29
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
30 #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
31 #include "mx-op-decl.h"
8335
64cf956a109c templatize & fix DET
Jaroslav Hajek <highegg@gmail.com>
parents: 7922
diff changeset
32 #include "DET.h"
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
33
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
34 class
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
35 OCTAVE_API
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10312
diff changeset
36 FloatMatrix : public MArray<float>
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
37 {
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
38 public:
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
39
9656
b29504415a2e provide NDArray->Matrix->Vector typedef mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 9653
diff changeset
40 typedef FloatColumnVector column_vector_type;
b29504415a2e provide NDArray->Matrix->Vector typedef mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 9653
diff changeset
41 typedef FloatRowVector row_vector_type;
b29504415a2e provide NDArray->Matrix->Vector typedef mappers
Jaroslav Hajek <highegg@gmail.com>
parents: 9653
diff changeset
42
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
43 typedef void (*solve_singularity_handler) (float rcon);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
44
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10312
diff changeset
45 FloatMatrix (void) : MArray<float> () { }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
46
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
47 FloatMatrix (octave_idx_type r, octave_idx_type c)
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
48 : MArray<float> (dim_vector (r, c)) { }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
49
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
50 FloatMatrix (octave_idx_type r, octave_idx_type c, float val)
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
51 : MArray<float> (dim_vector (r, c), val) { }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
52
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10312
diff changeset
53 FloatMatrix (const dim_vector& dv) : MArray<float> (dv.redim (2)) { }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
54
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
55 FloatMatrix (const dim_vector& dv, float val)
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
56 : MArray<float> (dv.redim (2), val) { }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
57
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10312
diff changeset
58 FloatMatrix (const FloatMatrix& a) : MArray<float> (a) { }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
59
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
60 template <class U>
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10312
diff changeset
61 FloatMatrix (const MArray<U>& a) : MArray<float> (a.as_matrix ()) { }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
62
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
63 template <class U>
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10312
diff changeset
64 FloatMatrix (const Array<U>& a) : MArray<float> (a.as_matrix ()) { }
10301
9e0ec19df4bc commit accidentally omitted parts of previous change
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
65
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
66 explicit FloatMatrix (const FloatRowVector& rv);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
67
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
68 explicit FloatMatrix (const FloatColumnVector& cv);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
69
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
70 explicit FloatMatrix (const FloatDiagMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
71
8367
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8336
diff changeset
72 explicit FloatMatrix (const PermMatrix& a);
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8336
diff changeset
73
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
74 explicit FloatMatrix (const boolMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
75
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
76 explicit FloatMatrix (const charMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
77
8367
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8336
diff changeset
78
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
79 FloatMatrix& operator = (const FloatMatrix& a)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
80 {
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10312
diff changeset
81 MArray<float>::operator = (a);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
82 return *this;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
83 }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
84
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
85 bool operator == (const FloatMatrix& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
86 bool operator != (const FloatMatrix& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
87
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
88 bool is_symmetric (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
89
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
90 // destructive insert/delete/reorder operations
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
91
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
92 FloatMatrix& insert (const FloatMatrix& a, octave_idx_type r, octave_idx_type c);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
93 FloatMatrix& insert (const FloatRowVector& a, octave_idx_type r, octave_idx_type c);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
94 FloatMatrix& insert (const FloatColumnVector& a, octave_idx_type r, octave_idx_type c);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
95 FloatMatrix& insert (const FloatDiagMatrix& a, octave_idx_type r, octave_idx_type c);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
96
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
97 FloatMatrix& fill (float val);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
98 FloatMatrix& fill (float val, octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
99
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
100 FloatMatrix append (const FloatMatrix& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
101 FloatMatrix append (const FloatRowVector& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
102 FloatMatrix append (const FloatColumnVector& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
103 FloatMatrix append (const FloatDiagMatrix& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
104
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
105 FloatMatrix stack (const FloatMatrix& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
106 FloatMatrix stack (const FloatRowVector& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
107 FloatMatrix stack (const FloatColumnVector& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
108 FloatMatrix stack (const FloatDiagMatrix& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
109
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
110 friend OCTAVE_API FloatMatrix real (const FloatComplexMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
111 friend OCTAVE_API FloatMatrix imag (const FloatComplexMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
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 FloatComplexMatrix;
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
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10312
diff changeset
115 FloatMatrix transpose (void) const { return MArray<float>::transpose (); }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
116
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
117 // resize is the destructive equivalent for this one
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
118
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
119 FloatMatrix extract (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
120
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
121 FloatMatrix extract_n (octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
122
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
123 // extract row or column i.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
124
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
125 FloatRowVector row (octave_idx_type i) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
126
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
127 FloatColumnVector column (octave_idx_type i) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
128
11574
a83bad07f7e3 attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents: 11570
diff changeset
129 void resize (octave_idx_type nr, octave_idx_type nc,
a83bad07f7e3 attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents: 11570
diff changeset
130 float rfv = resize_fill_value ())
a83bad07f7e3 attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents: 11570
diff changeset
131 {
a83bad07f7e3 attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents: 11570
diff changeset
132 MArray<float>::resize (dim_vector (nr, nc), rfv);
a83bad07f7e3 attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents: 11570
diff changeset
133 }
a83bad07f7e3 attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents: 11570
diff changeset
134
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
135 private:
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
136 FloatMatrix tinverse (MatrixType &mattype, octave_idx_type& info, float& rcon,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
137 int force, int calc_cond) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
138
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
139 FloatMatrix finverse (MatrixType &mattype, octave_idx_type& info, float& rcon,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
140 int force, int calc_cond) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
141
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
142 public:
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
143 FloatMatrix inverse (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
144 FloatMatrix inverse (octave_idx_type& info) const;
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
145 FloatMatrix inverse (octave_idx_type& info, float& rcon, int force = 0,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
146 int calc_cond = 1) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
147
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
148 FloatMatrix inverse (MatrixType &mattype) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
149 FloatMatrix inverse (MatrixType &mattype, octave_idx_type& info) const;
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
150 FloatMatrix inverse (MatrixType &mattype, octave_idx_type& info, float& rcon,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
151 int force = 0, int calc_cond = 1) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
152
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
153 FloatMatrix pseudo_inverse (float tol = 0.0) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
154
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
155 FloatComplexMatrix fourier (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
156 FloatComplexMatrix ifourier (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
157
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
158 FloatComplexMatrix fourier2d (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
159 FloatComplexMatrix ifourier2d (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
160
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
161 FloatDET determinant (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
162 FloatDET determinant (octave_idx_type& info) const;
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
163 FloatDET determinant (octave_idx_type& info, float& rcon, int calc_cond = 1) const;
8336
9813c07ca946 make det take advantage of matrix type
Jaroslav Hajek <highegg@gmail.com>
parents: 8335
diff changeset
164 FloatDET determinant (MatrixType &mattype, octave_idx_type& info,
9813c07ca946 make det take advantage of matrix type
Jaroslav Hajek <highegg@gmail.com>
parents: 8335
diff changeset
165 float& rcon, int calc_cond = 1) const;
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
166
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
167 float rcond (void) const;
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
168 float rcond (MatrixType &mattype) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
169
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
170 private:
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
171 // Upper triangular matrix solvers
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
172 FloatMatrix utsolve (MatrixType &typ, const FloatMatrix& b, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
173 float& rcon, solve_singularity_handler sing_handler,
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
174 bool calc_cond = false, blas_trans_type transt = blas_no_trans) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
175
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
176 // Lower triangular matrix solvers
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
177 FloatMatrix ltsolve (MatrixType &typ, const FloatMatrix& b, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
178 float& rcon, solve_singularity_handler sing_handler,
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
179 bool calc_cond = false, blas_trans_type transt = blas_no_trans) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
180
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
181 // Full matrix solvers (lu/cholesky)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
182 FloatMatrix fsolve (MatrixType &typ, const FloatMatrix& b, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
183 float& rcon, solve_singularity_handler sing_handler,
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
184 bool calc_cond = false) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
185
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
186 public:
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
187 // Generic interface to solver with no probing of type
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
188 FloatMatrix solve (MatrixType &typ, const FloatMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
189 FloatMatrix solve (MatrixType &typ, const FloatMatrix& b, octave_idx_type& info) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
190 FloatMatrix solve (MatrixType &typ, const FloatMatrix& b, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
191 float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
192 FloatMatrix solve (MatrixType &typ, const FloatMatrix& b, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
193 float& rcon, solve_singularity_handler sing_handler,
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
194 bool singular_fallback = true, blas_trans_type transt = blas_no_trans) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
195
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
196 FloatComplexMatrix solve (MatrixType &typ, const FloatComplexMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
197 FloatComplexMatrix solve (MatrixType &typ, const FloatComplexMatrix& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
198 octave_idx_type& info) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
199 FloatComplexMatrix solve (MatrixType &typ, const FloatComplexMatrix& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
200 octave_idx_type& info, float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
201 FloatComplexMatrix solve (MatrixType &typ, const FloatComplexMatrix& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
202 octave_idx_type& info, float& rcon,
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
203 solve_singularity_handler sing_handler,
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
204 bool singular_fallback = true,
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 9656
diff changeset
205 blas_trans_type transt = blas_no_trans) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
206
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
207 FloatColumnVector solve (MatrixType &typ, const FloatColumnVector& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
208 FloatColumnVector solve (MatrixType &typ, const FloatColumnVector& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
209 octave_idx_type& info) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
210 FloatColumnVector solve (MatrixType &typ, const FloatColumnVector& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
211 octave_idx_type& info, float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
212 FloatColumnVector solve (MatrixType &typ, const FloatColumnVector& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
213 octave_idx_type& info, float& rcon,
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
214 solve_singularity_handler sing_handler,
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 9656
diff changeset
215 blas_trans_type transt = blas_no_trans) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
216
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
217 FloatComplexColumnVector solve (MatrixType &typ,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
218 const FloatComplexColumnVector& b) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
219 FloatComplexColumnVector solve (MatrixType &typ, const FloatComplexColumnVector& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
220 octave_idx_type& info) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
221 FloatComplexColumnVector solve (MatrixType &typ, const FloatComplexColumnVector& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
222 octave_idx_type& info, float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
223 FloatComplexColumnVector solve (MatrixType &typ, const FloatComplexColumnVector& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
224 octave_idx_type& info, float& rcon,
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
225 solve_singularity_handler sing_handler, blas_trans_type transt = blas_no_trans) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
226
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
227 // Generic interface to solver with probing of type
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
228 FloatMatrix solve (const FloatMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
229 FloatMatrix solve (const FloatMatrix& b, octave_idx_type& info) const;
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
230 FloatMatrix solve (const FloatMatrix& b, octave_idx_type& info, float& rcon) const;
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
231 FloatMatrix solve (const FloatMatrix& b, octave_idx_type& info, float& rcon,
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 9656
diff changeset
232 solve_singularity_handler sing_handler,
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 9656
diff changeset
233 blas_trans_type transt = blas_no_trans) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
234
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
235 FloatComplexMatrix solve (const FloatComplexMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
236 FloatComplexMatrix solve (const FloatComplexMatrix& b, octave_idx_type& info) const;
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
237 FloatComplexMatrix solve (const FloatComplexMatrix& b, octave_idx_type& info, float& rcon) const;
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
238 FloatComplexMatrix solve (const FloatComplexMatrix& b, octave_idx_type& info, float& rcon,
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 9656
diff changeset
239 solve_singularity_handler sing_handler,
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 9656
diff changeset
240 blas_trans_type transt = blas_no_trans) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
241
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
242 FloatColumnVector solve (const FloatColumnVector& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
243 FloatColumnVector solve (const FloatColumnVector& b, octave_idx_type& info) const;
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
244 FloatColumnVector solve (const FloatColumnVector& b, octave_idx_type& info, float& rcon) const;
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
245 FloatColumnVector solve (const FloatColumnVector& b, octave_idx_type& info, float& rcon,
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 9656
diff changeset
246 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;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
248
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
249 FloatComplexColumnVector solve (const FloatComplexColumnVector& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
250 FloatComplexColumnVector solve (const FloatComplexColumnVector& b, octave_idx_type& info) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
251 FloatComplexColumnVector solve (const FloatComplexColumnVector& b, octave_idx_type& info,
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 9656
diff changeset
252 float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
253 FloatComplexColumnVector solve (const FloatComplexColumnVector& b, octave_idx_type& info,
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 9656
diff changeset
254 float& rcon, solve_singularity_handler sing_handler,
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 9656
diff changeset
255 blas_trans_type transt = blas_no_trans) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
256
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
257 // Singular solvers
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
258 FloatMatrix lssolve (const FloatMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
259 FloatMatrix lssolve (const FloatMatrix& b, octave_idx_type& info) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
260 FloatMatrix lssolve (const FloatMatrix& b, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
261 octave_idx_type& rank) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
262 FloatMatrix lssolve (const FloatMatrix& b, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
263 octave_idx_type& rank, float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
264
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
265 FloatComplexMatrix lssolve (const FloatComplexMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
266 FloatComplexMatrix lssolve (const FloatComplexMatrix& b, octave_idx_type& info) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
267 FloatComplexMatrix lssolve (const FloatComplexMatrix& b, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
268 octave_idx_type& rank) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
269 FloatComplexMatrix lssolve (const FloatComplexMatrix& b, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
270 octave_idx_type& rank, float &rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
271
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
272 FloatColumnVector lssolve (const FloatColumnVector& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
273 FloatColumnVector lssolve (const FloatColumnVector& b, octave_idx_type& info) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
274 FloatColumnVector lssolve (const FloatColumnVector& b, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
275 octave_idx_type& rank) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
276 FloatColumnVector lssolve (const FloatColumnVector& b, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
277 octave_idx_type& rank, float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
278
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
279 FloatComplexColumnVector lssolve (const FloatComplexColumnVector& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
280 FloatComplexColumnVector lssolve (const FloatComplexColumnVector& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
281 octave_idx_type& info) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
282 FloatComplexColumnVector lssolve (const FloatComplexColumnVector& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
283 octave_idx_type& info,
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
284 octave_idx_type& rank) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
285 FloatComplexColumnVector lssolve (const FloatComplexColumnVector& b,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
286 octave_idx_type& info,
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10301
diff changeset
287 octave_idx_type& rank, float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
288
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
289 FloatMatrix& operator += (const FloatDiagMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
290 FloatMatrix& operator -= (const FloatDiagMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
291
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
292 // unary operations
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
293
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
294 boolMatrix operator ! (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
295
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
296 // other operations
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
297
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
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: 7804
diff changeset
299 bool any_element_is_nan (void) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
300 bool any_element_is_inf_or_nan (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
301 bool any_element_not_one_or_zero (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
302 bool all_elements_are_int_or_inf_or_nan (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
303 bool all_integers (float& max_val, float& min_val) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
304 bool too_large_for_float (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
305
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
306 boolMatrix all (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
307 boolMatrix any (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
308
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
309 FloatMatrix cumprod (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
310 FloatMatrix cumsum (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
311 FloatMatrix prod (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
312 FloatMatrix sum (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
313 FloatMatrix sumsq (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
314 FloatMatrix abs (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
315
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
316 FloatMatrix diag (octave_idx_type k = 0) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
317
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
318 FloatColumnVector row_min (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
319 FloatColumnVector row_max (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
320
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
321 FloatColumnVector row_min (Array<octave_idx_type>& index) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
322 FloatColumnVector row_max (Array<octave_idx_type>& index) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
323
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
324 FloatRowVector column_min (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
325 FloatRowVector column_max (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
326
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
327 FloatRowVector column_min (Array<octave_idx_type>& index) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
328 FloatRowVector column_max (Array<octave_idx_type>& index) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
329
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
330 // i/o
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
331
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
332 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const FloatMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
333 friend OCTAVE_API std::istream& operator >> (std::istream& is, FloatMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
334
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
335 static float resize_fill_value (void) { return 0; }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
336
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
337 };
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
338
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
339 // Publish externally used friend functions.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
340
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
341 extern OCTAVE_API FloatMatrix real (const FloatComplexMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
342 extern OCTAVE_API FloatMatrix imag (const FloatComplexMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
343
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
344 // column vector by row vector -> matrix operations
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
345
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
346 extern OCTAVE_API FloatMatrix operator * (const FloatColumnVector& a, const FloatRowVector& b);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
347
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
348 // Other functions.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
349
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
350 extern OCTAVE_API FloatMatrix Givens (float, float);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
351
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
352 extern OCTAVE_API FloatMatrix Sylvester (const FloatMatrix&, const FloatMatrix&, const FloatMatrix&);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
353
9665
1dba57e9d08d use blas_trans_type for xgemm
Jaroslav Hajek <highegg@gmail.com>
parents: 9661
diff changeset
354 extern OCTAVE_API FloatMatrix xgemm (const FloatMatrix& a, const FloatMatrix& b,
1dba57e9d08d use blas_trans_type for xgemm
Jaroslav Hajek <highegg@gmail.com>
parents: 9661
diff changeset
355 blas_trans_type transa = blas_no_trans,
1dba57e9d08d use blas_trans_type for xgemm
Jaroslav Hajek <highegg@gmail.com>
parents: 9661
diff changeset
356 blas_trans_type transb = blas_no_trans);
7804
a0c550b22e61 compound ops for float matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 7797
diff changeset
357
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
358 extern OCTAVE_API FloatMatrix operator * (const FloatMatrix& a, const FloatMatrix& b);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
359
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
360 extern OCTAVE_API FloatMatrix min (float d, const FloatMatrix& m);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
361 extern OCTAVE_API FloatMatrix min (const FloatMatrix& m, float d);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
362 extern OCTAVE_API FloatMatrix min (const FloatMatrix& a, const FloatMatrix& b);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
363
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
364 extern OCTAVE_API FloatMatrix max (float d, const FloatMatrix& m);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
365 extern OCTAVE_API FloatMatrix max (const FloatMatrix& m, float d);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
366 extern OCTAVE_API FloatMatrix max (const FloatMatrix& a, const FloatMatrix& b);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
367
9653
e087d7c77ff9 improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
368 extern OCTAVE_API FloatMatrix linspace (const FloatColumnVector& x1,
e087d7c77ff9 improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
369 const FloatColumnVector& x2,
e087d7c77ff9 improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
370 octave_idx_type n);
e087d7c77ff9 improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
371
e087d7c77ff9 improve linspace in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
372
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
373 MS_CMP_OP_DECLS (FloatMatrix, float, OCTAVE_API)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
374 MS_BOOL_OP_DECLS (FloatMatrix, float, OCTAVE_API)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
375
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
376 SM_CMP_OP_DECLS (float, FloatMatrix, OCTAVE_API)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
377 SM_BOOL_OP_DECLS (float, FloatMatrix, OCTAVE_API)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
378
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
379 MM_CMP_OP_DECLS (FloatMatrix, FloatMatrix, OCTAVE_API)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
380 MM_BOOL_OP_DECLS (FloatMatrix, FloatMatrix, OCTAVE_API)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
381
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10312
diff changeset
382 MARRAY_FORWARD_DEFS (MArray, FloatMatrix, float)
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
383
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
384 template <class T>
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
385 void read_int (std::istream& is, bool swap_bytes, T& val);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
386
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
387 #endif