|
TBCI Numerical high perf. C++ Library
2.8.0
|
#include "tbci/matrix.h"
Go to the source code of this file.
Macros | |
| #define | SVDFLOAT typename MatrixType::value_type |
| svd_solver.h More... | |
| #define | SVDREAL(x) (x) |
Functions | |
| template<typename ARG > | |
| double | sv_decomp_pythag (ARG a, ARG b) |
| Calculate sqrt (a^2 + b^2) avoiding under/overflows. More... | |
| template<typename MatrixType , typename VectorType > | |
| void | sv_decomp (MatrixType &A, MatrixType &V, VectorType &W) |
| Singular Value Decomposition Decomposes matrix A into U * diag(W) * V^T A is overwritten with U. More... | |
| template<typename MatrixType , typename VectorType > | |
| void | sv_decomp_backsub (const MatrixType &U, const MatrixType &V, const VectorType &W, const VectorType &b, VectorType &x) |
| template<typename VectorType > | |
| static int | fix_condition (VectorType &vec, const double cndno=1e-12) |
| template<typename MatrixType , typename VectorType > | |
| VectorType | svd_solve (const MatrixType &mat, const VectorType &b, const double cndno=1e-12) |
| The interface to use the SVD solver: Solve the equation mat * x = b. More... | |
| template<typename MatrixType , typename T > | |
| TVector< T > | sv_decomp_backsub (const MatrixType &U, const MatrixType &V, const Vector< T > &W, const Vector< T > &b) |
| template<typename MatrixType , typename T > | |
| TVector< T > | svd_solve (const MatrixType &mat, const Vector< T > &b, const double cndno=1e-12) |
| The interface to use the SVD solver: Solve the equation mat * x = b. More... | |
| #define SVDFLOAT typename MatrixType::value_type |
svd_solver.h
Singular Value Decomposition matrix solver implementation by Bart Hartgers bart@etpmod.phys.tue.nl, 2001-09-05 inspired by Numerical Recipes, ch. 2.6 Ported to TBCI by Kurt Garloff kurt@garloff.de, 2001-09-06
Definition at line 18 of file svd_solver.h.
Referenced by sv_decomp(), and sv_decomp_backsub().
Definition at line 26 of file svd_solver.h.
Referenced by sv_decomp().
|
static |
Definition at line 296 of file svd_solver.h.
References std::fabs(), i, MATH__, and MAX.
Referenced by svd_solve().
| void sv_decomp | ( | MatrixType & | A, |
| MatrixType & | V, | ||
| VectorType & | W | ||
| ) |
Singular Value Decomposition Decomposes matrix A into U * diag(W) * V^T A is overwritten with U.
Definition at line 53 of file svd_solver.h.
References c, std::fabs(), h, i, MATH__, MAX, MIN, std::sqrt(), STD__, sv_decomp_pythag(), SVDFLOAT, SVDREAL, x, y, and z.
| void sv_decomp_backsub | ( | const MatrixType & | U, |
| const MatrixType & | V, | ||
| const VectorType & | W, | ||
| const VectorType & | b, | ||
| VectorType & | x | ||
| ) |
Definition at line 268 of file svd_solver.h.
References i, SVDFLOAT, and U.
Referenced by svd_solve().
| TVector<T> sv_decomp_backsub | ( | const MatrixType & | U, |
| const MatrixType & | V, | ||
| const Vector< T > & | W, | ||
| const Vector< T > & | b | ||
| ) |
Definition at line 341 of file svd_solver.h.
References i, TVector< T >::set(), TVector< T >::size(), SVDFLOAT, U, and x.
|
inline |
Calculate sqrt (a^2 + b^2) avoiding under/overflows.
Definition at line 31 of file svd_solver.h.
References std::fabs(), MATH__, and std::sqrt().
Referenced by sv_decomp().
| VectorType svd_solve | ( | const MatrixType & | mat, |
| const VectorType & | b, | ||
| const double | cndno = 1e-12 |
||
| ) |
The interface to use the SVD solver: Solve the equation mat * x = b.
Input mat, b: Return value x Optimized version returning a TVector below. cndno is the maximum allowable condition numbers. Singular values below maxSV * cndno are set to zero.
Definition at line 324 of file svd_solver.h.
References fix_condition(), MatrixType, sv_decomp_backsub(), and x.
| TVector<T> svd_solve | ( | const MatrixType & | mat, |
| const Vector< T > & | b, | ||
| const double | cndno = 1e-12 |
||
| ) |
The interface to use the SVD solver: Solve the equation mat * x = b.
Input mat, b: Return value x Optimized version returning a TVector. cndno is the maximum allowable condition numbers. Singular values below maxSV * cndno are set to zero.
Note that we don't change the mat, unlike in LU solver, as we can't store the complete result of the decomposition in it anyway.
Definition at line 379 of file svd_solver.h.
References fix_condition(), MatrixType, and sv_decomp_backsub().
1.8.5