A symmetric matrix represented in eigenvalue decomposition. More...
#include <vpdt_eigen_sym_matrix.h>
Public Types | |
typedef vpdt_field_default< T, n >::type | vector |
the data type used for vectors. | |
typedef vpdt_field_traits < vector >::matrix_type | matrix |
the data type used for matrices. | |
Public Member Functions | |
vpdt_eigen_sym_matrix (unsigned int var_dim=n) | |
Constructor. | |
vpdt_eigen_sym_matrix (const matrix &evec, const vector &eval) | |
Constructor - from eigenvectors and eigenvalues. | |
vpdt_eigen_sym_matrix (const matrix &m) | |
Constructor - from symmetric matrix. | |
unsigned int | dimension () const |
Return the dimension. | |
const matrix & | eigenvectors () const |
Access to the eigenvectors. | |
const vector & | eigenvalues () const |
Access to the eigenvalues. | |
void | set_eigenvectors (const matrix &m) |
Set the eigenvectors. | |
void | set_eigenvalues (const vector &v) |
set the eigenvalues. | |
void | set_size (unsigned int dim) |
Set the size (if variable) and reset to default. | |
void | set_matrix (const matrix &m) |
set the eigenvectors and eigen values by decomposing m. | |
vpdt_eigen_sym_matrix< T, n > & | operator*= (const T &val) |
multiply the matrix by a scalar. | |
void | form_matrix (matrix &m) const |
Reform the matrix. | |
void | form_inverse (matrix &m) const |
compute the matrix inverse. | |
void | product (const vector &x, vector &y) const |
evaluate y = M * x. | |
void | inverse_product (const vector &x, vector &y) const |
evaluate y = M^-1 * x. | |
T | quad_form (const vector &x) const |
evaluate the Quadratic form x^t * M * x. | |
T | inverse_quad_form (const vector &x) const |
evaluate the inverse Quadratic form x^t * M^-1 * x. | |
T | determinant () const |
compute the determinant. | |
Private Member Functions | |
bool | are_evec_orthonormal () const |
return true if the eigenvectors are (approximately) orthonormal. | |
Private Attributes | |
matrix | eigen_vec_ |
the matrix of eigenvectors. | |
vector | eigen_val_ |
the vector of eigenvalues. |
A symmetric matrix represented in eigenvalue decomposition.
Definition at line 37 of file vpdt_eigen_sym_matrix.h.
typedef vpdt_field_traits<vector>::matrix_type vpdt_eigen_sym_matrix< T, n >::matrix |
the data type used for matrices.
Definition at line 43 of file vpdt_eigen_sym_matrix.h.
typedef vpdt_field_default<T,n>::type vpdt_eigen_sym_matrix< T, n >::vector |
the data type used for vectors.
Definition at line 41 of file vpdt_eigen_sym_matrix.h.
vpdt_eigen_sym_matrix< T, n >::vpdt_eigen_sym_matrix | ( | unsigned int | var_dim = n | ) | [inline] |
Constructor.
Optionally initialize the dimension for when n==0. Otherwise var_dim is ignored
Definition at line 48 of file vpdt_eigen_sym_matrix.h.
vpdt_eigen_sym_matrix< T, n >::vpdt_eigen_sym_matrix | ( | const matrix & | evec, |
const vector & | eval | ||
) | [inline] |
Constructor - from eigenvectors and eigenvalues.
Definition at line 57 of file vpdt_eigen_sym_matrix.h.
vpdt_eigen_sym_matrix< T, n >::vpdt_eigen_sym_matrix | ( | const matrix & | m | ) | [inline] |
Constructor - from symmetric matrix.
Definition at line 64 of file vpdt_eigen_sym_matrix.h.
bool vpdt_eigen_sym_matrix< T, n >::are_evec_orthonormal | ( | ) | const [inline, private] |
return true if the eigenvectors are (approximately) orthonormal.
Definition at line 245 of file vpdt_eigen_sym_matrix.h.
T vpdt_eigen_sym_matrix< T, n >::determinant | ( | ) | const [inline] |
compute the determinant.
Definition at line 229 of file vpdt_eigen_sym_matrix.h.
unsigned int vpdt_eigen_sym_matrix< T, n >::dimension | ( | ) | const [inline] |
Return the dimension.
Definition at line 70 of file vpdt_eigen_sym_matrix.h.
const vector& vpdt_eigen_sym_matrix< T, n >::eigenvalues | ( | ) | const [inline] |
Access to the eigenvalues.
Definition at line 76 of file vpdt_eigen_sym_matrix.h.
const matrix& vpdt_eigen_sym_matrix< T, n >::eigenvectors | ( | ) | const [inline] |
Access to the eigenvectors.
Definition at line 73 of file vpdt_eigen_sym_matrix.h.
void vpdt_eigen_sym_matrix< T, n >::form_inverse | ( | matrix & | m | ) | const [inline] |
compute the matrix inverse.
m = eigen_vec_ * inverse(diag(eigen_val_)) * eigen_vec_.transpose()
Definition at line 138 of file vpdt_eigen_sym_matrix.h.
void vpdt_eigen_sym_matrix< T, n >::form_matrix | ( | matrix & | m | ) | const [inline] |
Reform the matrix.
m = eigen_vec_ * diag(eigen_val_) * eigen_vec_.transpose()
Definition at line 117 of file vpdt_eigen_sym_matrix.h.
void vpdt_eigen_sym_matrix< T, n >::inverse_product | ( | const vector & | x, |
vector & | y | ||
) | const [inline] |
evaluate y = M^-1 * x.
Definition at line 179 of file vpdt_eigen_sym_matrix.h.
T vpdt_eigen_sym_matrix< T, n >::inverse_quad_form | ( | const vector & | x | ) | const [inline] |
evaluate the inverse Quadratic form x^t * M^-1 * x.
Definition at line 212 of file vpdt_eigen_sym_matrix.h.
vpdt_eigen_sym_matrix<T,n>& vpdt_eigen_sym_matrix< T, n >::operator*= | ( | const T & | val | ) | [inline] |
multiply the matrix by a scalar.
Definition at line 107 of file vpdt_eigen_sym_matrix.h.
void vpdt_eigen_sym_matrix< T, n >::product | ( | const vector & | x, |
vector & | y | ||
) | const [inline] |
evaluate y = M * x.
Definition at line 161 of file vpdt_eigen_sym_matrix.h.
T vpdt_eigen_sym_matrix< T, n >::quad_form | ( | const vector & | x | ) | const [inline] |
evaluate the Quadratic form x^t * M * x.
Definition at line 197 of file vpdt_eigen_sym_matrix.h.
void vpdt_eigen_sym_matrix< T, n >::set_eigenvalues | ( | const vector & | v | ) | [inline] |
set the eigenvalues.
Definition at line 86 of file vpdt_eigen_sym_matrix.h.
void vpdt_eigen_sym_matrix< T, n >::set_eigenvectors | ( | const matrix & | m | ) | [inline] |
Set the eigenvectors.
Definition at line 79 of file vpdt_eigen_sym_matrix.h.
void vpdt_eigen_sym_matrix< T, n >::set_matrix | ( | const matrix & | m | ) | [inline] |
set the eigenvectors and eigen values by decomposing m.
Definition at line 98 of file vpdt_eigen_sym_matrix.h.
void vpdt_eigen_sym_matrix< T, n >::set_size | ( | unsigned int | dim | ) | [inline] |
Set the size (if variable) and reset to default.
Definition at line 89 of file vpdt_eigen_sym_matrix.h.
vector vpdt_eigen_sym_matrix< T, n >::eigen_val_ [private] |
the vector of eigenvalues.
Definition at line 242 of file vpdt_eigen_sym_matrix.h.
matrix vpdt_eigen_sym_matrix< T, n >::eigen_vec_ [private] |
the matrix of eigenvectors.
Definition at line 240 of file vpdt_eigen_sym_matrix.h.