Class xlifepp::EigenSolver#

template<class ScalarType, class MV, class OP>
class EigenSolver#

Inheritence diagram for xlifepp::EigenSolver:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "2" [label="xlifepp::BlockDavidson< ScalarType, MV, OP >" tooltip="xlifepp::BlockDavidson< ScalarType, MV, OP >"] "3" [label="xlifepp::BlockKrylovSchur< ScalarType, MV, OP >" tooltip="xlifepp::BlockKrylovSchur< ScalarType, MV, OP >"] "1" [label="xlifepp::EigenSolver< ScalarType, MV, OP >" tooltip="xlifepp::EigenSolver< ScalarType, MV, OP >" fillcolor="#BFBFBF"] "2" -> "1" [dir=forward tooltip="public-inheritance"] "3" -> "1" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for xlifepp::EigenSolver:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "1" [label="xlifepp::EigenSolver< ScalarType, MV, OP >" tooltip="xlifepp::EigenSolver< ScalarType, MV, OP >" fillcolor="#BFBFBF"] }

The EigenSolver is a templated virtual base class that defines the basic interface that any eigensolver will support.

This interface is mainly concerned with providing a set of eigensolver status method that can be requested from any eigensolver by an StatusTest object.

Subclassed by xlifepp::BlockDavidson< ScalarType, MV, OP >, xlifepp::BlockKrylovSchur< ScalarType, MV, OP >

Constructors/Destructor

inline EigenSolver()#

Default Constructor.

EigenSolver(const SmartPtr<EigenProblem<ScalarType, MV, OP>> &problem, const SmartPtr<SortManager<ScalarType>> &sorter, const SmartPtr<OutputManager<ScalarType>> &printer, const SmartPtr<StatusTest<ScalarType, MV, OP>> &tester, const SmartPtr<OrthoManager<ScalarType, MV>> &ortho, Parameters &params)#

Basic Constructor.

This constructor, implemented by all xlifepp eigensolvers, takes an xlifepp::EigenProblem, xlifepp::SortManager, xlifepp::OutputManager, and Parameters as input. These four arguments are sufficient enough for constructing any xlifepp::EigenSolver object.

inline virtual ~EigenSolver()#

Destructor.

Solver methods

virtual void iterate() = 0#

This method performs eigensolvers iterations until the status test indicates the need to stop or an error occurs (in which case, an exception is thrown).

virtual void initialize() = 0#

Initialize the solver with the initial vectors from the eigenproblem or random data.

Status methods

virtual int getNumIters() const = 0#

Get the current iteration count.

virtual void resetNumIters() = 0#

Reset the iteration count.

virtual SmartPtr<const MV> getRitzVectors() = 0#

Get the Ritz vectors from the previous iteration.

These are indexed using getRitzIndex().

For a description of the indexing scheme, see getRitzIndex().

virtual std::vector<ValueEigenSolver<ScalarType>> getRitzValues() = 0#

Get the Ritz values from the previous iteration.

virtual std::vector<int> getRitzIndex() = 0#

Get the index used for indexing the compressed storage used for Ritz vectors for real, non-Hermitian problems.

index has length numVecs, where each entry is 0, +1, or -1. These have the following interpretation:

  • index[i] == 0: signifies that the corresponding eigenvector is stored as the i column of Evecs. This will usually be the case when ScalarType is complex, an eigenproblem is Hermitian, or a real, non-Hermitian eigenproblem has a real eigenvector.

  • index[i] == +1: signifies that the corresponding eigenvector is stored in two vectors: the real part in the i column of Evecs and the imaginary part in the i+1 column of Evecs.

  • index[i] == -1: signifies that the corresponding eigenvector is stored in two vectors: the real part in the i-1 column of Evecs and the imaginary part in the i column of Evecs

virtual std::vector<typename NumTraits<ScalarType>::RealScalar> getResNorms() = 0#

Get the current residual norms.

Returns:

A vector of length blockSize containing the norms of the residuals, according to the orthogonalization manager norm() method.

virtual std::vector<typename NumTraits<ScalarType>::RealScalar> getRes2Norms() = 0#

Get the current residual 2-norms.

Returns:

A vector of length blockSize containing the 2-norms of the residuals.

virtual std::vector<typename NumTraits<ScalarType>::RealScalar> getRitzRes2Norms() = 0#

Get the 2-norms of the Ritz residuals.

Returns:

A vector of length blockSize containing the 2-norms of the Ritz residuals.

virtual int getCurSubspaceDim() const = 0#

Get the dimension of the search subspace used to generate the current eigenvectors and eigenvalues.

virtual int getMaxSubspaceDim() const = 0#

Get the maximum dimension allocated for the search subspace.

Accessor methods

virtual void setStatusTest(SmartPtr<StatusTest<ScalarType, MV, OP>> test) = 0#

Set a new StatusTest for the solver.

virtual SmartPtr<StatusTest<ScalarType, MV, OP>> getStatusTest() const = 0#

Get the current StatusTest used by the solver.

virtual const EigenProblem<ScalarType, MV, OP> &getProblem() const = 0#

Get a constant reference to the eigenvalue problem.

virtual int getBlockSize() const = 0#

Get the blocksize to be used by the iterative solver in solving this eigenproblem.

virtual void setBlockSize(int blockSize) = 0#

Set the blocksize to be used by the iterative solver in solving this eigenproblem.

virtual void setAuxVecs(const std::vector<SmartPtr<const MV>> &auxvecs) = 0#

Set the auxiliary vectors for the solver.

virtual std::vector<SmartPtr<const MV>> getAuxVecs() const = 0#

Get the auxiliary vectors for the solver.

virtual bool isInitialized() const = 0#

States whether the solver has been initialized or not.

Output methods

virtual void currentStatus(std::ostream &os) = 0#

This method requests that the solver print out its current status to screen.