45 #ifndef __AnasaziTsqrOrthoManager_hpp
46 #define __AnasaziTsqrOrthoManager_hpp
48 #include "AnasaziTsqrOrthoManagerImpl.hpp"
75 template<
class Scalar,
class MV>
78 typedef Scalar scalar_type;
133 template<
class Scalar,
class MV>
140 typedef Scalar scalar_type;
149 impl_.setParameterList (params);
153 return impl_.getNonconstParameterList ();
157 return impl_.unsetParameterList ();
168 return impl_.getValidParameters();
181 return impl_.getFastParameters();
201 const std::string& label =
"Anasazi") :
202 impl_ (params, label)
217 return impl_.innerProd (X, Y, Z);
220 void norm (
const MV& X, std::vector<magnitude_type>& normVec)
const {
221 return impl_.norm (X, normVec);
230 return impl_.project (X, C, Q);
234 normalize (MV &X, mat_ptr B = Teuchos::null)
const
236 return impl_.normalize (X, B);
246 return impl_.projectAndNormalize (X, C, B, Q);
268 return impl_.normalizeOutOfPlace (X, Q, B);
298 return impl_.projectAndNormalizeOutOfPlace (X_in, X_out, C, B, Q);
302 return impl_.orthonormError (X);
306 return impl_.orthogError (X1, X2);
331 template<
class Scalar,
class MV,
class OP>
338 typedef Scalar scalar_type;
393 const std::string& label =
"Belos",
396 tsqr_ (params, label),
397 pSvqb_ (Teuchos::null)
412 pSvqb_ (Teuchos::null)
475 Teuchos::tuple (Teuchos::null))
const
485 if (! MX.is_null()) {
492 pSvqb_->projectMat (X, Q, C, MX, MQ);
498 mat_ptr B = Teuchos::null,
509 if (! MX.is_null()) {
517 return pSvqb_->normalizeMat (X, B, MX);
540 if (! MX.is_null()) {
548 return pSvqb_->projectAndNormalizeMat (X, Q, C, B, MX, MQ);
560 const int rank = pSvqb_->normalize (X, B);
582 const int rank = pSvqb_->projectAndNormalize (X_in, Q_array, C, B);
598 return pSvqb_->orthonormErrorMat (X, MX);
613 return pSvqb_->orthogErrorMat (X, Y, MX, MY);
620 ensureSvqbInit ()
const
624 if (pSvqb_.is_null()) {
636 mutable tsqr_type tsqr_;
647 #endif // __AnasaziTsqrOrthoManager_hpp
magnitude_type orthonormError(const MV &X) const
This method computes the error in orthonormality of a multivector.
MatOrthoManager subclass using TSQR or SVQB.
bool is_null(const boost::shared_ptr< T > &p)
void projectMat(MV &X, Teuchos::Array< Teuchos::RCP< const MV > > Q, Teuchos::Array< Teuchos::RCP< mat_type > > C=Teuchos::tuple(Teuchos::RCP< mat_type >(Teuchos::null)), Teuchos::RCP< MV > MX=Teuchos::null, Teuchos::Array< Teuchos::RCP< const MV > > MQ=Teuchos::tuple(Teuchos::null)) const
Provides matrix-based projection method.
TSQR-based OrthoManager subclass implementation.
MV multivector_type
Multivector type with which this class was specialized.
virtual void setOp(Teuchos::RCP< const OP > Op)
Set operator used for inner product.
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters()
Get "fast" parameters for TsqrMatOrthoManager.
int projectAndNormalizeOutOfPlace(MV &X_in, MV &X_out, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
Project and normalize X_in into X_out.
Mixin for out-of-place orthogonalization.
int projectAndNormalize(MV &X, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q)
Project X against Q and normalize X.
TsqrMatOrthoManager(const std::string &label="Belos", Teuchos::RCP< const OP > Op=Teuchos::null)
Constructor (that sets default parameters).
magnitude_type orthogErrorMat(const MV &X, const MV &Y, Teuchos::RCP< const MV > MX=Teuchos::null, Teuchos::RCP< const MV > MY=Teuchos::null) const
This method computes the error in orthogonality of two multivectors.
MV multivector_type
Multivector type with which this class was specialized.
virtual ~TsqrMatOrthoManager()
Destructor (declared virtual for memory safety of derived classes).
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Default valid parameter list.
TsqrMatOrthoManager(const Teuchos::RCP< Teuchos::ParameterList > ¶ms, const std::string &label="Belos", Teuchos::RCP< const OP > Op=Teuchos::null)
Constructor (that sets user-specified parameters).
An implementation of the Anasazi::MatOrthoManager that performs orthogonalization using the SVQB iter...
static void Assign(const MV &A, MV &mv)
mv := A
magnitude_type orthonormError(const MV &X) const
Return .
virtual int normalizeOutOfPlace(MV &X, MV &Q, mat_ptr B) const =0
Normalize X into Q*B.
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Set parameters from the given parameter list.
int normalizeOutOfPlace(MV &X, MV &Q, mat_ptr B) const
Normalize X into Q*B, overwriting X with invalid values.
virtual ~OutOfPlaceNormalizerMixin()
Trivial virtual destructor, to silence compiler warnings.
int normalizeOutOfPlace(MV &X, MV &Q, mat_ptr B) const
Normalize X into Q*B.
virtual Teuchos::RCP< const OP > getOp() const
Get operator used for inner product.
int projectAndNormalizeOutOfPlace(MV &X_in, MV &X_out, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
Project and normalize X_in into X_out; overwrite X_in.
Anasazi's templated virtual class for providing routines for orthogonalization and orthonormalization...
magnitude_type orthonormErrorMat(const MV &X, Teuchos::RCP< const MV > MX=Teuchos::null) const
This method computes the error in orthonormality of a multivector.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
int projectAndNormalizeMat(MV &X, Teuchos::Array< Teuchos::RCP< const MV > > Q, Teuchos::Array< Teuchos::RCP< mat_type > > C=Teuchos::tuple(Teuchos::RCP< mat_type >(Teuchos::null)), Teuchos::RCP< mat_type > B=Teuchos::null, Teuchos::RCP< MV > MX=Teuchos::null, Teuchos::Array< Teuchos::RCP< const MV > > MQ=Teuchos::tuple(Teuchos::RCP< const MV >(Teuchos::null))) const
Provides matrix-based projection/orthonormalization method.
Traits class which defines basic operations on multivectors.
Teuchos::RCP< const OP > getOp() const
Get operator used for inner product.
magnitude_type orthogError(const MV &X1, const MV &X2) const
This method computes the error in orthogonality of two multivectors.
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters()
Get "fast" parameters for TsqrOrthoManagerImpl.
void project(MV &X, Teuchos::Array< mat_ptr > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q)
Compute and .
void innerProd(const MV &X, const MV &Y, mat_type &Z) const
Provides the inner product defining the orthogonality concepts.
Orthogonalization manager based on the SVQB technique described in "A Block Orthogonalization Procedu...
int projectAndNormalizeOutOfPlace(MV &X_in, MV &X_out, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q)
Project and normalize X_in into X_out; overwrite X_in.
int normalizeOutOfPlace(MV &X, MV &Q, mat_ptr B)
Normalize X into Q*B, overwriting X.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Default valid parameter list.
TsqrOrthoManager(const Teuchos::RCP< Teuchos::ParameterList > ¶ms, const std::string &label="Anasazi")
Constructor (that sets user-specified parameters).
TSQR-based OrthoManager subclass.
virtual ~TsqrOrthoManager()
Destructor, declared virtual for safe inheritance.
TsqrOrthoManager(const std::string &label)
Constructor (that sets default parameters).
magnitude_type orthogError(const MV &X1, const MV &X2) const
Return the Frobenius norm of the inner product of X1 with itself.
OP operator_type
Operator type with which this class was specialized.
Anasazi's templated virtual class for providing routines for orthogonalization and orthonormalization...
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Get default parameters for TsqrMatOrthoManager.
int projectAndNormalize(MV &X, Teuchos::Array< Teuchos::RCP< const MV > > Q, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > > > C=Teuchos::tuple(Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > >(Teuchos::null)), Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > > B=Teuchos::null) const
Given a set of bases Q[i] and a multivector X, this method computes an orthonormal basis for ...
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters() const
Get "fast" parameters for TsqrOrthoManager.
int normalize(MV &X, mat_ptr B)
Orthogonalize the columns of X in place.
virtual void setOp(Teuchos::RCP< const OP > Op)
Set operator used for inner product.
void project(MV &X, Teuchos::Array< Teuchos::RCP< const MV > > Q, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > > > C=Teuchos::tuple(Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > >(Teuchos::null))) const
Given a list of mutually orthogonal and internally orthonormal bases Q, this method projects a multiv...
virtual int projectAndNormalizeOutOfPlace(MV &X_in, MV &X_out, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const =0
Project and normalize X_in into X_out.