13 #ifndef __AnasaziTsqrOrthoManager_hpp
14 #define __AnasaziTsqrOrthoManager_hpp
16 #include "AnasaziTsqrOrthoManagerImpl.hpp"
43 template<
class Scalar,
class MV>
46 typedef Scalar scalar_type;
101 template<
class Scalar,
class MV>
108 typedef Scalar scalar_type;
117 impl_.setParameterList (params);
121 return impl_.getNonconstParameterList ();
125 return impl_.unsetParameterList ();
136 return impl_.getValidParameters();
149 return impl_.getFastParameters();
169 const std::string& label =
"Anasazi") :
170 impl_ (params, label)
185 return impl_.innerProd (X, Y, Z);
188 void norm (
const MV& X, std::vector<magnitude_type>& normVec)
const {
189 return impl_.norm (X, normVec);
198 return impl_.project (X, C, Q);
202 normalize (MV &X, mat_ptr B = Teuchos::null)
const
204 return impl_.normalize (X, B);
214 return impl_.projectAndNormalize (X, C, B, Q);
236 return impl_.normalizeOutOfPlace (X, Q, B);
266 return impl_.projectAndNormalizeOutOfPlace (X_in, X_out, C, B, Q);
270 return impl_.orthonormError (X);
274 return impl_.orthogError (X1, X2);
299 template<
class Scalar,
class MV,
class OP>
306 typedef Scalar scalar_type;
361 const std::string& label =
"Belos",
364 tsqr_ (params, label),
365 pSvqb_ (Teuchos::null)
380 pSvqb_ (Teuchos::null)
443 Teuchos::tuple (Teuchos::null))
const
453 if (! MX.is_null()) {
460 pSvqb_->projectMat (X, Q, C, MX, MQ);
466 mat_ptr B = Teuchos::null,
477 if (! MX.is_null()) {
485 return pSvqb_->normalizeMat (X, B, MX);
508 if (! MX.is_null()) {
516 return pSvqb_->projectAndNormalizeMat (X, Q, C, B, MX, MQ);
528 const int rank = pSvqb_->normalize (X, B);
550 const int rank = pSvqb_->projectAndNormalize (X_in, Q_array, C, B);
566 return pSvqb_->orthonormErrorMat (X, MX);
581 return pSvqb_->orthogErrorMat (X, Y, MX, MY);
588 ensureSvqbInit ()
const
592 if (pSvqb_.is_null()) {
604 mutable tsqr_type tsqr_;
615 #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.