SyTen
syten::Krylov::ClassicImpl::Classic< Matrix, Vector, Solver, Ortho > Struct Template Reference

The ClassicKrylov struct encapsulates the Lanczos algorithm. Template Parameters are: More...

#include <classic_krylov.h>

+ Collaboration diagram for syten::Krylov::ClassicImpl::Classic< Matrix, Vector, Solver, Ortho >:

Public Types

using Matrix_type = Matrix
 The template-supplied matrix type. More...
 
using Vector_type = Vector
 The template-supplied vector type. More...
 

Public Member Functions

 Classic ()=default
 the default constructor More...
 
template<typename Matrix_ , typename Vector_ , template< typename > class Solver_, template< typename > class GetMat_>
 Classic (Classic< Matrix_, Vector_, Solver_, GetMat_ > &&other)
 move constructor More...
 
template<typename Matrix_ , typename Vector_ , template< typename > class Solver_, template< typename > class GetMat_>
 Classic (Classic< Matrix_, Vector_, Solver_, GetMat_ > const &other)
 copy constructor More...
 
 Classic (Matrix mat_)
 constructor for non-assignable/-default-constructible Matrix types (like references) More...
 
template<typename... Pars>
IterativeExit operator() (IterativeConfig const &conf, Pars &&...pars)
 operator() resume the lanczos algorithm More...
 
template<typename... Pars>
IterativeExit operator() (Vector v, IterativeConfig const &conf, Pars &&...pars)
 operator() implements the Lanczos algorithm; discards all previous data More...
 
template<typename Matrix_ , typename Vector_ , template< typename > class Solver_, template< typename > class GetMat_>
Classicoperator= (Classic< Matrix_, Vector_, Solver_, GetMat_ > &&rhs)
 move assignment. steals all data, but not solver and ortho More...
 
template<typename Matrix_ , typename Vector_ , template< typename > class Solver_, template< typename > class GetMat_>
Classicoperator= (Classic< Matrix_, Vector_, Solver_, GetMat_ > const &rhs)
 copy assignment. copies all data, but not solver and ortho More...
 
template<typename... Pars>
void solve (IterativeConfig &conf, IterativeExit &r, Pars &&...pars)
 Simplified interface to solve() More...
 

Public Attributes

std::vector< SRDefa
 the diagonal in the Hamiltonian matrix in the krylov space More...
 
std::vector< SRDefb
 the off-diagonal in the Hamiltonian matrix in the krylov space (apart from first entry, which is the initial norm) More...
 
std::vector< Vector > krylov
 the vectors spanning the krylov space More...
 
Matrix mat
 the matrix to 'solve' More...
 
Ortho< Classicortho
 possible implementation of reorthonormalization or other side-effects More...
 
Solver< Classicsolver
 the solver, eg exponential- or eigen-solver More...
 
Vector vec
 a helper vector More...
 

Protected Member Functions

void lanczosPart1 ()
 lanczosPart1 does the orthonormalization of H|f> wrt the previous Lanczos vectors More...
 
void lanczosPart2 ()
 lanczosPart2 updates the data structures More...
 

Detailed Description

template<typename Matrix, typename Vector, template< typename > class Solver, template< typename > class Ortho = NoOrthoMat>
struct syten::Krylov::ClassicImpl::Classic< Matrix, Vector, Solver, Ortho >

The ClassicKrylov struct encapsulates the Lanczos algorithm. Template Parameters are:

Template Parameters
Matrix,thetype of matrix we wish to solve. implicit interface:
  • operator ()(Vector) -> Vector
Vector,thetype Matrix operates on. implicit interface:
  • usable with std containers (ie. default/copy/move constructible etc.)
  • operator *(Vector, Vector) -> complex<double> (inner product)
  • operator +=(Vector) -> Vector&
  • operator *=(complex<double> -> Vector&
Solver,atemplate taking the type of Vector. implicit interface:
  • operator ()(std::pair<DenseTensor<2, MatrixScalar>, Vectors> &&, SRDef, Pars...) -> SRDef, where Vectors is a functor which can compute the inner product of 'some kind of vector' with the Lanczos Vectors ie Vectors(Vector_) -> Vector
Ortho,atemplate taking ClassicKrylov<...> as parameter. implicit interface:
  • operator () -> SRDef which orthonormalises vec to the previous krylov vectors (in krylov) and returns the norm of the new vector
  • mat(ClassicKrylov<...>) -> std::pair<DenseTensor<2, MatrixScalar>, Vectors>, which is used as first parameter of Solver<...>::operator()

The documentation for this struct was generated from the following file: