457
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
457
|
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 |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
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 |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
457
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_ComplexSVD_h) |
|
24 #define octave_ComplexSVD_h 1 |
|
25 |
1296
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
3503
|
30 #include <iostream> |
457
|
31 |
|
32 #include "dDiagMatrix.h" |
|
33 #include "CMatrix.h" |
537
|
34 #include "dbleSVD.h" |
457
|
35 |
1881
|
36 class |
|
37 ComplexSVD |
457
|
38 { |
|
39 public: |
|
40 |
1528
|
41 ComplexSVD (void) { } |
|
42 |
1529
|
43 ComplexSVD (const ComplexMatrix& a, SVD::type svd_type = SVD::std) |
1528
|
44 { |
|
45 init (a, svd_type); |
|
46 } |
|
47 |
1529
|
48 ComplexSVD (const ComplexMatrix& a, int& info, |
|
49 SVD::type svd_type = SVD::std) |
1528
|
50 { |
|
51 info = init (a, svd_type); |
|
52 } |
457
|
53 |
1528
|
54 ComplexSVD (const ComplexSVD& a) |
1881
|
55 : sigma (a.sigma), left_sm (a.left_sm), right_sm (a.right_sm) { } |
457
|
56 |
1528
|
57 ComplexSVD& operator = (const ComplexSVD& a) |
|
58 { |
1881
|
59 if (this != &a) |
|
60 { |
|
61 sigma = a.sigma; |
|
62 left_sm = a.left_sm; |
|
63 right_sm = a.right_sm; |
|
64 } |
1528
|
65 return *this; |
|
66 } |
|
67 |
1930
|
68 ~ComplexSVD (void) { } |
|
69 |
1528
|
70 DiagMatrix singular_values (void) const { return sigma; } |
|
71 |
1544
|
72 ComplexMatrix left_singular_matrix (void) const; |
1528
|
73 |
1544
|
74 ComplexMatrix right_singular_matrix (void) const; |
457
|
75 |
|
76 friend ostream& operator << (ostream& os, const ComplexSVD& a); |
|
77 |
|
78 private: |
|
79 |
1544
|
80 SVD::type type_computed; |
|
81 |
457
|
82 DiagMatrix sigma; |
|
83 ComplexMatrix left_sm; |
|
84 ComplexMatrix right_sm; |
1881
|
85 |
|
86 int init (const ComplexMatrix& a, SVD::type svd_type = SVD::std); |
457
|
87 }; |
|
88 |
|
89 #endif |
|
90 |
|
91 /* |
|
92 ;;; Local Variables: *** |
|
93 ;;; mode: C++ *** |
|
94 ;;; End: *** |
|
95 */ |