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