457
|
1 // -*- C++ -*- |
|
2 /* |
|
3 |
1011
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
457
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
457
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_ComplexSVD_h) |
|
25 #define octave_ComplexSVD_h 1 |
|
26 |
1296
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
457
|
31 class ostream; |
|
32 |
|
33 #include "dDiagMatrix.h" |
|
34 #include "CMatrix.h" |
537
|
35 #include "dbleSVD.h" |
457
|
36 |
|
37 class ComplexSVD |
|
38 { |
|
39 friend class ComplexMatrix; |
|
40 |
|
41 public: |
|
42 |
|
43 ComplexSVD (void) {} |
|
44 |
537
|
45 ComplexSVD (const ComplexMatrix& a, SVD::type svd_type = SVD::std); |
|
46 ComplexSVD (const ComplexMatrix& a, int& info, |
|
47 SVD::type svd_type = SVD::std); |
457
|
48 |
|
49 ComplexSVD (const ComplexSVD& a); |
|
50 |
|
51 ComplexSVD& operator = (const ComplexSVD& a); |
|
52 |
|
53 DiagMatrix singular_values (void) const; |
|
54 ComplexMatrix left_singular_matrix (void) const; |
|
55 ComplexMatrix right_singular_matrix (void) const; |
|
56 |
|
57 friend ostream& operator << (ostream& os, const ComplexSVD& a); |
|
58 |
|
59 private: |
|
60 |
537
|
61 int init (const ComplexMatrix& a, SVD::type svd_type = SVD::std); |
457
|
62 |
|
63 DiagMatrix sigma; |
|
64 ComplexMatrix left_sm; |
|
65 ComplexMatrix right_sm; |
|
66 }; |
|
67 |
537
|
68 inline ComplexSVD::ComplexSVD (const ComplexMatrix& a, SVD::type svd_type) |
457
|
69 { |
537
|
70 init (a, svd_type); |
457
|
71 } |
|
72 |
537
|
73 inline ComplexSVD::ComplexSVD (const ComplexMatrix& a, int& info, |
|
74 SVD::type svd_type) |
457
|
75 { |
537
|
76 info = init (a, svd_type); |
457
|
77 } |
|
78 |
|
79 inline ComplexSVD::ComplexSVD (const ComplexSVD& a) |
|
80 { |
|
81 sigma = a.sigma; |
|
82 left_sm = a.left_sm; |
|
83 right_sm = a.right_sm; |
|
84 } |
|
85 |
|
86 inline ComplexSVD& |
|
87 ComplexSVD::operator = (const ComplexSVD& a) |
|
88 { |
|
89 sigma = a.sigma; |
|
90 left_sm = a.left_sm; |
|
91 right_sm = a.right_sm; |
|
92 |
|
93 return *this; |
|
94 } |
|
95 |
|
96 inline DiagMatrix ComplexSVD::singular_values (void) const |
|
97 { |
|
98 return sigma; |
|
99 } |
|
100 |
|
101 inline ComplexMatrix ComplexSVD::left_singular_matrix (void) const |
|
102 { |
|
103 return left_sm; |
|
104 } |
|
105 |
|
106 inline ComplexMatrix ComplexSVD::right_singular_matrix (void) const |
|
107 { |
|
108 return right_sm; |
|
109 } |
|
110 |
|
111 #endif |
|
112 |
|
113 /* |
|
114 ;;; Local Variables: *** |
|
115 ;;; mode: C++ *** |
|
116 ;;; page-delimiter: "^/\\*" *** |
|
117 ;;; End: *** |
|
118 */ |