Mercurial > hg > octave-lyh
comparison liboctave/floatSVD.h @ 7789:82be108cc558
First attempt at single precision tyeps
* * *
corrections to qrupdate single precision routines
* * *
prefer demotion to single over promotion to double
* * *
Add single precision support to log2 function
* * *
Trivial PROJECT file update
* * *
Cache optimized hermitian/transpose methods
* * *
Add tests for tranpose/hermitian and ChangeLog entry for new transpose code
author | David Bateman <dbateman@free.fr> |
---|---|
date | Sun, 27 Apr 2008 22:34:17 +0200 |
parents | |
children | eb63fbe60fab |
comparison
equal
deleted
inserted
replaced
7788:45f5faba05a2 | 7789:82be108cc558 |
---|---|
1 /* | |
2 | |
3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2003, 2004, 2005, | |
4 2006, 2007 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 3 of the License, or (at your | |
11 option) any 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, see | |
20 <http://www.gnu.org/licenses/>. | |
21 | |
22 */ | |
23 | |
24 #if !defined (octave_FloatSVD_h) | |
25 #define octave_FloatSVD_h 1 | |
26 | |
27 #include <iostream> | |
28 | |
29 #include "fDiagMatrix.h" | |
30 #include "fMatrix.h" | |
31 #include "dbleSVD.h" | |
32 | |
33 class | |
34 OCTAVE_API | |
35 FloatSVD | |
36 { | |
37 public: | |
38 | |
39 FloatSVD (void) : sigma (), left_sm (), right_sm () { } | |
40 | |
41 FloatSVD (const FloatMatrix& a, SVD::type svd_type = SVD::std) { init (a, svd_type); } | |
42 | |
43 FloatSVD (const FloatMatrix& a, octave_idx_type& info, SVD::type svd_type = SVD::std) | |
44 { | |
45 info = init (a, svd_type); | |
46 } | |
47 | |
48 FloatSVD (const FloatSVD& a) | |
49 : type_computed (a.type_computed), | |
50 sigma (a.sigma), left_sm (a.left_sm), right_sm (a.right_sm) { } | |
51 | |
52 FloatSVD& operator = (const FloatSVD& a) | |
53 { | |
54 if (this != &a) | |
55 { | |
56 type_computed = a.type_computed; | |
57 sigma = a.sigma; | |
58 left_sm = a.left_sm; | |
59 right_sm = a.right_sm; | |
60 } | |
61 | |
62 return *this; | |
63 } | |
64 | |
65 ~FloatSVD (void) { } | |
66 | |
67 FloatDiagMatrix singular_values (void) const { return sigma; } | |
68 | |
69 FloatMatrix left_singular_matrix (void) const; | |
70 | |
71 FloatMatrix right_singular_matrix (void) const; | |
72 | |
73 friend std::ostream& operator << (std::ostream& os, const FloatSVD& a); | |
74 | |
75 private: | |
76 | |
77 SVD::type type_computed; | |
78 | |
79 FloatDiagMatrix sigma; | |
80 FloatMatrix left_sm; | |
81 FloatMatrix right_sm; | |
82 | |
83 octave_idx_type init (const FloatMatrix& a, SVD::type svd_type = SVD::std); | |
84 }; | |
85 | |
86 #endif | |
87 | |
88 /* | |
89 ;;; Local Variables: *** | |
90 ;;; mode: C++ *** | |
91 ;;; End: *** | |
92 */ |