45 #ifndef __BelosTsqrOrthoManager_hpp
46 #define __BelosTsqrOrthoManager_hpp
78 template<
class Scalar,
class MV>
136 template<
class Scalar,
class MV>
151 impl_.setParameterList (params);
155 return impl_.getNonconstParameterList ();
159 return impl_.unsetParameterList ();
170 return impl_.getValidParameters();
183 return impl_.getFastParameters();
202 const std::string& label =
"Belos") :
203 impl_ (params, label)
241 impl_.setReorthogonalizationCallback (callback);
245 return impl_.innerProd (X, Y, Z);
248 void norm (
const MV& X, std::vector<magnitude_type>& normVec)
const {
249 return impl_.norm (X, normVec);
257 return impl_.project (X, C, Q);
263 return impl_.normalize (X, B);
273 return impl_.projectAndNormalize (X, C, B, Q);
296 return impl_.normalizeOutOfPlace (X, Q, B);
326 return impl_.projectAndNormalizeOutOfPlace (X_in, X_out, C, B, Q);
330 return impl_.orthonormError (X);
334 return impl_.orthogError (X1, X2);
345 impl_.setLabel (label);
376 template<
class Scalar,
class MV,
class OP>
437 const std::string& label =
"Belos",
440 tsqr_ (params, label),
528 pDgks_->project (X, MX, C, Q);
552 return pDgks_->normalize (X, MX, B);
583 return pDgks_->projectAndNormalize (X, MX, C, B, Q);
596 const int rank =
pDgks_->normalize (X, B);
616 const int rank =
pDgks_->projectAndNormalize (X_in, null, C, B, Q);
629 return pDgks_->orthonormError (X, MX);
651 return pDgks_->orthogError (X1, MX1, X2);
662 if (!
pDgks_.is_null ()) {
698 #endif // __BelosTsqrOrthoManager_hpp
Teuchos::RCP< mat_type > mat_ptr
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.
TsqrOrthoManagerImpl< Scalar, MV > tsqr_type
Implementation of TSQR-based orthogonalization.
void project(MV &X, Teuchos::RCP< MV > MX, Teuchos::Array< mat_ptr > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
std::string label_
Label for timers (if timers are enabled at compile time).
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.
Teuchos::RCP< mat_type > mat_ptr
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
Interface of callback invoked by TsqrOrthoManager on reorthogonalization.
virtual ~TsqrMatOrthoManager()
Destructor (declared virtual for memory safety of derived classes).
bool is_null(const boost::shared_ptr< T > &p)
virtual int projectAndNormalizeWithMxImpl(MV &X, Teuchos::RCP< MV > MX, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
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.
void project(MV &X, Teuchos::Array< mat_ptr > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q)
Compute and .
magnitude_type orthogError(const MV &X1, const MV &X2) const
Return the Frobenius norm of the inner product of X1 with itself.
void norm(const MV &X, std::vector< magnitude_type > &normVec) const
void project(MV &X, Teuchos::Array< mat_ptr > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
Mixin for out-of-place orthogonalization.
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters()
Get "fast" parameters for TsqrMatOrthoManager.
Teuchos::RCP< dgks_type > pDgks_
DGKS orthogonalization manager.
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Set parameters from the given parameter list.
const std::string & getLabel() const
This method returns the label being used by the timers in the orthogonalization manager.
Teuchos::ScalarTraits< Scalar >::magnitudeType magnitude_type
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters()
Get "fast" parameters for TsqrOrthoManagerImpl.
TSQR-based OrthoManager subclass implementation.
virtual ~OutOfPlaceNormalizerMixin()
Trivial virtual destructor, to silence compiler warnings.
int normalize(MV &X, mat_ptr B)
Orthogonalize the columns of X in place.
int normalize(MV &X, mat_ptr B) const
magnitude_type orthonormError(const MV &X, Teuchos::RCP< const MV > MX) const
This method computes the error in orthonormality of a multivector. The method has the option of explo...
OP operator_type
Operator type with which this class was specialized.
void setLabel(const std::string &label)
Set the label for timers.
Teuchos::RCP< mat_type > mat_ptr
void setLabel(const std::string &label)
Set the label for (the timers for) this orthogonalization manager, and create new timers if the label...
const std::string & getLabel() const
This method returns the label being used by the timers in the orthogonalization manager.
Teuchos::SerialDenseMatrix< int, Scalar > mat_type
static void Assign(const MV &A, MV &mv)
mv := A
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Default valid parameter list.
Traits class which defines basic operations on multivectors.
TsqrOrthoManager(const std::string &label)
Constructor (that sets default parameters).
int normalize(MV &X, Teuchos::RCP< MV > MX, mat_ptr B) const
Belos's templated virtual class for providing routines for orthogonalization and orthonormzalition of...
int normalizeOutOfPlace(MV &X, MV &Q, mat_ptr B) const
Normalize X into Q*B, overwriting X with invalid values.
Classical Gram-Schmidt (with DGKS correction) implementation of the Belos::OrthoManager class...
Teuchos::ScalarTraits< Scalar >::magnitudeType magnitude_type
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
TsqrOrthoManagerImpl< Scalar, MV > impl_
The implementation of TSQR.
void innerProd(const MV &X, const MV &Y, mat_type &Z) const
Provides the inner product defining the orthogonality concepts.
void setOp(Teuchos::RCP< const OP > Op)
bool is_null(const RCP< T > &p)
void setReorthogonalizationCallback(const Teuchos::RCP< ReorthogonalizationCallback< Scalar > > &callback)
Set callback to be invoked on reorthogonalization.
virtual int normalizeOutOfPlace(MV &X, MV &Q, mat_ptr B) const =0
Normalize X into Q*B.
magnitude_type orthonormError(const MV &X) const
This method computes the error in orthonormality of a multivector.
const std::string & getLabel() const
Get the label for timers (if timers are enabled).
magnitude_type orthonormError(const MV &X) const
Return .
tsqr_type tsqr_
TSQR + BGS orthogonalization manager implementation.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Get default parameters for TsqrMatOrthoManager.
Teuchos::ScalarTraits< Scalar >::magnitudeType magnitude_type
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.
int normalizeOutOfPlace(MV &X, MV &Q, mat_ptr B) const
Normalize X into Q*B.
virtual ~TsqrOrthoManager()
Destructor, declared virtual for safe inheritance.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Default valid parameter list.
void ensureDgksInit() const
Ensure that the DGKSOrthoManager instance is initialized.
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
int normalize(MV &X, mat_ptr B) const
MV multivector_type
Multivector type with which this class was specialized.
Teuchos::SerialDenseMatrix< int, Scalar > mat_type
virtual int projectAndNormalizeImpl(MV &X, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
MV multivector_type
Multivector type with which this class was specialized.
MatOrthoManager< Scalar, MV, OP > base_type
This will be used to help C++ resolve getOp().
void setLabel(const std::string &label)
This method sets the label used by the timers in the orthogonalization manager.
TsqrMatOrthoManager(const std::string &label="Belos", Teuchos::RCP< const OP > Op=Teuchos::null)
Constructor (that sets default parameters).
Teuchos::SerialDenseMatrix< int, Scalar > mat_type
DGKSOrthoManager< Scalar, MV, OP > dgks_type
Implementation of DGKS-based orthogonalization.
Teuchos::RCP< const OP > getOp() const
Get operator.
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).
MultiVecTraits< Scalar, MV > MVT
Traits class for the multivector type.
An implementation of the Belos::MatOrthoManager that performs orthogonalization using (potentially) m...
Orthogonalization manager back end based on Tall Skinny QR (TSQR)
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
magnitude_type orthogError(const MV &X1, const MV &X2) const
This method computes the error in orthogonality of two multivectors. This method. ...
Belos's templated virtual class for providing routines for orthogonalization and orthonormzalition of...
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.
MatOrthoManager subclass using TSQR or DGKS.
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters() const
Get "fast" parameters for TsqrOrthoManager.
Teuchos::RCP< const OP > getOp() const
void setOp(Teuchos::RCP< const OP > Op)
Set operator.
magnitude_type orthogError(const MV &X1, Teuchos::RCP< const MV > MX1, const MV &X2) const
This method computes the error in orthogonality of two multivectors. The method has the option of exp...
TsqrOrthoManager(const Teuchos::RCP< Teuchos::ParameterList > ¶ms, const std::string &label="Belos")
Constructor (that sets user-specified parameters).
void project(MV &X, Teuchos::Array< mat_ptr > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
magnitude_type orthonormError(const MV &X) const
This method computes the error in orthonormality of a multivector.
TSQR-based OrthoManager subclass.
magnitude_type orthogError(const MV &X1, const MV &X2) const
This method computes the error in orthogonality of two multivectors.