Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
OpenFOAM
matrices
scalarMatrices
SVD
SVD.H
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration |
5
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
License
9
This file is part of OpenFOAM.
10
11
OpenFOAM is free software: you can redistribute it and/or modify it
12
under the terms of the GNU General Public License as published by
13
the Free Software Foundation, either version 3 of the License, or
14
(at your option) any later version.
15
16
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19
for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23
24
Class
25
Foam::SVD
26
27
Description
28
Singular value decomposition of a rectangular matrix.
29
30
SourceFiles
31
SVDI.H
32
SVD.C
33
34
\*---------------------------------------------------------------------------*/
35
36
#ifndef SVD_H
37
#define SVD_H
38
39
#include <
OpenFOAM/scalarMatrices.H
>
40
41
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43
namespace
Foam
44
{
45
46
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48
49
/*---------------------------------------------------------------------------*\
50
Class SVD Declaration
51
\*---------------------------------------------------------------------------*/
52
53
class
SVD
54
{
55
// Private data
56
57
//- Rectangular matrix with the same dimensions as the input
58
scalarRectangularMatrix
U_;
59
60
//- square matrix V
61
scalarRectangularMatrix
V_;
62
63
//- The singular values
64
DiagonalMatrix<scalar>
S_;
65
66
//- The matrix product V S^(-1) U^T
67
scalarRectangularMatrix
VSinvUt_;
68
69
//- The number of zero singular values
70
label nZeros_;
71
72
73
// Private Member Functions
74
75
//- Disallow default bitwise copy construct
76
SVD
(
const
SVD
&);
77
78
//- Disallow default bitwise assignment
79
void
operator=(
const
SVD
&);
80
81
template
<
class
T>
82
inline
const
T
sign(
const
T
& a,
const
T
&
b
);
83
84
85
public
:
86
87
// Constructors
88
89
//- Construct from a rectangular Matrix
90
SVD
(
const
scalarRectangularMatrix
&
A
,
const
scalar minCondition = 0);
91
92
93
// Access functions
94
95
//- Return U
96
inline
const
scalarRectangularMatrix
&
U
()
const
;
97
98
//- Return the square matrix V
99
inline
const
scalarRectangularMatrix
&
V
()
const
;
100
101
//- Return the singular values
102
inline
const
scalarDiagonalMatrix
&
S
()
const
;
103
104
//- Return VSinvUt (the pseudo inverse)
105
inline
const
scalarRectangularMatrix
&
VSinvUt
()
const
;
106
107
//- Return the number of zero singular values
108
inline
label
nZeros
()
const
;
109
110
//- Return the minimum non-zero singular value
111
inline
scalar
minNonZeroS
()
const
;
112
};
113
114
115
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116
117
}
// End namespace Foam
118
119
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120
121
#include "
SVDI.H
"
122
123
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124
125
#endif
126
127
// ************************ vim: set sw=4 sts=4 et: ************************ //