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" |
|
35 |
|
36 extern "C++" { |
|
37 |
|
38 class ComplexSVD |
|
39 { |
|
40 friend class ComplexMatrix; |
|
41 |
|
42 public: |
|
43 |
|
44 ComplexSVD (void) {} |
|
45 |
|
46 ComplexSVD (const ComplexMatrix& a); |
|
47 ComplexSVD (const ComplexMatrix& a, int& info); |
|
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 |
|
61 int init (const ComplexMatrix& a); |
|
62 |
|
63 DiagMatrix sigma; |
|
64 ComplexMatrix left_sm; |
|
65 ComplexMatrix right_sm; |
|
66 }; |
|
67 |
|
68 inline ComplexSVD::ComplexSVD (const ComplexMatrix& a) |
|
69 { |
|
70 init (a); |
|
71 } |
|
72 |
|
73 inline ComplexSVD::ComplexSVD (const ComplexMatrix& a, int& info) |
|
74 { |
|
75 info = init (a); |
|
76 } |
|
77 |
|
78 inline ComplexSVD::ComplexSVD (const ComplexSVD& a) |
|
79 { |
|
80 sigma = a.sigma; |
|
81 left_sm = a.left_sm; |
|
82 right_sm = a.right_sm; |
|
83 } |
|
84 |
|
85 inline ComplexSVD& |
|
86 ComplexSVD::operator = (const ComplexSVD& a) |
|
87 { |
|
88 sigma = a.sigma; |
|
89 left_sm = a.left_sm; |
|
90 right_sm = a.right_sm; |
|
91 |
|
92 return *this; |
|
93 } |
|
94 |
|
95 inline DiagMatrix ComplexSVD::singular_values (void) const |
|
96 { |
|
97 return sigma; |
|
98 } |
|
99 |
|
100 inline ComplexMatrix ComplexSVD::left_singular_matrix (void) const |
|
101 { |
|
102 return left_sm; |
|
103 } |
|
104 |
|
105 inline ComplexMatrix ComplexSVD::right_singular_matrix (void) const |
|
106 { |
|
107 return right_sm; |
|
108 } |
|
109 |
|
110 } // extern "C++" |
|
111 |
|
112 #endif |
|
113 |
|
114 /* |
|
115 ;;; Local Variables: *** |
|
116 ;;; mode: C++ *** |
|
117 ;;; page-delimiter: "^/\\*" *** |
|
118 ;;; End: *** |
|
119 */ |