15#ifndef BELOS_IMGS_ORTHOMANAGER_HPP
16#define BELOS_IMGS_ORTHOMANAGER_HPP
35#include "Teuchos_as.hpp"
36#ifdef BELOS_TEUCHOS_TIME_MONITOR
37#include "Teuchos_TimeMonitor.hpp"
43 template<
class ScalarType,
class MV,
class OP,
class DM = DefaultDenseMatrix<
int,ScalarType>>
47 template<
class ScalarType,
class MV,
class OP,
class DM = DefaultDenseMatrix<
int,ScalarType>>
50 template<
class ScalarType,
class MV,
class OP,
class DM = DefaultDenseMatrix<
int,ScalarType>>
55 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType MagnitudeType;
56 typedef typename Teuchos::ScalarTraits<MagnitudeType> MGT;
57 typedef Teuchos::ScalarTraits<ScalarType> SCT;
68 Teuchos::RCP<const OP>
Op = Teuchos::null,
78#ifdef BELOS_TEUCHOS_TIME_MONITOR
80 ss << label_ +
": IMGS[" << max_ortho_steps_ <<
"]";
82 std::string
orthoLabel =
ss.str() +
": Orthogonalization";
88 std::string
normLabel =
ss.str() +
": Ortho (Norm)";
91 std::string
ipLabel =
ss.str() +
": Ortho (Inner Product)";
98 const std::string&
label =
"Belos",
99 Teuchos::RCP<const OP>
Op = Teuchos::null) :
108#ifdef BELOS_TEUCHOS_TIME_MONITOR
109 std::stringstream
ss;
110 ss << label_ +
": IMGS[" << max_ortho_steps_ <<
"]";
112 std::string
orthoLabel =
ss.str() +
": Orthogonalization";
118 std::string
normLabel =
ss.str() +
": Ortho (Norm)";
121 std::string
ipLabel =
ss.str() +
": Ortho (Inner Product)";
135 using Teuchos::Exceptions::InvalidParameterName;
136 using Teuchos::ParameterList;
137 using Teuchos::parameterList;
142 if (
plist.is_null()) {
183 params->remove (
"depTol");
204 Teuchos::RCP<const Teuchos::ParameterList>
207 if (defaultParams_.is_null()) {
211 return defaultParams_;
265 Teuchos::Array<Teuchos::RCP<DM> > C,
266 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const;
272 Teuchos::Array<Teuchos::RCP<DM> > C,
273 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const {
304 Teuchos::RCP<DM> B)
const;
358 Teuchos::Array<Teuchos::RCP<DM>> C,
360 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const;
370 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
379 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
385 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
394 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
408 const std::string&
getLabel()
const {
return label_; }
434 int max_ortho_steps_;
436 MagnitudeType blk_tol_;
438 MagnitudeType sing_tol_;
442#ifdef BELOS_TEUCHOS_TIME_MONITOR
447 mutable Teuchos::RCP<Teuchos::ParameterList> defaultParams_;
450 int findBasis(MV &
X, Teuchos::RCP<MV>
MX,
455 bool blkOrtho1 ( MV &
X, Teuchos::RCP<MV>
MX,
456 Teuchos::Array<Teuchos::RCP<DM> > C,
457 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const;
460 bool blkOrtho ( MV &
X, Teuchos::RCP<MV>
MX,
461 Teuchos::Array<Teuchos::RCP<DM> > C,
462 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const;
477 int blkOrthoSing ( MV &
X, Teuchos::RCP<MV>
MX,
478 Teuchos::Array<Teuchos::RCP<DM> > C,
480 Teuchos::ArrayView<Teuchos::RCP<const MV> >
QQ)
const;
484 template<
class ScalarType,
class MV,
class OP,
class DM>
487 template<
class ScalarType,
class MV,
class OP,
class DM>
488 const typename IMGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType
490 = 10*Teuchos::ScalarTraits<typename IMGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType>::squareroot(
491 Teuchos::ScalarTraits<
typename IMGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType>::eps() );
493 template<
class ScalarType,
class MV,
class OP,
class DM>
494 const typename IMGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType
496 = 10*Teuchos::ScalarTraits<typename IMGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType>::eps();
498 template<
class ScalarType,
class MV,
class OP,
class DM>
501 template<
class ScalarType,
class MV,
class OP,
class DM>
502 const typename IMGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType
504 = Teuchos::ScalarTraits<typename IMGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType>::zero();
506 template<
class ScalarType,
class MV,
class OP,
class DM>
507 const typename IMGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType
509 = Teuchos::ScalarTraits<typename IMGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType>::zero();
513 template<
class ScalarType,
class MV,
class OP,
class DM>
516 if (
label != label_) {
518#ifdef BELOS_TEUCHOS_TIME_MONITOR
519 std::stringstream
ss;
520 ss << label_ +
": IMGS[" << max_ortho_steps_ <<
"]";
522 std::string
orthoLabel =
ss.str() +
": Orthogonalization";
528 std::string
normLabel =
ss.str() +
": Ortho (Norm)";
531 std::string
ipLabel =
ss.str() +
": Ortho (Inner Product)";
539 template<
class ScalarType,
class MV,
class OP,
class DM>
540 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
543 int rank = MVT::GetNumberVecs(
X);
546 DMT::SyncDeviceToHost(*
xTx);
550 DMT::SyncHostToDevice( *
xTx );
551 return DMT::NormFrobenius(*
xTx);
556 template<
class ScalarType,
class MV,
class OP,
class DM>
557 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
559 int r1 = MVT::GetNumberVecs(
X1);
560 int r2 = MVT::GetNumberVecs(
X2);
561 Teuchos::RCP<DM>
xTx = DMT::Create(
r2,
r1);
563 return DMT::NormFrobenius(*
xTx);
568 template<
class ScalarType,
class MV,
class OP,
class DM>
573 Teuchos::Array<Teuchos::RCP<DM>> C,
575 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const
577 using Teuchos::Array;
579 using Teuchos::is_null;
584#ifdef BELOS_TEUCHOS_TIME_MONITOR
589 const MagnitudeType
ZERO = MGT::zero();
592 int xc = MVT::GetNumberVecs(
X );
600 B = DMT::Create(
xc,
xc);
610 for (size_type
k = 0;
k <
nq; ++
k)
612 const int numRows = MVT::GetNumberVecs (*
Q[
k]);
617 else if (DMT::GetNumRows(*C[
k]) !=
numRows || DMT::GetNumCols(*C[
k]) !=
numCols)
625 if (
MX == Teuchos::null) {
627 MX = MVT::Clone(
X,MVT::GetNumberVecs(
X));
628 OPT::Apply(*(this->_Op),
X,*
MX);
633 MX = Teuchos::rcp( &
X,
false );
636 int mxc = MVT::GetNumberVecs( *
MX );
643 for (
int i=0;
i<
nq;
i++) {
644 numbas += MVT::GetNumberVecs( *
Q[
i] );
649 "Belos::IMGSOrthoManager::projectAndNormalize(): Size of X must be consistant with size of B" );
652 "Belos::IMGSOrthoManager::projectAndNormalize(): MVT returned negative dimensions for X,MX" );
655 "Belos::IMGSOrthoManager::projectAndNormalize(): Size of X must be consistant with size of MX" );
665 tmpX = MVT::CloneCopy(
X);
677 if ( B == Teuchos::null ) {
678 B = DMT::Create(
xc,
xc);
680 std::vector<ScalarType>
dot(
xc);
682#ifdef BELOS_TEUCHOS_TIME_MONITOR
685 MVT::MvDot(
X, *
MX,
dot );
698 Teuchos::RCP<DM>
B00 = DMT::Subview(*B,1,1);
713 MVT::Assign( *
tmpX,
X );
720 rank = findBasis(
X,
MX, B,
false );
728 MVT::Assign( *
tmpX,
X );
738 "Belos::IMGSOrthoManager::projectAndNormalize(): Debug error in rank variable." );
748 template<
class ScalarType,
class MV,
class OP,
class DM>
750 MV &
X, Teuchos::RCP<MV>
MX,
751 Teuchos::RCP<DM> B )
const {
753#ifdef BELOS_TEUCHOS_TIME_MONITOR
758 return findBasis(
X,
MX, B,
true);
764 template<
class ScalarType,
class MV,
class OP,
class DM>
766 MV &
X, Teuchos::RCP<MV>
MX,
767 Teuchos::Array<Teuchos::RCP<DM>> C,
768 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const {
784#ifdef BELOS_TEUCHOS_TIME_MONITOR
788 int xc = MVT::GetNumberVecs(
X );
791 std::vector<int>
qcs(
nq);
793 if (
nq == 0 ||
xc == 0 ||
xr == 0) {
805 if (
MX == Teuchos::null) {
807 MX = MVT::Clone(
X,MVT::GetNumberVecs(
X));
808 OPT::Apply(*(this->_Op),
X,*
MX);
813 MX = Teuchos::rcp( &
X,
false );
815 int mxc = MVT::GetNumberVecs( *
MX );
820 "Belos::IMGSOrthoManager::project(): MVT returned negative dimensions for X,MX" );
823 "Belos::IMGSOrthoManager::project(): Size of X not consistant with MX,Q" );
826 for (
int i=0;
i<
nq;
i++) {
828 "Belos::IMGSOrthoManager::project(): Q lengths not mutually consistant" );
829 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
831 "Belos::IMGSOrthoManager::project(): Q has less rows than columns" );
834 if ( C[
i] == Teuchos::null ) {
839 "Belos::IMGSOrthoManager::project(): Size of Q not consistant with size of C" );
844 blkOrtho(
X,
MX, C,
Q );
851 template<
class ScalarType,
class MV,
class OP,
class DM>
853 MV &
X, Teuchos::RCP<MV>
MX,
873 const MagnitudeType
ZERO = SCT::magnitude(SCT::zero());
875 int xc = MVT::GetNumberVecs(
X );
889 if (
MX == Teuchos::null) {
891 MX = MVT::Clone(
X,
xc);
892 OPT::Apply(*(this->_Op),
X,*
MX);
899 if ( B == Teuchos::null ) {
900 B = DMT::Create(
xc,
xc);
903 int mxc = (this->_hasOp) ? MVT::GetNumberVecs( *
MX ) :
xc;
908 "Belos::IMGSOrthoManager::findBasis(): X must be non-empty" );
910 "Belos::IMGSOrthoManager::findBasis(): Size of X not consistant with size of B" );
912 "Belos::IMGSOrthoManager::findBasis(): Size of X not consistant with size of MX" );
914 "Belos::IMGSOrthoManager::findBasis(): Size of X not feasible for normalization" );
916 "Belos::IMGSOrthoManager::findBasis(): Invalid howMany parameter" );
932 std::vector<int> index(1);
934 Teuchos::RCP<MV>
Xj = MVT::CloneViewNonConst(
X, index );
935 Teuchos::RCP<MV>
MXj;
936 if ((this->_hasOp)) {
938 MXj = MVT::CloneViewNonConst( *
MX, index );
952 Teuchos::RCP<DM>
P2 = DMT::Create(1,1);
960#ifdef BELOS_TEUCHOS_TIME_MONITOR
967 "Belos::IMGSOrthoManager::findBasis(): Negative definiteness discovered in inner product" );
973 prevX = MVT::CloneView(
X, index );
975 prevMX = MVT::CloneView( *
MX, index );
978 for (
int i=0;
i<max_ortho_steps_; ++
i) {
982#ifdef BELOS_TEUCHOS_TIME_MONITOR
991#ifdef BELOS_TEUCHOS_TIME_MONITOR
1002#ifdef BELOS_TEUCHOS_TIME_MONITOR
1021#ifdef BELOS_TEUCHOS_TIME_MONITOR
1035 if ( SCT::magnitude(
newDot[0]) < SCT::magnitude(sing_tol_*
oldDot[0]) ) {
1040 std::cout <<
"Belos::IMGSOrthoManager::findBasis() --> Random for column " <<
numX << std::endl;
1043 Teuchos::RCP<MV>
tempXj = MVT::Clone(
X, 1 );
1045 MVT::MvRandom( *
tempXj );
1054#ifdef BELOS_TEUCHOS_TIME_MONITOR
1064 prevX = MVT::CloneView(
X, index );
1066 prevMX = MVT::CloneView( *
MX, index );
1071#ifdef BELOS_TEUCHOS_TIME_MONITOR
1077#ifdef BELOS_TEUCHOS_TIME_MONITOR
1083#ifdef BELOS_TEUCHOS_TIME_MONITOR
1100#ifdef BELOS_TEUCHOS_TIME_MONITOR
1106 if ( SCT::magnitude(
newDot[0]) >= SCT::magnitude(
oldDot[0]*sing_tol_) ) {
1122 if ( SCT::magnitude(
newDot[0]) < SCT::magnitude(
oldDot[0]*blk_tol_) ) {
1141 Teuchos::RCP<DM>
Bjj = DMT::Subview(*B,1,1,
j,
j);
1151 Teuchos::RCP<DM>
Bcolj = DMT::Subview(*B,
numX,1,0,
j);
1162 template<
class ScalarType,
class MV,
class OP,
class DM>
1164 IMGSOrthoManager<ScalarType, MV, OP, DM>::blkOrtho1 ( MV &X, Teuchos::RCP<MV> MX,
1165 Teuchos::Array<Teuchos::RCP<DM>> C,
1166 Teuchos::ArrayView<Teuchos::RCP<const MV> > Q)
const
1169 int xc = MVT::GetNumberVecs(
X );
1172 std::vector<int>
qcs(
nq );
1173 for (
int i=0;
i<
nq;
i++) {
1174 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
1178 std::vector<int> index(1);
1179 Teuchos::RCP<const MV>
tempQ;
1181 Teuchos::Array<Teuchos::RCP<MV> >
MQ(
nq);
1183 for (
int i=0;
i<
nq;
i++) {
1189 tempQ = MVT::CloneView( *
Q[
i], index );
1190 Teuchos::RCP
tempC = DMT::Subview(*C[
i], 1, 1,
ii, 0);
1194#ifdef BELOS_TEUCHOS_TIME_MONITOR
1201#ifdef BELOS_TEUCHOS_TIME_MONITOR
1211 OPT::Apply( *(this->_Op),
X, *
MX);
1216 OPT::Apply( *(this->_Op), *
Q[
i], *
MQ[
i] );
1223 for (
int j = 1;
j < max_ortho_steps_; ++
j) {
1225 for (
int i=0;
i<
nq;
i++) {
1227 Teuchos::RCP<DM>
C2 = DMT::Create(
qcs[
i],1);
1233 tempQ = MVT::CloneView( *
Q[
i], index );
1234 Teuchos::RCP
tempC = DMT::Subview(*C[
i], 1, 1,
ii, 0);
1235 Teuchos::RCP
tempC2 = DMT::Subview(*
C2, 1, 1,
ii, 0);
1239#ifdef BELOS_TEUCHOS_TIME_MONITOR
1246#ifdef BELOS_TEUCHOS_TIME_MONITOR
1262 OPT::Apply( *(this->_Op),
X, *
MX);
1273 template<
class ScalarType,
class MV,
class OP,
class DM>
1275 IMGSOrthoManager<ScalarType, MV, OP, DM>::blkOrtho ( MV &X, Teuchos::RCP<MV> MX,
1276 Teuchos::Array<Teuchos::RCP<DM> > C,
1277 Teuchos::ArrayView<Teuchos::RCP<const MV> > Q)
const
1280 int xc = MVT::GetNumberVecs(
X );
1284 std::vector<int>
qcs(
nq );
1285 for (
int i=0;
i<
nq;
i++) {
1286 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
1292 std::vector<ScalarType>
oldDot(
xc );
1294#ifdef BELOS_TEUCHOS_TIME_MONITOR
1300 std::vector<int> index(1);
1301 Teuchos::Array<Teuchos::RCP<MV> >
MQ(
nq);
1302 Teuchos::RCP<const MV>
tempQ;
1305 for (
int i=0;
i<
nq;
i++) {
1311 tempQ = MVT::CloneView( *
Q[
i], index );
1312 Teuchos::RCP
tempC = DMT::Subview(*C[
i], 1,
xc,
ii, 0);
1316#ifdef BELOS_TEUCHOS_TIME_MONITOR
1323#ifdef BELOS_TEUCHOS_TIME_MONITOR
1333 OPT::Apply( *(this->_Op),
X, *
MX);
1338 OPT::Apply( *(this->_Op), *
Q[
i], *
MQ[
i] );
1345 for (
int j = 1;
j < max_ortho_steps_; ++
j) {
1347 for (
int i=0;
i<
nq;
i++) {
1348 Teuchos::RCP
C2 = DMT::Create(
qcs[
i],
xc);
1354 tempQ = MVT::CloneView( *
Q[
i], index );
1355 Teuchos::RCP
tempC = DMT::Subview(*C[
i], 1,
xc,
ii, 0);
1360#ifdef BELOS_TEUCHOS_TIME_MONITOR
1367#ifdef BELOS_TEUCHOS_TIME_MONITOR
1382 OPT::Apply( *(this->_Op),
X, *
MX);
1389 std::vector<ScalarType>
newDot(
xc);
1391#ifdef BELOS_TEUCHOS_TIME_MONITOR
1398 for (
int i=0;
i<
xc;
i++){
1399 if (SCT::magnitude(
newDot[
i]) < SCT::magnitude(
oldDot[
i] * blk_tol_)) {
1408 template<
class ScalarType,
class MV,
class OP,
class DM>
1410 IMGSOrthoManager<ScalarType, MV, OP, DM>::blkOrthoSing ( MV &X, Teuchos::RCP<MV> MX,
1411 Teuchos::Array<Teuchos::RCP<DM> > C,
1413 Teuchos::ArrayView<Teuchos::RCP<const MV> > QQ)
const
1415 Teuchos::Array<Teuchos::RCP<const MV> >
Q (
QQ);
1421 int xc = MVT::GetNumberVecs(
X );
1422 std::vector<int>
indX( 1 );
1425 std::vector<int>
qcs(
nq );
1426 for (
int i=0;
i<
nq;
i++) {
1427 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
1431 Teuchos::RCP<const MV>
lastQ;
1432 Teuchos::RCP<MV>
Xj,
MXj;
1435 for (
int j=0;
j<
xc;
j++) {
1441 std::vector<int> index(
j );
1445 lastQ = MVT::CloneView(
X, index );
1450 qcs.push_back( MVT::GetNumberVecs( *
lastQ ) );
1455 Xj = MVT::CloneViewNonConst(
X,
indX );
1457 MXj = MVT::CloneViewNonConst( *
MX,
indX );
1465#ifdef BELOS_TEUCHOS_TIME_MONITOR
1471 Teuchos::Array<Teuchos::RCP<MV> >
MQ(
Q.size());
1472 Teuchos::RCP<const MV>
tempQ;
1475 for (
int i=0;
i<
Q.size();
i++) {
1483 Teuchos::RCP
tempC = DMT::Subview(*C[
i], 1, 1,
ii,
j);
1495 OPT::Apply( *(this->_Op), *
Xj, *
MXj);
1500 OPT::Apply( *(this->_Op), *
Q[
i], *
MQ[
i] );
1501 Teuchos::RCP
tempC = DMT::Subview(*C[
i],
qcs[
i], 1, 0,
j);
1510 for (
int i=0;
i<
Q.size();
i++) {
1511 Teuchos::RCP<DM>
C2 = DMT::Create(
qcs[
i],1);
1519 Teuchos::RCP
tempC2 = DMT::Subview(*
C2, 1, 1,
ii);
1527 Teuchos::RCP
tempC = DMT::Subview(*C[
i],
qcs[
i], 1, 0,
j);
1538 OPT::Apply( *(this->_Op), *
Xj, *
MXj);
1547#ifdef BELOS_TEUCHOS_TIME_MONITOR
1554 if (SCT::magnitude(
newDot[0]) < SCT::magnitude(
oldDot[0]*sing_tol_)) {
1568 Teuchos::RCP<DM>
Bjj = DMT::Subview(*B,1,1,
j,
j);
1573 Teuchos::RCP<MV>
tempXj = MVT::Clone(
X, 1 );
1575 MVT::MvRandom( *
tempXj );
1584#ifdef BELOS_TEUCHOS_TIME_MONITOR
1592 for (
int i=0;
i<
Q.size();
i++) {
1593 Teuchos::RCP<DM>
product = DMT::Create(
qcs[
i], 1);
1624#ifdef BELOS_TEUCHOS_TIME_MONITOR
1631 if ( SCT::magnitude(
newDot[0]) >= SCT::magnitude(
oldDot[0]*sing_tol_) ) {
1635 Teuchos::RCP<DM>
Bjj = DMT::Subview(*B,1,1,
j,
j);
1661 template<
class ScalarType,
class MV,
class OP,
class DM>
1664 using Teuchos::ParameterList;
1665 using Teuchos::parameterList;
1673 "Maximum number of orthogonalization passes (includes the "
1674 "first). Default is 2, since \"twice is enough\" for Krylov "
1677 "Block reorthogonalization threshold.");
1679 "Singular block detection threshold.");
1684 template<
class ScalarType,
class MV,
class OP,
class DM>
1687 using Teuchos::ParameterList;
1692 params->set (
"maxNumOrthogPasses",
Belos header file which uses auto-configuration information to include necessary C++ headers.
Full specialization of Belos::DenseMatTraits for Kokkos::DualView with arbitrary scalarType....
Templated virtual class for providing orthogonalization/orthonormalization methods with matrix-based ...
Declaration of basic traits for the multivector type.
Class which defines basic traits for the operator type.
Full specialization of Belos::DenseMatTraits for Teuchos::SerialDenseMatrix with ordinal type int and...
An implementation of the Belos::MatOrthoManager that performs orthogonalization using multiple steps ...
virtual int projectAndNormalizeWithMxImpl(MV &X, Teuchos::RCP< MV > MX, Teuchos::Array< Teuchos::RCP< DM > > C, Teuchos::RCP< DM > B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
Given a set of bases Q[i] and a multivector X, this method computes an orthonormal basis for .
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
MagnitudeType getSingTol() const
Return parameter for singular block detection.
MagnitudeType getBlkTol() const
Return parameter for block re-orthogonalization threshhold.
static const int max_ortho_steps_default_
Max number of (re)orthogonalization steps, including the first (default).
Teuchos::ScalarTraits< ScalarType >::magnitudeType orthonormError(const MV &X) const
This method computes the error in orthonormality of a multivector, measured as the Frobenius norm of ...
~IMGSOrthoManager()
Destructor.
static const int max_ortho_steps_fast_
Max number of (re)orthogonalization steps, including the first (fast).
Teuchos::ScalarTraits< ScalarType >::magnitudeType orthogError(const MV &X1, const MV &X2) const
This method computes the error in orthogonality of two multivectors, measured as the Frobenius norm o...
int normalize(MV &X, Teuchos::RCP< MV > MX, Teuchos::RCP< DM > B) const
This method takes a multivector X and attempts to compute an orthonormal basis for ,...
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &plist)
void setLabel(const std::string &label)
This method sets the label used by the timers in the orthogonalization manager.
IMGSOrthoManager(const Teuchos::RCP< Teuchos::ParameterList > &plist, const std::string &label="Belos", Teuchos::RCP< const OP > Op=Teuchos::null)
Constructor that takes a list of parameters.
void project(MV &X, Teuchos::Array< Teuchos::RCP< DM > > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
This method calls project(X,Teuchos::null,C,Q); see documentation for that function.
void project(MV &X, Teuchos::RCP< MV > MX, Teuchos::Array< Teuchos::RCP< DM > > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
Given a list of (mutually and internally) orthonormal bases Q, this method takes a multivector X and ...
void setBlkTol(const MagnitudeType blk_tol)
Set parameter for block re-orthogonalization threshhold.
void setSingTol(const MagnitudeType sing_tol)
Set parameter for singular block detection.
const std::string & getLabel() const
This method returns the label being used by the timers in the orthogonalization manager.
static const MagnitudeType sing_tol_default_
Singular block detection threshold (default).
int normalize(MV &X, Teuchos::RCP< DM > B) const
This method calls normalize(X,Teuchos::null,B); see documentation for that function.
static const MagnitudeType blk_tol_fast_
Block reorthogonalization threshold (fast).
static const MagnitudeType sing_tol_fast_
Singular block detection threshold (fast).
static const MagnitudeType blk_tol_default_
Block reorthogonalization threshold (default).
IMGSOrthoManager(const std::string &label="Belos", Teuchos::RCP< const OP > Op=Teuchos::null, const int max_ortho_steps=max_ortho_steps_default_, const MagnitudeType blk_tol=blk_tol_default_, const MagnitudeType sing_tol=sing_tol_default_)
Constructor specifying re-orthogonalization tolerance.
Belos's templated virtual class for providing routines for orthogonalization and orthonormzalition of...
void innerProd(const MV &X, const MV &Y, DM &Z) const
Provides the inner product defining the orthogonality concepts, using the provided operator.
Alternative run-time polymorphic interface for operators.
Operator()
Default constructor (does nothing).
Teuchos::RCP< Teuchos::ParameterList > getIMGSFastParameters()
"Fast" but possibly unsafe or less accurate parameters.
Teuchos::RCP< Teuchos::ParameterList > getIMGSDefaultParameters()
"Default" parameters for robustness and accuracy.