annotate liboctave/operators/mx-defs.h @ 21269:3c8a3d35661a

better use of templates for Cholesky factorization * liboctave/numeric/chol.h, liboctave/numeric/chol.cc: New files generated from CmplxCHOL.cc, fCmplxCHOL.cc, floatCHOL.cc, CmplxCHOL.h, dbleCHOL.cc, dbleCHOL.h, fCmplxCHOL.h, and floatCHOL.h and converted to templates. * liboctave/numeric/module.mk: Update. * __qp__.cc, chol.cc, CMatrix.cc, CMatrix.h, dMatrix.cc, dMatrix.h, fCMatrix.cc, fCMatrix.h, fMatrix.cc, fMatrix.h, eigs-base.cc, mx-defs.h, mx-ext.h: Use new classes.
author John W. Eaton <jwe@octave.org>
date Tue, 16 Feb 2016 02:47:29 -0500
parents f08ae27289e4
children 7e67c7f82fc1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
1 /*
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
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
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
4
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
6
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
10 option) any later version.
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
11
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
15 for more details.
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
16
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
19 <http://www.gnu.org/licenses/>.
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
20
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
21 */
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
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
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
24 #define octave_mx_defs_h 1
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
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
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
28 // Classes we declare.
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
29
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
30 class Matrix;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
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
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents: 1993
diff changeset
34 class boolMatrix;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
35 class charMatrix;
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
36
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3503
diff changeset
37 class NDArray;
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3503
diff changeset
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
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3503
diff changeset
41 class boolNDArray;
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3503
diff changeset
42 class charNDArray;
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3503
diff changeset
43
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
44 class ColumnVector;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
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
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
48
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
49 class RowVector;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
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
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
53
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
54 class DiagMatrix;
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
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
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
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
21268
f08ae27289e4 better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents: 21267
diff changeset
61 template <typename T> class aepbalance;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
62
21268
f08ae27289e4 better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents: 21267
diff changeset
63 template <typename T> class gepbalance;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
64
21269
3c8a3d35661a better use of templates for Cholesky factorization
John W. Eaton <jwe@octave.org>
parents: 21268
diff changeset
65 template <typename T> class chol;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
66
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
67 class EIG;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
68
21267
f5b8c3aca5f8 make better use of templates for Hessenberg decomposition
John W. Eaton <jwe@octave.org>
parents: 21266
diff changeset
69 template <typename T> class hess;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
70
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
71 template <typename T> class schur;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
72
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
73 class SVD;
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
74 class ComplexSVD;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
75 class FloatSVD;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
76 class FloatComplexSVD;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
77
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
78 class LU;
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
79 class ComplexLU;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
80 class FloatLU;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
81 class FloatComplexLU;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
82
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
83 class QR;
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
84 class ComplexQR;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
85 class FloatQR;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
86 class FloatComplexQR;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
87
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
88 class QRP;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
89 class ComplexQRP;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
90 class FloatQRP;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
91 class FloatComplexQRP;
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
92
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
93 // Other data types we use but that don't always need to have full
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
94 // declarations.
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
95
1649
643b55bb57dd [project @ 1995-12-20 06:44:41 by jwe]
jwe
parents: 1574
diff changeset
96 #include "oct-cmplx.h"
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
97
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
98 #ifndef MAPPER_FCN_TYPEDEFS
21202
f7121e111991 maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents: 20791
diff changeset
99 # define MAPPER_FCN_TYPEDEFS 1
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
100
3248
68259f410026 [project @ 1999-07-13 03:34:54 by jwe]
jwe
parents: 2847
diff changeset
101 typedef bool (*b_d_Mapper)(double);
68259f410026 [project @ 1999-07-13 03:34:54 by jwe]
jwe
parents: 2847
diff changeset
102 typedef bool (*b_c_Mapper)(const Complex&);
68259f410026 [project @ 1999-07-13 03:34:54 by jwe]
jwe
parents: 2847
diff changeset
103
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
104 typedef double (*d_d_Mapper)(double);
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
105 typedef double (*d_c_Mapper)(const Complex&);
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
106 typedef Complex (*c_c_Mapper)(const Complex&);
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
107
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
108 typedef bool (*b_f_Mapper)(float);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
109 typedef bool (*b_fc_Mapper)(const FloatComplex&);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
110
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
111 typedef float (*f_f_Mapper)(float);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
112 typedef float (*f_fc_Mapper)(const FloatComplex&);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
113 typedef FloatComplex (*fc_fc_Mapper)(const FloatComplex&);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
114
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
115 enum blas_trans_type
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
116 {
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
117 blas_no_trans = 'N',
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
118 blas_trans = 'T',
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
119 blas_conj_trans = 'C'
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
120 };
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
121
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
122 inline char
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
123 get_blas_char (blas_trans_type transt)
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
124 {
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
125 return static_cast<char> (transt);
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
126 }
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
127
21202
f7121e111991 maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents: 20791
diff changeset
128 # endif
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
129
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
130 #endif