2 #ifndef vnl_svd_fixed_h_ 3 #define vnl_svd_fixed_h_ 16 #include <vnl/algo/vnl_algo_export.h> 18 # include <vcl_msvc_warnings.h> 35 template <
class T,
unsigned int R,
unsigned int C>
82 T
U(
int i,
int j)
const {
return U_(i,j); }
103 T
V(
int i,
int j)
const {
return V_(i,j); }
122 void solve (T
const *rhs, T *lhs)
const;
170 template <
class T,
unsigned int R,
unsigned int C>
177 template <
class T,
unsigned int R,
unsigned int C>
180 #endif // vnl_svd_fixed_h_ vnl_diag_matrix_fixed< singval_t, C > & Winverse()
T V(int i, int j) const
Return the matrix V's (i,j)th entry (to avoid svd.V()(i,j); ).
vnl_numeric_traits< T >::abs_t singval_t
The singular values of a matrix of complex<T> are of type T, not complex<T>.
int singularities() const
vnl_matrix< T > solve(vnl_matrix< T > const &B) const
Solve the matrix equation M X = B, returning X.
singval_t determinant_magnitude() const
Calculate determinant as product of diagonals in W.
Templated zero/one/precision.
vnl_matrix_fixed< T, C, R > pinverse(unsigned int rank=~0u) const
pseudo-inverse (for non-square matrix) of desired rank.
T U(int i, int j) const
Return the matrix U's (i,j)th entry (to avoid svd.U()(i,j); ).
vnl_matrix_fixed< T, R, C > & U()
Return the matrix U.
vnl_diag_matrix_fixed< singval_t, C > const & Winverse() const
void solve_preinverted(vnl_vector_fixed< T, R > const &rhs, vnl_vector_fixed< T, C > *out) const
Solve the matrix-vector system M x = y.
singval_t well_condition() const
vnl_matrix_fixed< T, C, C > V_
vnl_svd_fixed< T, R, C > & operator=(vnl_svd_fixed< T, R, C > const &)
vnl_matrix_fixed< T, C, R > vnl_svd_fixed_inverse(vnl_matrix_fixed< T, R, C > const &m)
vnl_matrix_fixed< T, R, C > recompose(unsigned int rank=~0u) const
Recompose SVD to U*W*V', using desired rank.
vnl_matrix_fixed< T, C, C > & V()
Return the matrix V.
std::ostream & operator<<(std::ostream &s, vnl_decnum const &r)
decimal output.
singval_t sigma_min() const
vnl_vector_fixed< T, C > nullvector() const
Return the rightmost column of V.
vnl_diag_matrix_fixed< singval_t, C > & W()
Get at DiagMatrix (q.v.) of singular values, sorted from largest to smallest.
singval_t & W(int i, int j)
vnl_diag_matrix_fixed< singval_t, C > W_
void zero_out_relative(double tol=1e-8)
find weights below tol*max(w) and zero them out.
unsigned int rows() const
Return the number of rows.
vnl_matrix< T > left_nullspace() const
Return N such that M' * N = 0.
unsigned int rank() const
An ordinary mathematical matrix.
vnl_diag_matrix_fixed< singval_t, C > const & W() const
Get at DiagMatrix (q.v.) of singular values, sorted from largest to smallest.
vnl_matrix_fixed< T, R, C > tinverse(unsigned int rank=~0u) const
Calculate inverse of transpose, using desired rank.
vnl_diag_matrix_fixed< singval_t, C > Winverse_
Fixed length stack-stored, space-efficient vector.
vnl_matrix_fixed< T, C, R > inverse() const
singval_t sigma_max() const
Fixed length stack-stored vector.
vnl_matrix_fixed< T, R, C > const & U() const
Return the matrix U.
void zero_out_absolute(double tol=1e-8)
find weights below threshold tol, zero them out, and update W_ and Winverse_.
Holds the singular value decomposition of a vnl_matrix_fixed.
vnl_vector_fixed< T, R > left_nullvector() const
Return the rightmost column of U.
vnl_matrix< T > nullspace() const
Return N such that M * N = 0.
vnl_svd_fixed(vnl_matrix_fixed< T, R, C > const &M, double zero_out_tol=0.0)
Construct a vnl_svd_fixed<T> object from matrix .
vnl_matrix_fixed< T, C, C > const & V() const
Return the matrix V.
vnl_matrix_fixed< T, R, C > U_
Contains class for diagonal matrices.