Class xlifepp::MatOrthoManager#
-
template<class ScalarType, class MV, class OP>
class MatOrthoManager : public xlifepp::OrthoManager<ScalarType, MV>#
-
Inheritence diagram for xlifepp::MatOrthoManager:
Collaboration diagram for xlifepp::MatOrthoManager:
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
-
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 ofX
under the operator getOp(). On output,MX
will be updated to reflect the changes inX
.MQ – [in] If specified by the user, on
MQ
[i] is required to be the image ofQ[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 ofX
under the operator getOp(). On output,MX
will be updated to reflect the changes inX
.
- 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 returnedX
andMX
and rows in the returnedB
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 ofX
under the operator getOp(). On output,MX
will be updated to reflect the changes inX
.MQ – [in] If specified by the user, on
MQ
[i] is required to be the image ofQ[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 returnedX
andMX
and rows in the returnedB
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/orMY
.
-
virtual void innerProd(const MV &X, const MV &Y, MatrixEigenDense<ScalarType> &Z) const#