MVE - Multi-View Environment mve-devel
|
Math internals. More...
Functions | |
template<typename T > | |
int | find_largest_ev_index (T const *values, int length) |
Returns the index of the largest eigenvalue. | |
template<typename T > | |
void | matrix_2x2_eigenvalues (T const *mat, T *smaller_ev, T *larger_ev) |
Returns the larger eigenvalue of the given 2x2 matrix. | |
template<typename T > | |
void | matrix_apply_givens_column (T *mat, int rows, int cols, int givens_i, int givens_k, T const &givens_c, T const &givens_s) |
Applies a Givens rotation for columns (givens_i, givens_k) by only rotating the required set of columns in-place. | |
template<typename T > | |
void | matrix_apply_givens_row (T *mat, int, int cols, int givens_i, int givens_k, T const &givens_c, T const &givens_s) |
Applies a transposed Givens rotation for rows (givens_i, givens_k) by only rotating the required set of rows in-place. | |
template<typename T > | |
void | matrix_apply_householder_matrix (T *mat_a, int rows, int cols, T const *house_mat, int house_length, int offset_rows, int offset_cols) |
Applies a given householder matrix to a frame in a given matrix with offset (offset_rows, offset_cols). | |
template<typename T > | |
void | matrix_bidiagonalize (T const *mat_a, int rows, int cols, T *mat_u, T *mat_b, T *mat_v, T const &epsilon) |
Bidiagonalizes a given MxN matrix, resulting in a MxN matrix U, a bidiagonal MxN matrix B and a NxN matrix V. | |
template<typename T > | |
void | matrix_givens_rotation (T const &alpha, T const &beta, T *givens_c, T *givens_s, T const &epsilon) |
Calculates the Givens rotation coefficients c and s by solving [alpha beta] [c s;-c s] = [sqrt(alpha^2+beta^2) 0]. | |
template<typename T > | |
void | matrix_gk_svd (T const *mat_a, int rows, int cols, T *mat_u, T *vec_s, T *mat_v, T const &epsilon) |
Implementation of the [GK-SVD] method. | |
template<typename T > | |
void | matrix_gk_svd_step (int rows, int cols, T *mat_b, T *mat_q, T *mat_p, int p, int q, T const &epsilon) |
Single step in the [GK-SVD] method. | |
template<typename T > | |
void | matrix_householder_matrix (T const *vector, int length, T const beta, T *matrix) |
Given a Householder vector and beta coefficient, this function creates a transformation matrix to apply the Householder Transformation by simple matrix multiplication. | |
template<typename T > | |
void | matrix_householder_vector (T const *input, int length, T *vector, T *beta, T const &epsilon, T const &norm_factor) |
Creates a householder transformation vector and the coefficient for householder matrix creation. | |
template<typename T > | |
bool | matrix_is_submatrix_zero_enclosed (T const *mat, int m, int k, T const &epsilon) |
Checks whether the lower-right square sub-matrix of size KxK is enclosed by zeros (up to some epsilon) within a square matrix of size MxM. | |
template<typename T > | |
bool | matrix_is_superdiagonal_nonzero (T const *mat, int rows, int cols, T const &epsilon) |
Checks whether the super-diagonal (above the diagonal) of a MxN matrix does not contain zeros up to some epsilon. | |
template<typename T > | |
void | matrix_r_svd (T const *mat_a, int rows, int cols, T *mat_u, T *vec_s, T *mat_v, T const &epsilon) |
Implementation of the [R-SVD] method, uses [GK-SVD] as solver for the reduced problem. | |
template<typename T > | |
void | matrix_svd_clear_super_entry (int rows, int cols, T *mat_b, T *mat_q, int row_index, T const &epsilon) |
Math internals.
int math::internal::find_largest_ev_index | ( | T const * | values, |
int | length | ||
) |
Returns the index of the largest eigenvalue.
If all eigenvalues are zero, -1 is returned.
Definition at line 677 of file matrix_svd.h.
void math::internal::matrix_2x2_eigenvalues | ( | T const * | mat, |
T * | smaller_ev, | ||
T * | larger_ev | ||
) |
Returns the larger eigenvalue of the given 2x2 matrix.
The eigenvalues of the matrix are assumed to be non-complex and a negative root set to zero.
Definition at line 127 of file matrix_svd.h.
void math::internal::matrix_apply_givens_column | ( | T * | mat, |
int | rows, | ||
int | cols, | ||
int | givens_i, | ||
int | givens_k, | ||
T const & | givens_c, | ||
T const & | givens_s | ||
) |
Applies a Givens rotation for columns (givens_i, givens_k) by only rotating the required set of columns in-place.
Definition at line 86 of file matrix_qr.h.
void math::internal::matrix_apply_givens_row | ( | T * | mat, |
int | , | ||
int | cols, | ||
int | givens_i, | ||
int | givens_k, | ||
T const & | givens_c, | ||
T const & | givens_s | ||
) |
Applies a transposed Givens rotation for rows (givens_i, givens_k) by only rotating the required set of rows in-place.
Definition at line 104 of file matrix_qr.h.
void math::internal::matrix_apply_householder_matrix | ( | T * | mat_a, |
int | rows, | ||
int | cols, | ||
T const * | house_mat, | ||
int | house_length, | ||
int | offset_rows, | ||
int | offset_cols | ||
) |
Applies a given householder matrix to a frame in a given matrix with offset (offset_rows, offset_cols).
Definition at line 210 of file matrix_svd.h.
void math::internal::matrix_bidiagonalize | ( | T const * | mat_a, |
int | rows, | ||
int | cols, | ||
T * | mat_u, | ||
T * | mat_b, | ||
T * | mat_v, | ||
T const & | epsilon | ||
) |
Bidiagonalizes a given MxN matrix, resulting in a MxN matrix U, a bidiagonal MxN matrix B and a NxN matrix V.
Reference: "Matrix Computations" by Golub and Loan, 3rd edition, from page 252 (algorithm 5.4.2).
Definition at line 250 of file matrix_svd.h.
void math::internal::matrix_givens_rotation | ( | T const & | alpha, |
T const & | beta, | ||
T * | givens_c, | ||
T * | givens_s, | ||
T const & | epsilon | ||
) |
Calculates the Givens rotation coefficients c and s by solving [alpha beta] [c s;-c s] = [sqrt(alpha^2+beta^2) 0].
Definition at line 56 of file matrix_qr.h.
void math::internal::matrix_gk_svd | ( | T const * | mat_a, |
int | rows, | ||
int | cols, | ||
T * | mat_u, | ||
T * | vec_s, | ||
T * | mat_v, | ||
T const & | epsilon | ||
) |
Implementation of the [GK-SVD] method.
Definition at line 488 of file matrix_svd.h.
void math::internal::matrix_gk_svd_step | ( | int | rows, |
int | cols, | ||
T * | mat_b, | ||
T * | mat_q, | ||
T * | mat_p, | ||
int | p, | ||
int | q, | ||
T const & | epsilon | ||
) |
Single step in the [GK-SVD] method.
Definition at line 392 of file matrix_svd.h.
void math::internal::matrix_householder_matrix | ( | T const * | vector, |
int | length, | ||
T const | beta, | ||
T * | matrix | ||
) |
Given a Householder vector and beta coefficient, this function creates a transformation matrix to apply the Householder Transformation by simple matrix multiplication.
Definition at line 186 of file matrix_svd.h.
void math::internal::matrix_householder_vector | ( | T const * | input, |
int | length, | ||
T * | vector, | ||
T * | beta, | ||
T const & | epsilon, | ||
T const & | norm_factor | ||
) |
Creates a householder transformation vector and the coefficient for householder matrix creation.
As input, the function uses a column-frame in a given matrix, i.e. mat(subset_row_start:subset_row_end, subset_col).
Definition at line 149 of file matrix_svd.h.
bool math::internal::matrix_is_submatrix_zero_enclosed | ( | T const * | mat, |
int | m, | ||
int | k, | ||
T const & | epsilon | ||
) |
Checks whether the lower-right square sub-matrix of size KxK is enclosed by zeros (up to some epsilon) within a square matrix of size MxM.
This check is SVD specific and probably not very useful for other code. Note: K must be smaller than or equal to M.
Definition at line 93 of file matrix_svd.h.
bool math::internal::matrix_is_superdiagonal_nonzero | ( | T const * | mat, |
int | rows, | ||
int | cols, | ||
T const & | epsilon | ||
) |
Checks whether the super-diagonal (above the diagonal) of a MxN matrix does not contain zeros up to some epsilon.
Definition at line 111 of file matrix_svd.h.
void math::internal::matrix_r_svd | ( | T const * | mat_a, |
int | rows, | ||
int | cols, | ||
T * | mat_u, | ||
T * | vec_s, | ||
T * | mat_v, | ||
T const & | epsilon | ||
) |
Implementation of the [R-SVD] method, uses [GK-SVD] as solver for the reduced problem.
Definition at line 651 of file matrix_svd.h.
void math::internal::matrix_svd_clear_super_entry | ( | int | rows, |
int | cols, | ||
T * | mat_b, | ||
T * | mat_q, | ||
int | row_index, | ||
T const & | epsilon | ||
) |
Definition at line 459 of file matrix_svd.h.