457
|
1 // -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993, 1994 John W. Eaton |
|
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 |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_ComplexSVD_h) |
|
25 #define octave_ComplexSVD_h 1 |
|
26 |
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
|
31 class ostream; |
|
32 |
|
33 #include "dDiagMatrix.h" |
|
34 #include "CMatrix.h" |
537
|
35 #include "dbleSVD.h" |
457
|
36 |
|
37 extern "C++" { |
|
38 |
|
39 class ComplexSVD |
|
40 { |
|
41 friend class ComplexMatrix; |
|
42 |
|
43 public: |
|
44 |
|
45 ComplexSVD (void) {} |
|
46 |
537
|
47 ComplexSVD (const ComplexMatrix& a, SVD::type svd_type = SVD::std); |
|
48 ComplexSVD (const ComplexMatrix& a, int& info, |
|
49 SVD::type svd_type = SVD::std); |
457
|
50 |
|
51 ComplexSVD (const ComplexSVD& a); |
|
52 |
|
53 ComplexSVD& operator = (const ComplexSVD& a); |
|
54 |
|
55 DiagMatrix singular_values (void) const; |
|
56 ComplexMatrix left_singular_matrix (void) const; |
|
57 ComplexMatrix right_singular_matrix (void) const; |
|
58 |
|
59 friend ostream& operator << (ostream& os, const ComplexSVD& a); |
|
60 |
|
61 private: |
|
62 |
537
|
63 int init (const ComplexMatrix& a, SVD::type svd_type = SVD::std); |
457
|
64 |
|
65 DiagMatrix sigma; |
|
66 ComplexMatrix left_sm; |
|
67 ComplexMatrix right_sm; |
|
68 }; |
|
69 |
537
|
70 inline ComplexSVD::ComplexSVD (const ComplexMatrix& a, SVD::type svd_type) |
457
|
71 { |
537
|
72 init (a, svd_type); |
457
|
73 } |
|
74 |
537
|
75 inline ComplexSVD::ComplexSVD (const ComplexMatrix& a, int& info, |
|
76 SVD::type svd_type) |
457
|
77 { |
537
|
78 info = init (a, svd_type); |
457
|
79 } |
|
80 |
|
81 inline ComplexSVD::ComplexSVD (const ComplexSVD& a) |
|
82 { |
|
83 sigma = a.sigma; |
|
84 left_sm = a.left_sm; |
|
85 right_sm = a.right_sm; |
|
86 } |
|
87 |
|
88 inline ComplexSVD& |
|
89 ComplexSVD::operator = (const ComplexSVD& a) |
|
90 { |
|
91 sigma = a.sigma; |
|
92 left_sm = a.left_sm; |
|
93 right_sm = a.right_sm; |
|
94 |
|
95 return *this; |
|
96 } |
|
97 |
|
98 inline DiagMatrix ComplexSVD::singular_values (void) const |
|
99 { |
|
100 return sigma; |
|
101 } |
|
102 |
|
103 inline ComplexMatrix ComplexSVD::left_singular_matrix (void) const |
|
104 { |
|
105 return left_sm; |
|
106 } |
|
107 |
|
108 inline ComplexMatrix ComplexSVD::right_singular_matrix (void) const |
|
109 { |
|
110 return right_sm; |
|
111 } |
|
112 |
|
113 } // extern "C++" |
|
114 |
|
115 #endif |
|
116 |
|
117 /* |
|
118 ;;; Local Variables: *** |
|
119 ;;; mode: C++ *** |
|
120 ;;; page-delimiter: "^/\\*" *** |
|
121 ;;; End: *** |
|
122 */ |