Mercurial > octave
annotate liboctave/numeric/gepbalance.h @ 21268:f08ae27289e4
better use of templates for balance classes
* aepbalance.h, aepbalance.cc: New files generated from base-aepbal.h,
CmplxAEPBAL.cc, CmplxAEPBAL.h, dbleAEPBAL.cc, dbleAEPBAL.h,
fCmplxAEPBAL.cc, fCmplxAEPBAL.h, floatAEPBAL.cc, and floatAEPBAL.h and
making them templates.
* gepbalance.h, gepbalance.cc: New files generate from CmplxGEPBAL.cc,
CmplxGEPBAL.h, dbleGEPBAL.cc, dbleGEPBAL.h, fCmplxGEPBAL.cc,
fCmplxGEPBAL.h, floatGEPBAL.cc, and floatGEPBAL.h and making them
templates.
* liboctave/numeric/module.mk: Update.
* balance.cc, CMatrix.h, dMatrix.h, fCMatrix.h, fMatrix.h, mx-defs.h,
mx-ext.h: Use new classes.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 16 Feb 2016 00:32:29 -0500 |
parents | liboctave/numeric/dbleGEPBAL.h@1473547f50f5 |
children | 6ca3acf5fad8 |
rev | line source |
---|---|
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 /* |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17822
diff
changeset
|
3 Copyright (C) 1994-2015 John W. Eaton |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 This file is part of Octave. |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 option) any later version. |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 for more details. |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 */ |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
23 #if ! defined (octave_gepbalance_h) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
24 #define octave_gepbalance_h 1 |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
27 |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 #include <string> |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
30 template <typename T> |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 class |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
32 gepbalance |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 { |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 public: |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
36 typedef typename T::real_matrix_type RT; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
37 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
38 gepbalance (void) |
11498
367bfee35ba0
data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
39 : balanced_mat (), balanced_mat2 (), balancing_mat (), balancing_mat2 () |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
40 { } |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
42 gepbalance (const T& a, const T& b, const std::string& job) |
11498
367bfee35ba0
data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
43 : balanced_mat (), balanced_mat2 (), balancing_mat (), balancing_mat2 () |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
44 { |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
45 init (a, b, job); |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
46 } |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
48 gepbalance (const gepbalance& a) |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 : balanced_mat (a.balanced_mat), balanced_mat2 (a.balanced_mat2), |
11498
367bfee35ba0
data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
50 balancing_mat (a.balancing_mat), balancing_mat2 (a.balancing_mat2) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
51 { } |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
53 gepbalance& operator = (const gepbalance& a) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
54 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
55 if (this != &a) |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
56 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
57 balanced_mat = a.balanced_mat; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
58 balanced_mat2 = a.balanced_mat2; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
59 balancing_mat = a.balancing_mat; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
60 balancing_mat2 = a.balancing_mat2; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
61 } |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
62 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
63 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
64 } |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
66 ~gepbalance (void) { } |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
68 T balanced_matrix (void) const { return balanced_mat; } |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
70 T balanced_matrix2 (void) const { return balanced_mat2; } |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
72 RT balancing_matrix (void) const { return balancing_mat; } |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
73 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
74 RT balancing_matrix2 (void) const { return balancing_mat2; } |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
75 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
76 private: |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
77 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
78 T balanced_mat; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
79 T balanced_mat2; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
80 RT balancing_mat; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
81 RT balancing_mat2; |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
82 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
83 octave_idx_type init (const T& a, const T& b, const std::string& job); |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
84 }; |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
86 #endif |