Class xlifepp::MatOrthoManager#

template<class ScalarType, class MV, class OP>
class MatOrthoManager : public xlifepp::OrthoManager<ScalarType, MV>#

Inheritence diagram for xlifepp::MatOrthoManager:

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

Collaboration diagram for xlifepp::MatOrthoManager:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "11" [label="CheckingPolicy< StoragePolicy< T >::StoredType >" tooltip="CheckingPolicy< StoragePolicy< T >::StoredType >"] "6" [label="CheckingPolicy< StoragePolicy< const OP >::StoredType >" tooltip="CheckingPolicy< StoragePolicy< const OP >::StoredType >"] "7" [label="ConversionPolicy" tooltip="ConversionPolicy"] "10" [label="OwnershipPolicy< StoragePolicy< T >::InitPointerType >" tooltip="OwnershipPolicy< StoragePolicy< T >::InitPointerType >"] "5" [label="OwnershipPolicy< StoragePolicy< const OP >::InitPointerType >" tooltip="OwnershipPolicy< StoragePolicy< const OP >::InitPointerType >"] "3" [label="xlifepp::SmartPtr< const OP >" tooltip="xlifepp::SmartPtr< const OP >"] "9" [label="StoragePolicy< T >" tooltip="StoragePolicy< T >"] "4" [label="StoragePolicy< const OP >" tooltip="StoragePolicy< const OP >"] "1" [label="xlifepp::MatOrthoManager< ScalarType, MV, OP >" tooltip="xlifepp::MatOrthoManager< ScalarType, MV, OP >" fillcolor="#BFBFBF"] "2" [label="xlifepp::OrthoManager< ScalarType, MV >" tooltip="xlifepp::OrthoManager< ScalarType, MV >"] "8" [label="xlifepp::SmartPtr< T, OwnershipPolicy, ConversionPolicy, CheckingPolicy, StoragePolicy, ConstnessPolicy >" tooltip="xlifepp::SmartPtr< T, OwnershipPolicy, ConversionPolicy, CheckingPolicy, StoragePolicy, ConstnessPolicy >"] "3" -> "4" [dir=forward tooltip="public-inheritance"] "3" -> "5" [dir=forward tooltip="public-inheritance"] "3" -> "6" [dir=forward tooltip="public-inheritance"] "3" -> "7" [dir=forward tooltip="public-inheritance"] "3" -> "8" [dir=forward tooltip="template-instance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "1" -> "3" [dir=forward tooltip="usage"] "8" -> "9" [dir=forward tooltip="public-inheritance"] "8" -> "10" [dir=forward tooltip="public-inheritance"] "8" -> "11" [dir=forward tooltip="public-inheritance"] "8" -> "7" [dir=forward tooltip="public-inheritance"] }

xlifepp’s templated virtual class for providing routines for orthogonalization and orthonormalization of multivectors using matrix-based inner products.

This class extends xlifepp::OrthoManager by providing extra calling arguments to orthogonalization routines, to reduce the cost of applying the inner product in cases where the user already has the image of target multivectors under the inner product matrix.

A concrete implementation of this class is necessary. The user can create their own implementation if those supplied are not suitable for their needs.

Subclassed by xlifepp::BasicOrthoManager< ScalarType, MV, OP >, xlifepp::SVQBOrthoManager< ScalarType, MV, OP >

Methods implementing xlifepp::OrthoManager

virtual void innerProd(const MV &X, const MV &Y, MatrixEigenDense<ScalarType> &Z) const#

Implements the interface OrthoManager::innerProd().

This method calls

innerProdMat(X,Y,Z);
virtual void norm(const MV &X, std::vector<typename NumTraits<ScalarType>::RealScalar> &normvec) const#

Implements the interface OrthoManager::norm().

This method calls

normMat(X,normvec);
virtual void project(MV &X, std::vector<SmartPtr<const MV>> Q, std::vector<SmartPtr<MatrixEigenDense<ScalarType>>> C) const#

Implements the interface OrthoManager::project().

This method calls

projectMat(X,Q,C);
virtual int normalize(MV &X, SmartPtr<MatrixEigenDense<ScalarType>> B = _smPtrNull) const#

Implements the interface OrthoManager::normalize().

This method calls

normalizeMat(X,B);
virtual int projectAndNormalize(MV &X, std::vector<SmartPtr<const MV>> Q, std::vector<SmartPtr<MatrixEigenDense<ScalarType>>> C, SmartPtr<MatrixEigenDense<ScalarType>> B = _smPtrNull) const#

Implements the interface OrthoManager::projectAndNormalize().

This method calls

projectAndNormalizeMat(X,Q,C,B);
virtual NumTraits<ScalarType>::RealScalar orthonormError(const MV &X) const#

Implements the interface OrthoManager::orthonormError().

This method calls

orthonormErrorMat(X);
virtual NumTraits<ScalarType>::RealScalar orthogError(const MV &X1, const MV &X2) const#

Implements the interface OrthoManager::orthogError().

This method calls

orthogErrorMat(X1,X2);

Constructor/Destructor

MatOrthoManager(SmartPtr<const OP> op = _smPtrNull)#

Default constructor.

inline virtual ~MatOrthoManager()#

Destructor.

Accessor routines

virtual void setOp(SmartPtr<const OP> op)#

Set operator used for inner product.

virtual SmartPtr<const OP> getOp() const#

Get operator used for inner product.

int getOpCounter() const#

Retrieve operator counter.

This counter returns the number of applications of the operator specifying the inner product. When the operator is applied to a multivector, the counter is incremented by the number of vectors in the multivector. If the operator is not specified, the counter is never incremented.

void resetOpCounter()#

Reset the operator counter to zero.

See getOpCounter() for more details.

Matrix-based Orthogonality Methods

void innerProdMat(const MV &X, const MV &Y, MatrixEigenDense<ScalarType> &Z, SmartPtr<const MV> MX = _smPtrNull, SmartPtr<const MV> MY = _smPtrNull) const#

Provides a matrix-based inner product.

Provides the inner product

\[ \langle x, y \rangle = x^H M y \]
Optionally allows the provision of \(M y\) and/or \(M x\). See OrthoManager::innerProd() for more details.
void normMat(const MV &X, std::vector<typename NumTraits<ScalarType>::RealScalar> &normvec, SmartPtr<const MV> MX = _smPtrNull) const#

Provides the norm induced by the matrix-based inner product.

Provides the norm:

\[ \|x\|_M = \sqrt{x^H M y} \]
Optionally allows the provision of \(M x\). See OrthoManager::norm() for more details.
virtual void projectMat(MV &X, std::vector<SmartPtr<const MV>> Q, std::vector<SmartPtr<MatrixEigenDense<ScalarType>>> C, SmartPtr<MV> MX = _smPtrNull, std::vector<SmartPtr<const MV>> MQ = std::vector<SmartPtr<const MV>>(1, _smPtrNull)) const = 0#

Provides matrix-based projection method.

This method optionally allows the provision of \(M X\) and/or the \(M Q[i]\). See OrthoManager::project() for more details.

Parameters:
  • X, Q, C – [in/out] As in OrthoManager::project()

  • MX – [in/out] If specified by the user, on input MX is required to be the image of X under the operator getOp(). On output, MX will be updated to reflect the changes in X.

  • MQ – [in] If specified by the user, on MQ[i] is required to be the image of Q[i] under the operator getOp().

virtual int normalizeMat(MV &X, SmartPtr<MatrixEigenDense<ScalarType>> B = _smPtrNull, SmartPtr<MV> MX = _smPtrNull) const = 0#

Provides matrix-based orthonormalization method.

This method optionally allows the provision of \(M X\). See orthoManager::normalize() for more details.

Parameters:
  • X, B – [in/out] As in OrthoManager::normalize()

  • MX – [in/out] If specified by the user, on input MX is required to be the image of X under the operator getOp(). On output, MX will be updated to reflect the changes in X.

Returns:

Rank of the basis computed by this method, less than or equal to the number of columns in X. This specifies how many columns in the returned X and MX and rows in the returned B are valid.

virtual int projectAndNormalizeMat(MV &X, std::vector<SmartPtr<const MV>> Q, std::vector<SmartPtr<MatrixEigenDense<ScalarType>>> C = std::vector<SmartPtr<MatrixEigenDense<ScalarType>>>(1, _smPtrNull), SmartPtr<MatrixEigenDense<ScalarType>> B = _smPtrNull, SmartPtr<MV> MX = _smPtrNull, std::vector<SmartPtr<const MV>> MQ = std::vector<SmartPtr<const MV>>(1, _smPtrNull)) const = 0#

Provides matrix-based projection/orthonormalization method.

This method optionally allows the provision of \(M X\) and/or the \(M Q[i]\). See orthoManager::projectAndNormalize() for more details.

Parameters:
  • X, Q, C, B – [in/out] As in OrthoManager::projectAndNormalize()

  • MX – [in/out] If specified by the user, on input MX is required to be the image of X under the operator getOp(). On output, MX will be updated to reflect the changes in X.

  • MQ – [in] If specified by the user, on MQ[i] is required to be the image of Q[i] under the operator getOp().

Returns:

Rank of the basis computed by this method, less than or equal to the number of columns in X. This specifies how many columns in the returned X and MX and rows in the returned B are valid.

virtual NumTraits<ScalarType>::RealScalar orthonormErrorMat(const MV &X, SmartPtr<const MV> MX = _smPtrNull) const = 0#

This method computes the error in orthonormality of a multivector.

This method optionally allows optionally exploits a caller-provided MX.

virtual NumTraits<ScalarType>::RealScalar orthogErrorMat(const MV &X, const MV &Y, SmartPtr<const MV> MX = _smPtrNull, SmartPtr<const MV> MY = _smPtrNull) const = 0#

This method computes the error in orthogonality of two multivectors.

This method optionally allows optionally exploits a caller-provided MX and/or MY.