annotate liboctave/fMatrix.h @ 8650:a1ae2aae903e

abs,real,imag,conj: use code from mx-inlines rather than the generic map
author Jaroslav Hajek <highegg@gmail.com>
date Mon, 02 Feb 2009 15:35:32 +0100
parents c187f0e3a7ee
children b756ce0002db
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
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
3 Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
4 2004, 2005, 2006, 2007 John W. Eaton
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
5
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
6 This file is part of Octave.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
7
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
8 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
9 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
10 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
11 option) any later version.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
12
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
13 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
14 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
15 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
16 for more details.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
17
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
18 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
19 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
20 <http://www.gnu.org/licenses/>.
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
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
24 #if !defined (octave_FloatMatrix_int_h)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
25 #define octave_FloatMatrix_int_h 1
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
26
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
27 #include "MArray2.h"
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
28 #include "MDiagArray2.h"
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
29 #include "MatrixType.h"
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
30
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
31 #include "mx-defs.h"
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
32 #include "mx-op-defs.h"
8335
64cf956a109c templatize & fix DET
Jaroslav Hajek <highegg@gmail.com>
parents: 7922
diff changeset
33 #include "DET.h"
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
34
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
35 class
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
36 OCTAVE_API
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
37 FloatMatrix : public MArray2<float>
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
38 {
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
39 public:
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
40
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
41 typedef void (*solve_singularity_handler) (float rcon);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
42
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
43 FloatMatrix (void) : MArray2<float> () { }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
44
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
45 FloatMatrix (octave_idx_type r, octave_idx_type c) : MArray2<float> (r, c) { }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
46
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
47 FloatMatrix (octave_idx_type r, octave_idx_type c, float val) : MArray2<float> (r, c, val) { }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
48
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
49 FloatMatrix (const dim_vector& dv) : MArray2<float> (dv) { }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
50
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
51 FloatMatrix (const dim_vector& dv, float val) : MArray2<float> (dv, val) { }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
52
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
53 FloatMatrix (const FloatMatrix& a) : MArray2<float> (a) { }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
54
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
55 template <class U>
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
56 FloatMatrix (const MArray2<U>& a) : MArray2<float> (a) { }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
57
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
58 template <class U>
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
59 FloatMatrix (const Array2<U>& a) : MArray2<float> (a) { }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
60
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
61 explicit FloatMatrix (const FloatRowVector& rv);
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 explicit FloatMatrix (const FloatColumnVector& cv);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
64
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
65 explicit FloatMatrix (const FloatDiagMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
66
8367
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8336
diff changeset
67 explicit FloatMatrix (const PermMatrix& a);
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8336
diff changeset
68
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
69 explicit FloatMatrix (const boolMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
70
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
71 explicit FloatMatrix (const charMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
72
8367
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 FloatMatrix& operator = (const FloatMatrix& 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 MArray2<float>::operator = (a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
77 return *this;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
78 }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
79
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
80 bool operator == (const FloatMatrix& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
81 bool operator != (const FloatMatrix& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
82
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
83 bool is_symmetric (void) const;
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 // destructive insert/delete/reorder operations
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
86
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
87 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
88 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
89 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
90 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
91
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
92 FloatMatrix& fill (float val);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
93 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
94
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
95 FloatMatrix append (const FloatMatrix& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
96 FloatMatrix append (const FloatRowVector& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
97 FloatMatrix append (const FloatColumnVector& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
98 FloatMatrix append (const FloatDiagMatrix& a) const;
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 stack (const FloatMatrix& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
101 FloatMatrix stack (const FloatRowVector& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
102 FloatMatrix stack (const FloatColumnVector& a) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
103 FloatMatrix stack (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 friend OCTAVE_API FloatMatrix real (const FloatComplexMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
106 friend OCTAVE_API FloatMatrix imag (const FloatComplexMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
107
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
108 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
109
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
110 FloatMatrix transpose (void) const { return MArray2<float>::transpose (); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
111
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
112 // resize is the destructive equivalent for this one
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
113
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
114 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
115
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
116 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
117
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
118 // extract row or column i.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
119
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
120 FloatRowVector row (octave_idx_type i) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
121
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
122 FloatColumnVector column (octave_idx_type i) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
123
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
124 private:
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
125 FloatMatrix tinverse (MatrixType &mattype, octave_idx_type& info, float& rcon,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
126 int force, int calc_cond) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
127
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
128 FloatMatrix finverse (MatrixType &mattype, octave_idx_type& info, float& rcon,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
129 int force, int calc_cond) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
130
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
131 public:
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
132 FloatMatrix inverse (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
133 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
134 FloatMatrix inverse (octave_idx_type& info, float& rcon, int force = 0,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
135 int calc_cond = 1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
136
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
137 FloatMatrix inverse (MatrixType &mattype) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
138 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
139 FloatMatrix inverse (MatrixType &mattype, octave_idx_type& info, float& rcon,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
140 int force = 0, int calc_cond = 1) const;
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 FloatMatrix pseudo_inverse (float tol = 0.0) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
143
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
144 FloatComplexMatrix fourier (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
145 FloatComplexMatrix ifourier (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
146
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
147 FloatComplexMatrix fourier2d (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
148 FloatComplexMatrix ifourier2d (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
149
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
150 FloatDET determinant (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
151 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
152 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
153 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
154 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
155
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
156 float rcond (void) const;
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
157 float rcond (MatrixType &mattype) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
158
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
159 private:
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
160 // Upper triangular matrix solvers
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
161 FloatMatrix utsolve (MatrixType &typ, const FloatMatrix& b, octave_idx_type& info,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
162 float& rcon, solve_singularity_handler sing_handler,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
163 bool calc_cond = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
164
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
165 // Lower triangular matrix solvers
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
166 FloatMatrix ltsolve (MatrixType &typ, const FloatMatrix& b, octave_idx_type& info,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
167 float& rcon, solve_singularity_handler sing_handler,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
168 bool calc_cond = false) const;
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 // Full matrix solvers (lu/cholesky)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
171 FloatMatrix fsolve (MatrixType &typ, const FloatMatrix& b, octave_idx_type& info,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
172 float& rcon, solve_singularity_handler sing_handler,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
173 bool calc_cond = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
174
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
175 public:
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
176 // Generic interface to solver with no probing of type
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
177 FloatMatrix solve (MatrixType &typ, const FloatMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
178 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
179 FloatMatrix solve (MatrixType &typ, const FloatMatrix& b, octave_idx_type& info,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
180 float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
181 FloatMatrix solve (MatrixType &typ, const FloatMatrix& b, octave_idx_type& info,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
182 float& rcon, solve_singularity_handler sing_handler,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
183 bool singular_fallback = true) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
184
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
185 FloatComplexMatrix solve (MatrixType &typ, const FloatComplexMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
186 FloatComplexMatrix solve (MatrixType &typ, const FloatComplexMatrix& b,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
187 octave_idx_type& info) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
188 FloatComplexMatrix solve (MatrixType &typ, const FloatComplexMatrix& b,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
189 octave_idx_type& info, float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
190 FloatComplexMatrix solve (MatrixType &typ, const FloatComplexMatrix& b,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
191 octave_idx_type& info, float& rcon,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
192 solve_singularity_handler sing_handler,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
193 bool singular_fallback = true) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
194
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
195 FloatColumnVector solve (MatrixType &typ, const FloatColumnVector& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
196 FloatColumnVector solve (MatrixType &typ, const FloatColumnVector& b,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
197 octave_idx_type& info) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
198 FloatColumnVector solve (MatrixType &typ, const FloatColumnVector& b,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
199 octave_idx_type& info, float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
200 FloatColumnVector solve (MatrixType &typ, const FloatColumnVector& b,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
201 octave_idx_type& info, float& rcon,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
202 solve_singularity_handler sing_handler) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
203
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
204 FloatComplexColumnVector solve (MatrixType &typ,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
205 const FloatComplexColumnVector& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
206 FloatComplexColumnVector solve (MatrixType &typ, const FloatComplexColumnVector& b,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
207 octave_idx_type& info) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
208 FloatComplexColumnVector solve (MatrixType &typ, const FloatComplexColumnVector& b,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
209 octave_idx_type& info, float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
210 FloatComplexColumnVector solve (MatrixType &typ, const FloatComplexColumnVector& b,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
211 octave_idx_type& info, float& rcon,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
212 solve_singularity_handler sing_handler) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
213
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
214 // Generic interface to solver with probing of type
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
215 FloatMatrix solve (const FloatMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
216 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
217 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
218 FloatMatrix solve (const FloatMatrix& b, octave_idx_type& info, float& rcon,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
219 solve_singularity_handler sing_handler) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
220
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
221 FloatComplexMatrix solve (const FloatComplexMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
222 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
223 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
224 FloatComplexMatrix solve (const FloatComplexMatrix& b, octave_idx_type& info, float& rcon,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
225 solve_singularity_handler sing_handler) const;
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 FloatColumnVector solve (const FloatColumnVector& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
228 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
229 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
230 FloatColumnVector solve (const FloatColumnVector& b, octave_idx_type& info, float& rcon,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
231 solve_singularity_handler sing_handler) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
232
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
233 FloatComplexColumnVector solve (const FloatComplexColumnVector& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
234 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
235 FloatComplexColumnVector solve (const FloatComplexColumnVector& b, octave_idx_type& info,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
236 float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
237 FloatComplexColumnVector solve (const FloatComplexColumnVector& b, octave_idx_type& info,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
238 float& rcon,
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
239 solve_singularity_handler sing_handler) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
240
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
241 // Singular solvers
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
242 FloatMatrix lssolve (const FloatMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
243 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
244 FloatMatrix lssolve (const FloatMatrix& b, octave_idx_type& info,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
245 octave_idx_type& rank) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
246 FloatMatrix lssolve (const FloatMatrix& b, octave_idx_type& info,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
247 octave_idx_type& rank, float& rcon) 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 FloatComplexMatrix lssolve (const FloatComplexMatrix& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
250 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
251 FloatComplexMatrix lssolve (const FloatComplexMatrix& b, octave_idx_type& info,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
252 octave_idx_type& rank) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
253 FloatComplexMatrix lssolve (const FloatComplexMatrix& b, octave_idx_type& info,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
254 octave_idx_type& rank, float &rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
255
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
256 FloatColumnVector lssolve (const FloatColumnVector& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
257 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
258 FloatColumnVector lssolve (const FloatColumnVector& b, octave_idx_type& info,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
259 octave_idx_type& rank) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
260 FloatColumnVector lssolve (const FloatColumnVector& b, octave_idx_type& info,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
261 octave_idx_type& rank, float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
262
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
263 FloatComplexColumnVector lssolve (const FloatComplexColumnVector& b) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
264 FloatComplexColumnVector lssolve (const FloatComplexColumnVector& b,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
265 octave_idx_type& info) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
266 FloatComplexColumnVector lssolve (const FloatComplexColumnVector& b,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
267 octave_idx_type& info,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
268 octave_idx_type& rank) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
269 FloatComplexColumnVector lssolve (const FloatComplexColumnVector& b,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
270 octave_idx_type& info,
7797
f42c6f8d6d8e Extend rcond function to single precision types
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
271 octave_idx_type& rank, float& rcon) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
272
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
273 FloatMatrix& operator += (const FloatDiagMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
274 FloatMatrix& operator -= (const FloatDiagMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
275
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
276 // unary operations
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
277
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
278 boolMatrix operator ! (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
279
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
280 // other operations
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
281
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
282 typedef float (*dmapper) (float);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
283 typedef FloatComplex (*cmapper) (const FloatComplex&);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
284 typedef bool (*bmapper) (float);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
285
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
286 FloatMatrix map (dmapper fcn) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
287 FloatComplexMatrix map (cmapper fcn) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
288 boolMatrix map (bmapper fcn) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
289
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
290 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
291 bool any_element_is_nan (void) const;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
292 bool any_element_is_inf_or_nan (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
293 bool any_element_not_one_or_zero (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
294 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
295 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
296 bool too_large_for_float (void) const;
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 boolMatrix all (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
299 boolMatrix any (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
300
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
301 FloatMatrix cumprod (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
302 FloatMatrix cumsum (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
303 FloatMatrix prod (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
304 FloatMatrix sum (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
305 FloatMatrix sumsq (int dim = -1) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
306 FloatMatrix abs (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
307
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
308 FloatMatrix diag (octave_idx_type k = 0) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
309
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
310 FloatColumnVector row_min (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
311 FloatColumnVector row_max (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
312
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
313 FloatColumnVector row_min (Array<octave_idx_type>& index) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
314 FloatColumnVector row_max (Array<octave_idx_type>& index) 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 FloatRowVector column_min (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
317 FloatRowVector column_max (void) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
318
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
319 FloatRowVector column_min (Array<octave_idx_type>& index) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
320 FloatRowVector column_max (Array<octave_idx_type>& index) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
321
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
322 // i/o
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 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
325 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
326
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
327 static float resize_fill_value (void) { return 0; }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
328
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
329 private:
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
330
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
331 FloatMatrix (float *d, octave_idx_type r, octave_idx_type c) : MArray2<float> (d, r, c) { }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
332 };
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
333
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
334 // Publish externally used friend functions.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
335
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
336 extern OCTAVE_API FloatMatrix real (const FloatComplexMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
337 extern OCTAVE_API FloatMatrix imag (const FloatComplexMatrix& a);
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 // column vector by row vector -> matrix operations
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 operator * (const FloatColumnVector& a, const FloatRowVector& b);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
342
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
343 // Other functions.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
344
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
345 extern OCTAVE_API FloatMatrix Givens (float, float);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
346
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
347 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
348
7804
a0c550b22e61 compound ops for float matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 7797
diff changeset
349 extern OCTAVE_API FloatMatrix xgemm (bool transa, const FloatMatrix& a, bool transb, const FloatMatrix& b);
a0c550b22e61 compound ops for float matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 7797
diff changeset
350
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
351 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
352
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
353 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
354 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
355 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
356
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
357 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
358 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
359 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
360
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
361 MS_CMP_OP_DECLS (FloatMatrix, float, OCTAVE_API)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
362 MS_BOOL_OP_DECLS (FloatMatrix, float, OCTAVE_API)
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 SM_CMP_OP_DECLS (float, FloatMatrix, OCTAVE_API)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
365 SM_BOOL_OP_DECLS (float, FloatMatrix, OCTAVE_API)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
366
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
367 MM_CMP_OP_DECLS (FloatMatrix, FloatMatrix, OCTAVE_API)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
368 MM_BOOL_OP_DECLS (FloatMatrix, FloatMatrix, OCTAVE_API)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
369
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
370 MARRAY_FORWARD_DEFS (MArray2, FloatMatrix, float)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
371
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
372 template <class T>
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
373 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
374
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
375 #endif
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
376
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
377 /*
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
378 ;;; Local Variables: ***
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
379 ;;; mode: C++ ***
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
380 ;;; End: ***
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
381 */