28 #ifndef _nmrPInverseSolver_h
29 #define _nmrPInverseSolver_h
81 CISSTNETLIB_INTEGER
M;
82 CISSTNETLIB_INTEGER
N;
85 CISSTNETLIB_DOUBLE
EPS;
92 #ifdef CISST_COMPILER_IS_MSVC
93 #pragma warning (push)
94 #pragma warning (disable: 4996)
95 #endif // CISST_COMPILER_IS_MSVC
99 #ifdef CISST_COMPILER_IS_MSVC
100 #pragma warning (pop)
101 #endif // CISST_COMPILER_IS_MSVC
153 inline void Allocate(CISSTNETLIB_INTEGER m, CISSTNETLIB_INTEGER n,
bool storageOrder) {
168 }
while (
EPS + 1.0 != 1.0);
195 template <
class _matrixOwnerType>
197 throw (std::runtime_error) {
205 CISSTNETLIB_DOUBLE singularValue;
206 for (
int irank = 0; irank <
MinMN; irank++) {
207 if ((singularValue =
S(irank, 0)) > eps) {
208 for (
int j = 0; j <
M; j++) {
209 for (
int i = 0; i <
N; i++) {
211 +
V(i, irank)*
U(j, irank)/singularValue;
237 #ifdef CISST_COMPILER_IS_MSVC
239 #endif // CISST_COMPILER_IS_MSVC
242 #endif // _nmrPInverseSolver_h
const vctDynamicMatrix< CISSTNETLIB_DOUBLE > & GetVt(void) const
Definition: nmrSVDSolver.h:294
Declaration of vctDynamicMatrix.
Definition: vctDynamicMatrixBase.h:42
#define CISST_DEPRECATED
Definition: cmnPortability.h:310
nmrPInverseSolver(CISSTNETLIB_INTEGER m, CISSTNETLIB_INTEGER n, bool storageOrder=VCT_COL_MAJOR)
Definition: nmrPInverseSolver.h:128
CISSTNETLIB_INTEGER M
Definition: nmrPInverseSolver.h:81
const vctDynamicMatrix< CISSTNETLIB_DOUBLE > & GetU(void) const
Definition: nmrPInverseSolver.h:223
vctDynamicMatrix< CISSTNETLIB_DOUBLE > V
Definition: nmrPInverseSolver.h:88
const vctDynamicMatrix< CISSTNETLIB_DOUBLE > & GetS(void) const
Definition: nmrSVDSolver.h:288
MatrixReturnType Transpose() const
Definition: vctDynamicConstMatrixBase.h:986
const vctDynamicMatrix< CISSTNETLIB_DOUBLE > & GetPInverse(void) const
Definition: nmrPInverseSolver.h:231
void Allocate(CISSTNETLIB_INTEGER m, CISSTNETLIB_INTEGER n, bool storageOrder)
Definition: nmrSVDSolver.h:168
vctDynamicMatrix< CISSTNETLIB_DOUBLE > PInverseA
Definition: nmrPInverseSolver.h:89
const vctDynamicMatrix< CISSTNETLIB_DOUBLE > & GetS(void) const
Definition: nmrPInverseSolver.h:219
Declaration of nmrSVDSolver.
nmrSVDSolver svd
Definition: nmrPInverseSolver.h:97
const vctDynamicMatrix< CISSTNETLIB_DOUBLE > & GetV(void) const
Definition: nmrPInverseSolver.h:227
value_type SetAll(const value_type value)
Definition: vctDynamicMatrixBase.h:452
size_type rows() const
Definition: vctDynamicConstMatrixBase.h:238
size_type cols() const
Definition: vctDynamicConstMatrixBase.h:243
CISSTNETLIB_DOUBLE EPS
Definition: nmrPInverseSolver.h:85
bool IsRowMajor(void) const
Definition: vctDynamicConstMatrixBase.h:635
reference at(size_type index)
Definition: vctDynamicMatrixBase.h:171
void SetSize(size_type rows, size_type cols, bool storageOrder)
Definition: vctDynamicMatrix.h:364
CISSTNETLIB_INTEGER MinMN
Definition: nmrPInverseSolver.h:84
Definition: nmrPInverseSolver.h:75
CISSTNETLIB_INTEGER MaxMN
Definition: nmrPInverseSolver.h:83
ThisType & Assign(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &other)
Definition: vctDynamicMatrixBase.h:509
void Solve(vctDynamicMatrixBase< _matrixOwnerType, CISSTNETLIB_DOUBLE > &A)
Definition: nmrSVDSolver.h:232
bool StorageOrder
Definition: nmrPInverseSolver.h:90
vctDynamicMatrix< CISSTNETLIB_DOUBLE > U
Definition: nmrPInverseSolver.h:87
const vctDynamicMatrix< CISSTNETLIB_DOUBLE > & GetU(void) const
Definition: nmrSVDSolver.h:291
nmrPInverseSolver(void)
Definition: nmrPInverseSolver.h:109
const bool VCT_COL_MAJOR
Definition: vctForwardDeclarations.h:46
void Solve(vctDynamicMatrixBase< _matrixOwnerType, CISSTNETLIB_DOUBLE > &A)
Definition: nmrPInverseSolver.h:196
Definition: nmrSVDSolver.h:87
CISSTNETLIB_INTEGER N
Definition: nmrPInverseSolver.h:82
void Allocate(const vctDynamicMatrix< CISSTNETLIB_DOUBLE > &A)
Definition: nmrPInverseSolver.h:178
void Allocate(CISSTNETLIB_INTEGER m, CISSTNETLIB_INTEGER n, bool storageOrder)
Definition: nmrPInverseSolver.h:153
vctDynamicMatrix< CISSTNETLIB_DOUBLE > S
Definition: nmrPInverseSolver.h:86
nmrPInverseSolver(const vctDynamicMatrix< CISSTNETLIB_DOUBLE > &A)
Definition: nmrPInverseSolver.h:139