annotate liboctave/numeric/schur.h @ 22323:bac0d6f07a3e

maint: Update copyright notices for 2016.
author John W. Eaton <jwe@octave.org>
date Wed, 17 Aug 2016 01:05:19 -0400
parents 6ca3acf5fad8
children 7f3c7a8bd131
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
1 /*
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
2
22323
bac0d6f07a3e maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents: 22317
diff changeset
3 Copyright (C) 1994-2016 John W. Eaton
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
4
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
6
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 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: 6108
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: 6108
diff changeset
10 option) any later version.
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
11
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
15 for more details.
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
16
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 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: 6108
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: 6108
diff changeset
19 <http://www.gnu.org/licenses/>.
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
20
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
21 */
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
22
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
23 #if ! defined (octave_schur_h)
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
24 #define octave_schur_h 1
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
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
1756
1af643fa00e3 [project @ 1996-01-22 04:55:17 by jwe]
jwe
parents: 1528
diff changeset
28 #include <string>
1af643fa00e3 [project @ 1996-01-22 04:55:17 by jwe]
jwe
parents: 1528
diff changeset
29
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
30 #include "dMatrix.h"
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
31 #include "CMatrix.h"
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
32 #include "fMatrix.h"
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
33 #include "fCMatrix.h"
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
34
22317
6ca3acf5fad8 move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents: 21274
diff changeset
35 namespace octave
6ca3acf5fad8 move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents: 21274
diff changeset
36 {
6ca3acf5fad8 move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents: 21274
diff changeset
37 namespace math
6ca3acf5fad8 move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents: 21274
diff changeset
38 {
6ca3acf5fad8 move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents: 21274
diff changeset
39
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
40 template <typename T> class schur;
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
41
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
42 template <typename T>
1881
950825cea083 [project @ 1996-02-05 18:07:21 by jwe]
jwe
parents: 1756
diff changeset
43 class
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
44 schur
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
45 {
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
46 public:
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
47
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
48 schur (void) : schur_mat (), unitary_mat () { }
1528
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1486
diff changeset
49
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
50 schur (const T& a, const std::string& ord, bool calc_unitary = true)
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
51 : schur_mat (), unitary_mat ()
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
52 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
53 init (a, ord, calc_unitary);
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
54 }
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
55
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
56 schur (const T& a, const std::string& ord, octave_idx_type& info,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
57 bool calc_unitary = true)
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
58 : schur_mat (), unitary_mat ()
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
59 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
60 info = init (a, ord, calc_unitary);
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
61 }
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
62
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
63 // This one should really be protected or private but we need it in
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
64 // rsf2csf and I don't see how to make that function a friend of
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
65 // this class.
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
66 schur (const T& s, const T& u) : schur_mat (s), unitary_mat (u) { }
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
67
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
68 schur (const schur& a)
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
69
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
70 : schur_mat (a.schur_mat), unitary_mat (a.unitary_mat)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
71 { }
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
72
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
73 schur& operator = (const schur& a)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
74 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
75 if (this != &a)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
76 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
77 schur_mat = a.schur_mat;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
78 unitary_mat = a.unitary_mat;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
79 }
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
80
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
81 return *this;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
82 }
1528
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1486
diff changeset
83
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
84 ~schur (void) { }
1929
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1881
diff changeset
85
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
86 T schur_matrix (void) const { return schur_mat; }
1528
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1486
diff changeset
87
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
88 T unitary_matrix (void) const { return unitary_mat; }
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
89
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
90 protected:
1929
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1881
diff changeset
91
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
92 private:
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
93
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
94 T schur_mat;
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
95 T unitary_mat;
1881
950825cea083 [project @ 1996-02-05 18:07:21 by jwe]
jwe
parents: 1756
diff changeset
96
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
97 octave_idx_type
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
98 init (const T& a, const std::string& ord, bool calc_unitary);
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
99 };
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
100
21266
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
101 template <typename RT, typename AT>
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
102 extern schur<RT>
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
103 rsf2csf (const AT& s, const AT& u);
e69eaee28737 make better use of templates for Schur decomposition
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
104
22317
6ca3acf5fad8 move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents: 21274
diff changeset
105 }
6ca3acf5fad8 move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents: 21274
diff changeset
106 }
6ca3acf5fad8 move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents: 21274
diff changeset
107
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
108 #endif