Mercurial > octave
annotate liboctave/operators/mx-defs.h @ 21266:e69eaee28737
make better use of templates for Schur decomposition
* liboctave/numeric/schur.h, liboctave/numeric/schur.cc:
New files generated from SCHUR.h, SCHUR.cc, CmplxSCHUR.h,
CmplxSCHUR.cc, dbleSCHUR.h, dbleSCHUR.cc, fCmplxSCHUR.h,
fCmplxSCHUR.cc, floatSCHUR.h, and floatSCHUR.cc and making them
templates.
* liboctave/numeric/module.mk: Update.
* libinterp/corefcn/schur.cc, sqrtm.cc, CMatrix.cc, dMatrix.cc,
fCMatrix.cc, fMatrix.cc, mx-defs.h, mx-ext.h: Use new template classes
and header file.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 15 Feb 2016 20:06:12 -0500 |
parents | 1473547f50f5 |
children | f5b8c3aca5f8 |
rev | line source |
---|---|
460 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
3 Copyright (C) 1994-2015 John W. Eaton |
460 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
460 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
460 | 20 |
21 */ | |
22 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
23 #if ! defined (octave_mx_defs_h) |
460 | 24 #define octave_mx_defs_h 1 |
25 | |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
27 |
460 | 28 // Classes we declare. |
29 | |
30 class Matrix; | |
1574 | 31 class ComplexMatrix; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
32 class FloatMatrix; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
33 class FloatComplexMatrix; |
2828 | 34 class boolMatrix; |
1574 | 35 class charMatrix; |
36 | |
4543 | 37 class NDArray; |
38 class ComplexNDArray; | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
39 class FloatNDArray; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
40 class FloatComplexNDArray; |
4543 | 41 class boolNDArray; |
42 class charNDArray; | |
43 | |
460 | 44 class ColumnVector; |
1574 | 45 class ComplexColumnVector; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
46 class FloatColumnVector; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
47 class FloatComplexColumnVector; |
1574 | 48 |
460 | 49 class RowVector; |
1574 | 50 class ComplexRowVector; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
51 class FloatRowVector; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
52 class FloatComplexRowVector; |
1574 | 53 |
460 | 54 class DiagMatrix; |
55 class ComplexDiagMatrix; | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
56 class FloatDiagMatrix; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
57 class FloatComplexDiagMatrix; |
1574 | 58 |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8335
diff
changeset
|
59 class PermMatrix; |
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8335
diff
changeset
|
60 |
460 | 61 class AEPBALANCE; |
62 class ComplexAEPBALANCE; | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
63 class FloatAEPBALANCE; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
64 class FloatComplexAEPBALANCE; |
1574 | 65 |
460 | 66 class GEPBALANCE; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
67 class ComplexGEPBALANCE; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
68 class FloatGEPBALANCE; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
69 class FloatComplexGEPBALANCE; |
1574 | 70 |
460 | 71 class CHOL; |
72 class ComplexCHOL; | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
73 class FloatCHOL; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
74 class FloatComplexCHOL; |
1574 | 75 |
460 | 76 class EIG; |
1574 | 77 |
460 | 78 class HESS; |
79 class ComplexHESS; | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
80 class FloatHESS; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
81 class FloatComplexHESS; |
1574 | 82 |
21266
e69eaee28737
make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
83 template <typename T> class schur; |
1574 | 84 |
460 | 85 class SVD; |
86 class ComplexSVD; | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
87 class FloatSVD; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
88 class FloatComplexSVD; |
1574 | 89 |
460 | 90 class LU; |
91 class ComplexLU; | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
92 class FloatLU; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
93 class FloatComplexLU; |
1574 | 94 |
460 | 95 class QR; |
96 class ComplexQR; | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
97 class FloatQR; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
98 class FloatComplexQR; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
99 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
100 class QRP; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
101 class ComplexQRP; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
102 class FloatQRP; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
103 class FloatComplexQRP; |
460 | 104 |
105 // Other data types we use but that don't always need to have full | |
106 // declarations. | |
107 | |
1649 | 108 #include "oct-cmplx.h" |
460 | 109 |
110 #ifndef MAPPER_FCN_TYPEDEFS | |
21202
f7121e111991
maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
111 # define MAPPER_FCN_TYPEDEFS 1 |
460 | 112 |
3248 | 113 typedef bool (*b_d_Mapper)(double); |
114 typedef bool (*b_c_Mapper)(const Complex&); | |
115 | |
460 | 116 typedef double (*d_d_Mapper)(double); |
117 typedef double (*d_c_Mapper)(const Complex&); | |
118 typedef Complex (*c_c_Mapper)(const Complex&); | |
119 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
120 typedef bool (*b_f_Mapper)(float); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
121 typedef bool (*b_fc_Mapper)(const FloatComplex&); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
122 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
123 typedef float (*f_f_Mapper)(float); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
124 typedef float (*f_fc_Mapper)(const FloatComplex&); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
125 typedef FloatComplex (*fc_fc_Mapper)(const FloatComplex&); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
126 |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
127 enum blas_trans_type |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
128 { |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
129 blas_no_trans = 'N', |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
130 blas_trans = 'T', |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
131 blas_conj_trans = 'C' |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
132 }; |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
133 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
134 inline char |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
135 get_blas_char (blas_trans_type transt) |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
136 { |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
137 return static_cast<char> (transt); |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
138 } |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
139 |
21202
f7121e111991
maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
140 # endif |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
141 |
460 | 142 #endif |