annotate liboctave/operators/mx-defs.h @ 22236:065a44375723

gsvd: reduce code duplication with templates. * CmplxGSVD.cc, CmplxGSVD.h, dbleGSVD.cc, dbleGSVD.h: Remove files for no longer existing classes. Replaced by gsvd template class. This classes never existed in an Octave release, this was freshly imported from Octave Forge so backwards compatibility is not an issue. * liboctave/numeric/gsvd.h, liboctave/numeric/gsvd.cc: New files for gsvd class template generated from CmplxGSVD.cc, CmplxGSVD.h, dbleGSVD.cc, and dbleGSVD.h and converted to template. Removed unused << operator, unused constructor with &info, and commented code. Only instantiated for Matrix and ComplexMatrix, providing interface to DGGSVD and ZGGSVD. * liboctave/numeric/module.mk: Update. * mx-defs.h, mx-ext.h: Use new classes.
author Barbara Locsi <locsi.barbara@gmail.com>
date Tue, 09 Aug 2016 18:02:11 +0200
parents 63b41167ef1e
children bac0d6f07a3e
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
22236
065a44375723 gsvd: reduce code duplication with templates.
Barbara Locsi <locsi.barbara@gmail.com>
parents: 22235
diff changeset
69 template <typename T> class gsvd;
22235
63b41167ef1e gsvd: new function imported from Octave-Forge linear-algebra package.
Barbara Locsi <locsi.barbara@gmail.com>
parents: 21724
diff changeset
70
21267
f5b8c3aca5f8 make better use of templates for Hessenberg decomposition
John W. Eaton <jwe@octave.org>
parents: 21266
diff changeset
71 template <typename T> class hess;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
72
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
73 template <typename T> class schur;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
74
21273
cbced1c09916 better use of templates for svd classes
John W. Eaton <jwe@octave.org>
parents: 21271
diff changeset
75 template <typename T> class svd;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
76
21271
7e67c7f82fc1 better use of templates for lu factorization classes
John W. Eaton <jwe@octave.org>
parents: 21269
diff changeset
77 template <typename T> class lu;
1574
dd7d27461567 [project @ 1995-10-19 04:34:20 by jwe]
jwe
parents: 1315
diff changeset
78
21279
eb1524b07fe3 better use of templates for qr classes
John W. Eaton <jwe@octave.org>
parents: 21273
diff changeset
79 template <typename T> class qr;
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
80
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
81 template <typename T> class qrp;
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
82
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
83 // 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
84 // declarations.
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
85
1649
643b55bb57dd [project @ 1995-12-20 06:44:41 by jwe]
jwe
parents: 1574
diff changeset
86 #include "oct-cmplx.h"
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
87
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21280
diff changeset
88 #if ! defined (MAPPER_FCN_TYPEDEFS)
21202
f7121e111991 maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents: 20791
diff changeset
89 # define MAPPER_FCN_TYPEDEFS 1
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
90
3248
68259f410026 [project @ 1999-07-13 03:34:54 by jwe]
jwe
parents: 2847
diff changeset
91 typedef bool (*b_d_Mapper)(double);
68259f410026 [project @ 1999-07-13 03:34:54 by jwe]
jwe
parents: 2847
diff changeset
92 typedef bool (*b_c_Mapper)(const Complex&);
68259f410026 [project @ 1999-07-13 03:34:54 by jwe]
jwe
parents: 2847
diff changeset
93
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
94 typedef double (*d_d_Mapper)(double);
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
95 typedef double (*d_c_Mapper)(const Complex&);
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
96 typedef Complex (*c_c_Mapper)(const Complex&);
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
97
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
98 typedef bool (*b_f_Mapper)(float);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
99 typedef bool (*b_fc_Mapper)(const FloatComplex&);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
100
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
101 typedef float (*f_f_Mapper)(float);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
102 typedef float (*f_fc_Mapper)(const FloatComplex&);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
103 typedef FloatComplex (*fc_fc_Mapper)(const FloatComplex&);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
104
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
105 enum blas_trans_type
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
106 {
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
107 blas_no_trans = 'N',
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
108 blas_trans = 'T',
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
109 blas_conj_trans = 'C'
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
110 };
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
111
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
112 inline char
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
113 get_blas_char (blas_trans_type transt)
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
114 {
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
115 return static_cast<char> (transt);
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
21202
f7121e111991 maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents: 20791
diff changeset
118 # endif
9661
afcf852256d2 optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
119
460
c45e50c4ee94 [project @ 1994-06-06 00:45:22 by jwe]
jwe
parents:
diff changeset
120 #endif