Class template Dune::XT::LA::internal::RealQrEigenSolver

template<class FieldType, class MatrixType = DynamicMatrix < FieldType >, class VectorType = DynamicVector < FieldType >> struct RealQrEigenSolver { static constexpr size_t max_iterations = 10000 ; using M = Common :: MatrixAbstraction < MatrixType > ; using V = Common :: VectorAbstraction < VectorType > ; static void resize ( DynamicMatrix < FieldType > & mat , const size_t num_rows , const size_t num_cols , const FieldType & val ) { mat . resize ( num_rows , num_cols , val ) ; } template < int rows , int cols > static void resize ( FieldMatrix < FieldType , rows , cols > & /*mat*/ , const size_t /*num_rows*/ , const size_t /*num_cols*/ , const FieldType & /*val*/ ) { } static void calculate_eigenvalues_by_shifted_qr ( MatrixType & A , const std :: unique_ptr < MatrixType > & Q , std :: vector < double > & eigvals ) { const size_t num_rows = M :: rows ( A ) ; const size_t num_cols = M :: cols ( A ) ; const FieldType tol = 1e-15 ; thread_local auto R_k = M :: make_unique ( num_rows , num_cols , 0. ) ; thread_local auto Q_k = M :: make_unique ( num_cols , num_rows , 0. ) ; // save in column-major format for performance resize ( * R_k , num_rows , num_cols , 0. ) ; resize ( * Q_k , num_cols , num_rows , 0. ) ; for ( size_t jj = num_rows - 1 ; jj > 0 ; -- jj ) { size_t num_remaining_rows = jj + 1 ; size_t num_remaining_cols = num_remaining_rows ; FieldType residual = std :: abs ( A [ jj ] [ jj - 1 ] ) ; size_t kk = 0 ; // TODO: Choose appropiate stopping criterion while ( XT :: Common :: FloatCmp :: gt ( residual> Dune::XT::LA::internal::RealQrEigenSolver

No documentation provided.

static void Dune::XT::LA::internal::RealQrEigenSolver::resize(int &mat, const size_t num_rows, const size_t num_cols, const FieldType &val)

No documentation provided.

static void Dune::XT::LA::internal::RealQrEigenSolver::calculate_eigenvalues_by_shifted_qr(MatrixType &A, const int &Q, int &eigvals)

No documentation provided.

static void Dune::XT::LA::internal::RealQrEigenSolver::get_eigenvalues(MatrixType &A, int &ret, const int &Q = <recovery-expr>(nullptr))

No documentation provided.

static void Dune::XT::LA::internal::RealQrEigenSolver::get_eigenvectors(const MatrixType &A_triangular, const MatrixType &Q, MatrixType &ret)

No documentation provided.

static FieldType Dune::XT::LA::internal::RealQrEigenSolver::xi(FieldType val)

modified sign function returning 1 instead of 0 if the value is 0

static FieldType Dune::XT::LA::internal::RealQrEigenSolver::get_norm_x(const MatrixType &A, const size_t col_index, size_t num_rows)

No documentation provided.

static void Dune::XT::LA::internal::RealQrEigenSolver::multiply_householder_from_left(MatrixType &A, const FieldType &beta, const VectorType &v, const size_t first_row, const size_t past_last_row)

No documentation provided.

static void Dune::XT::LA::internal::RealQrEigenSolver::multiply_householder_from_right(MatrixType &A, const FieldType &beta, const VectorType &v, const size_t first_col, const size_t past_last_col)

No documentation provided.

static void Dune::XT::LA::internal::RealQrEigenSolver::multiply_householder_from_right_col_major(MatrixType &A, const FieldType &beta, const VectorType &v, const size_t first_col, const size_t past_last_col)

No documentation provided.

static void Dune::XT::LA::internal::RealQrEigenSolver::QR_decomp(const MatrixType &A, MatrixType &Q, MatrixType &R, size_t num_rows, size_t num_cols)

This is a simple QR scheme using Householder reflections. The householder matrix is written as H = I - 2 v v^T, where v = u/||u|| and u = x - s ||x|| e_1, s = ±1 has the opposite sign of u_1 and x is the current column of A. The matrix H is rewritten as H = I - tau w w^T, where w=u/u_1 and tau = -s u_1/||x||. The num_rows and num_cols parameter is used to restrict the rows and columns, the Q and R will only contain the QR decomposition of A[0:num_rows, 0:num_cols].

See also: https://en.wikipedia.org/wiki/QR_decomposition#Using_Householder_reflections., http://www.cs.cornell.edu/~bindel/class/cs6210-f09/lec18.pdf

static void Dune::XT::LA::internal::RealQrEigenSolver::hessenberg_transformation(MatrixType &A, const int &Q)

Transform A to Hessenberg form by transformation P^T A P

See also: https://lp.uni-goettingen.de/get/text/2137

const size_t Dune::XT::LA::internal::RealQrEigenSolver::max_iterations

No documentation provided.

type Dune::XT::LA::internal::RealQrEigenSolver::M

No documentation provided.

type Dune::XT::LA::internal::RealQrEigenSolver::V

No documentation provided.

template<int rows, int cols>
static void Dune::XT::LA::internal::RealQrEigenSolver::resize(FieldMatrix<FieldType, rows, cols>&, const size_t, const size_t, const FieldType&)

No documentation provided.