47 #ifndef BELOS_ICGS_ORTHOMANAGER_HPP 48 #define BELOS_ICGS_ORTHOMANAGER_HPP 65 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp" 66 #ifdef BELOS_TEUCHOS_TIME_MONITOR 68 #endif // BELOS_TEUCHOS_TIME_MONITOR 72 template<
class ScalarType,
class MV,
class OP>
91 const int max_ortho_steps = 2,
93 const MagnitudeType sing_tol = 10*
MGT::eps() )
95 max_ortho_steps_( max_ortho_steps ),
97 sing_tol_( sing_tol ),
100 #ifdef BELOS_TEUCHOS_TIME_MONITOR 101 std::string orthoLabel = label_ +
": Orthogonalization";
104 std::string updateLabel = label_ +
": Ortho (Update)";
107 std::string normLabel = label_ +
": Ortho (Norm)";
110 std::string ipLabel = label_ +
": Ortho (Inner Product)";
117 const std::string& label =
"Belos",
120 max_ortho_steps_ (2),
121 blk_tol_ (10 *
MGT::squareroot (
MGT::eps())),
122 sing_tol_ (10 *
MGT::eps()),
127 #ifdef BELOS_TEUCHOS_TIME_MONITOR 128 std::string orthoLabel = label_ +
": Orthogonalization";
131 std::string updateLabel = label_ +
": Ortho (Update)";
134 std::string normLabel = label_ +
": Ortho (Norm)";
137 std::string ipLabel = label_ +
": Ortho (Inner Product)";
154 using Teuchos::parameterList;
158 RCP<ParameterList> params;
160 params = parameterList (*defaultParams);
175 int maxNumOrthogPasses;
176 MagnitudeType blkTol;
177 MagnitudeType singTol;
180 maxNumOrthogPasses = params->
get<
int> (
"maxNumOrthogPasses");
181 }
catch (InvalidParameterName&) {
182 maxNumOrthogPasses = defaultParams->get<
int> (
"maxNumOrthogPasses");
183 params->set (
"maxNumOrthogPasses", maxNumOrthogPasses);
194 blkTol = params->get<MagnitudeType> (
"blkTol");
195 }
catch (InvalidParameterName&) {
197 blkTol = params->get<MagnitudeType> (
"depTol");
200 params->remove (
"depTol");
201 }
catch (InvalidParameterName&) {
202 blkTol = defaultParams->get<MagnitudeType> (
"blkTol");
204 params->set (
"blkTol", blkTol);
208 singTol = params->get<MagnitudeType> (
"singTol");
209 }
catch (InvalidParameterName&) {
210 singTol = defaultParams->get<MagnitudeType> (
"singTol");
211 params->set (
"singTol", singTol);
214 max_ortho_steps_ = maxNumOrthogPasses;
226 using Teuchos::parameterList;
229 if (defaultParams_.
is_null()) {
230 RCP<ParameterList> params = parameterList (
"ICGS");
234 const int defaultMaxNumOrthogPasses = 2;
235 const MagnitudeType eps =
MGT::eps();
236 const MagnitudeType defaultBlkTol =
238 const MagnitudeType defaultSingTol = as<MagnitudeType> (10) * eps;
240 params->set (
"maxNumOrthogPasses", defaultMaxNumOrthogPasses,
241 "Maximum number of orthogonalization passes (includes the " 242 "first). Default is 2, since \"twice is enough\" for Krylov " 244 params->set (
"blkTol", defaultBlkTol,
"Block reorthogonalization " 246 params->set (
"singTol", defaultSingTol,
"Singular block detection " 248 defaultParams_ = params;
250 return defaultParams_;
263 using Teuchos::parameterList;
268 RCP<ParameterList> params = parameterList (*defaultParams);
270 const int maxBlkOrtho = 1;
271 const MagnitudeType blkTol =
MGT::zero();
272 const MagnitudeType singTol =
MGT::zero();
274 params->set (
"maxNumOrthogPasses", maxBlkOrtho);
275 params->set (
"blkTol", blkTol);
276 params->set (
"singTol", singTol);
293 params->
set (
"blkTol", blk_tol);
307 params->
set (
"singTol", sing_tol);
309 sing_tol_ = sing_tol;
492 void setLabel(
const std::string& label);
496 const std::string&
getLabel()
const {
return label_; }
502 int max_ortho_steps_;
504 MagnitudeType blk_tol_;
506 MagnitudeType sing_tol_;
510 #ifdef BELOS_TEUCHOS_TIME_MONITOR 512 timerNorm_, timerScale_, timerInnerProd_;
513 #endif // BELOS_TEUCHOS_TIME_MONITOR 521 bool completeBasis,
int howMany = -1 )
const;
554 template<
class ScalarType,
class MV,
class OP>
557 if (label != label_) {
559 std::string orthoLabel = label_ +
": Orthogonalization";
560 #ifdef BELOS_TEUCHOS_TIME_MONITOR 564 std::string updateLabel = label_ +
": Ortho (Update)";
565 #ifdef BELOS_TEUCHOS_TIME_MONITOR 569 std::string normLabel = label_ +
": Ortho (Norm)";
570 #ifdef BELOS_TEUCHOS_TIME_MONITOR 574 std::string ipLabel = label_ +
": Ortho (Inner Product)";
575 #ifdef BELOS_TEUCHOS_TIME_MONITOR 583 template<
class ScalarType,
class MV,
class OP>
586 const ScalarType ONE = SCT::one();
587 int rank = MVT::GetNumberVecs(X);
590 for (
int i=0; i<rank; i++) {
598 template<
class ScalarType,
class MV,
class OP>
601 int r1 = MVT::GetNumberVecs(X1);
602 int r2 = MVT::GetNumberVecs(X2);
610 template<
class ScalarType,
class MV,
class OP>
626 typedef typename Array< RCP< const MV > >::size_type size_type;
628 #ifdef BELOS_TEUCHOS_TIME_MONITOR 632 ScalarType ONE = SCT::one();
636 int xc = MVT::GetNumberVecs( X );
637 ptrdiff_t xr = MVT::GetGlobalLength( X );
644 B =
rcp (
new serial_dense_matrix_type (xc, xc));
654 for (size_type k = 0; k < nq; ++k)
656 const int numRows = MVT::GetNumberVecs (*Q[k]);
657 const int numCols = xc;
660 C[k] =
rcp (
new serial_dense_matrix_type (numRows, numCols));
661 else if (C[k]->numRows() != numRows || C[k]->numCols() != numCols)
663 int err = C[k]->reshape (numRows, numCols);
665 "IMGS orthogonalization: failed to reshape " 666 "C[" << k <<
"] (the array of block " 667 "coefficients resulting from projecting X " 668 "against Q[1:" << nq <<
"]).");
674 if (MX == Teuchos::null) {
676 MX = MVT::Clone(X,MVT::GetNumberVecs(X));
677 OPT::Apply(*(this->_Op),X,*MX);
685 int mxc = MVT::GetNumberVecs( *MX );
686 ptrdiff_t mxr = MVT::GetGlobalLength( *MX );
689 TEUCHOS_TEST_FOR_EXCEPTION( xc == 0 || xr == 0, std::invalid_argument,
"Belos::ICGSOrthoManager::projectAndNormalize(): X must be non-empty" );
692 for (
int i=0; i<nq; i++) {
693 numbas += MVT::GetNumberVecs( *Q[i] );
698 "Belos::ICGSOrthoManager::projectAndNormalize(): Size of X must be consistant with size of B" );
701 "Belos::ICGSOrthoManager::projectAndNormalize(): MVT returned negative dimensions for X,MX" );
704 "Belos::ICGSOrthoManager::projectAndNormalize(): Size of X must be consistant with size of MX" );
710 bool dep_flg =
false;
714 tmpX = MVT::CloneCopy(X);
716 tmpMX = MVT::CloneCopy(*MX);
723 dep_flg = blkOrtho1( X, MX, C, Q );
727 #ifdef BELOS_TEUCHOS_TIME_MONITOR 730 if ( B == Teuchos::null ) {
733 std::vector<ScalarType> diag(xc);
734 MVT::MvDot( X, *MX, diag );
735 (*B)(0,0) = SCT::squareroot(SCT::magnitude(diag[0]));
737 MVT::MvScale( X, ONE/(*B)(0,0) );
740 MVT::MvScale( *MX, ONE/(*B)(0,0) );
748 dep_flg = blkOrtho( X, MX, C, Q );
754 rank = blkOrthoSing( *tmpX, tmpMX, C, B, Q );
757 MVT::Assign( *tmpX, X );
759 MVT::Assign( *tmpMX, *MX );
764 rank = findBasis( X, MX, B,
false );
769 rank = blkOrthoSing( *tmpX, tmpMX, C, B, Q );
772 MVT::Assign( *tmpX, X );
774 MVT::Assign( *tmpMX, *MX );
782 "Belos::ICGSOrthoManager::projectAndNormalize(): Debug error in rank variable." );
792 template<
class ScalarType,
class MV,
class OP>
797 #ifdef BELOS_TEUCHOS_TIME_MONITOR 802 return findBasis(X, MX, B,
true);
808 template<
class ScalarType,
class MV,
class OP>
828 #ifdef BELOS_TEUCHOS_TIME_MONITOR 832 int xc = MVT::GetNumberVecs( X );
833 ptrdiff_t xr = MVT::GetGlobalLength( X );
835 std::vector<int> qcs(nq);
837 if (nq == 0 || xc == 0 || xr == 0) {
840 ptrdiff_t qr = MVT::GetGlobalLength ( *Q[0] );
849 if (MX == Teuchos::null) {
851 MX = MVT::Clone(X,MVT::GetNumberVecs(X));
852 OPT::Apply(*(this->_Op),X,*MX);
859 int mxc = MVT::GetNumberVecs( *MX );
860 ptrdiff_t mxr = MVT::GetGlobalLength( *MX );
864 "Belos::ICGSOrthoManager::project(): MVT returned negative dimensions for X,MX" );
867 "Belos::ICGSOrthoManager::project(): Size of X not consistant with MX,Q" );
871 for (
int i=0; i<nq; i++) {
873 "Belos::ICGSOrthoManager::project(): Q lengths not mutually consistant" );
874 qcs[i] = MVT::GetNumberVecs( *Q[i] );
876 "Belos::ICGSOrthoManager::project(): Q has less rows than columns" );
880 if ( C[i] == Teuchos::null ) {
885 "Belos::ICGSOrthoManager::project(): Size of Q not consistant with size of C" );
890 blkOrtho( X, MX, C, Q );
897 template<
class ScalarType,
class MV,
class OP>
919 #ifdef BELOS_TEUCHOS_TIME_MONITOR 921 #endif // BELOS_TEUCHOS_TIME_MONITOR 923 const ScalarType ONE = SCT::one ();
924 const MagnitudeType ZERO = SCT::magnitude (SCT::zero ());
926 const int xc = MVT::GetNumberVecs (X);
927 const ptrdiff_t xr = MVT::GetGlobalLength (X);
940 if (MX == Teuchos::null) {
942 MX = MVT::Clone(X,xc);
943 OPT::Apply(*(this->_Op),X,*MX);
950 if ( B == Teuchos::null ) {
954 const int mxc = (this->_hasOp) ? MVT::GetNumberVecs( *MX ) : xc;
955 const ptrdiff_t mxr = (this->_hasOp) ? MVT::GetGlobalLength( *MX ) : xr;
959 "Belos::ICGSOrthoManager::findBasis(): X must be non-empty" );
961 "Belos::ICGSOrthoManager::findBasis(): Size of X not consistant with size of B" );
963 "Belos::ICGSOrthoManager::findBasis(): Size of X not consistant with size of MX" );
965 "Belos::ICGSOrthoManager::findBasis(): Size of X not feasible for normalization" );
967 "Belos::ICGSOrthoManager::findBasis(): Invalid howMany parameter" );
972 int xstart = xc - howMany;
974 for (
int j = xstart; j < xc; j++) {
983 std::vector<int> index(1);
989 MXj = MVT::CloneViewNonConst( *MX, index );
997 std::vector<int> prev_idx( numX );
1001 for (
int i=0; i<numX; i++) {
1004 prevX = MVT::CloneView( X, prev_idx );
1006 prevMX = MVT::CloneView( *MX, prev_idx );
1012 std::vector<ScalarType> oldDot( 1 ), newDot( 1 );
1017 MVT::MvDot( *Xj, *MXj, oldDot );
1020 "Belos::ICGSOrthoManager::findBasis(): Negative definiteness discovered in inner product" );
1026 for (
int i=0; i<max_ortho_steps_; ++i) {
1030 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1039 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1042 MVT::MvTimesMatAddMv( -ONE, *prevX, P2, ONE, *Xj );
1050 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1053 MVT::MvTimesMatAddMv( -ONE, *prevMX, P2, ONE, *MXj );
1066 MVT::MvDot( *Xj, *oldMXj, newDot );
1069 if (completeBasis) {
1073 if ( SCT::magnitude(newDot[0]) < SCT::magnitude(sing_tol_*oldDot[0]) ) {
1078 std::cout <<
"Belos::ICGSOrthoManager::findBasis() --> Random for column " << numX << std::endl;
1083 MVT::MvRandom( *tempXj );
1085 tempMXj = MVT::Clone( X, 1 );
1086 OPT::Apply( *(this->_Op), *tempXj, *tempMXj );
1091 MVT::MvDot( *tempXj, *tempMXj, oldDot );
1093 for (
int num_orth=0; num_orth<max_ortho_steps_; num_orth++){
1095 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1101 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1104 MVT::MvTimesMatAddMv( -ONE, *prevX, product, ONE, *tempXj );
1107 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1110 MVT::MvTimesMatAddMv( -ONE, *prevMX, product, ONE, *tempMXj );
1114 MVT::MvDot( *tempXj, *tempMXj, newDot );
1116 if ( SCT::magnitude(newDot[0]) >= SCT::magnitude(oldDot[0]*sing_tol_) ) {
1118 MVT::Assign( *tempXj, *Xj );
1120 MVT::Assign( *tempMXj, *MXj );
1132 if ( SCT::magnitude(newDot[0]) < SCT::magnitude(oldDot[0]*blk_tol_) ) {
1140 ScalarType diag = SCT::squareroot(SCT::magnitude(newDot[0]));
1142 MVT::MvScale( *Xj, ONE/diag );
1145 MVT::MvScale( *MXj, ONE/diag );
1159 for (
int i=0; i<numX; i++) {
1160 (*B)(i,j) = product(i,0);
1171 template<
class ScalarType,
class MV,
class OP>
1173 ICGSOrthoManager<ScalarType, MV, OP>::blkOrtho1 ( MV &X,
Teuchos::RCP<MV> MX,
1178 int xc = MVT::GetNumberVecs( X );
1179 const ScalarType ONE = SCT::one();
1181 std::vector<int> qcs( nq );
1182 for (
int i=0; i<nq; i++) {
1183 qcs[i] = MVT::GetNumberVecs( *Q[i] );
1190 for (
int i=0; i<nq; i++) {
1193 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1200 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1203 MVT::MvTimesMatAddMv( -ONE, *Q[i], *C[i], ONE, X );
1209 OPT::Apply( *(this->_Op), X, *MX);
1213 MQ[i] = MVT::Clone( *Q[i], qcs[i] );
1214 OPT::Apply( *(this->_Op), *Q[i], *MQ[i] );
1215 MVT::MvTimesMatAddMv( -ONE, *MQ[i], *C[i], ONE, *MX );
1221 for (
int j = 1; j < max_ortho_steps_; ++j) {
1223 for (
int i=0; i<nq; i++) {
1228 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1235 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1238 MVT::MvTimesMatAddMv( -ONE, *Q[i], C2, ONE, X );
1245 MVT::MvTimesMatAddMv( -ONE, *MQ[i], C2, ONE, *MX );
1247 else if (xc <= qcs[i]) {
1249 OPT::Apply( *(this->_Op), X, *MX);
1260 template<
class ScalarType,
class MV,
class OP>
1262 ICGSOrthoManager<ScalarType, MV, OP>::blkOrtho ( MV &X,
Teuchos::RCP<MV> MX,
1267 int xc = MVT::GetNumberVecs( X );
1268 bool dep_flg =
false;
1269 const ScalarType ONE = SCT::one();
1271 std::vector<int> qcs( nq );
1272 for (
int i=0; i<nq; i++) {
1273 qcs[i] = MVT::GetNumberVecs( *Q[i] );
1279 std::vector<ScalarType> oldDot( xc );
1280 MVT::MvDot( X, *MX, oldDot );
1284 for (
int i=0; i<nq; i++) {
1287 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1294 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1297 MVT::MvTimesMatAddMv( -ONE, *Q[i], *C[i], ONE, X );
1302 OPT::Apply( *(this->_Op), X, *MX);
1306 MQ[i] = MVT::Clone( *Q[i], qcs[i] );
1307 OPT::Apply( *(this->_Op), *Q[i], *MQ[i] );
1308 MVT::MvTimesMatAddMv( -ONE, *MQ[i], *C[i], ONE, *MX );
1314 for (
int j = 1; j < max_ortho_steps_; ++j) {
1316 for (
int i=0; i<nq; i++) {
1321 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1328 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1331 MVT::MvTimesMatAddMv( -ONE, *Q[i], C2, ONE, X );
1338 MVT::MvTimesMatAddMv( -ONE, *MQ[i], C2, ONE, *MX );
1340 else if (xc <= qcs[i]) {
1342 OPT::Apply( *(this->_Op), X, *MX);
1349 std::vector<ScalarType> newDot(xc);
1350 MVT::MvDot( X, *MX, newDot );
1353 for (
int i=0; i<xc; i++){
1354 if (SCT::magnitude(newDot[i]) < SCT::magnitude(oldDot[i] * blk_tol_)) {
1363 template<
class ScalarType,
class MV,
class OP>
1365 ICGSOrthoManager<ScalarType, MV, OP>::blkOrthoSing ( MV &X,
Teuchos::RCP<MV> MX,
1372 const ScalarType ONE = SCT::one();
1373 const ScalarType ZERO = SCT::zero();
1376 int xc = MVT::GetNumberVecs( X );
1377 std::vector<int> indX( 1 );
1378 std::vector<ScalarType> oldDot( 1 ), newDot( 1 );
1380 std::vector<int> qcs( nq );
1381 for (
int i=0; i<nq; i++) {
1382 qcs[i] = MVT::GetNumberVecs( *Q[i] );
1391 for (
int j=0; j<xc; j++) {
1393 bool dep_flg =
false;
1397 std::vector<int> index( j );
1398 for (
int ind=0; ind<j; ind++) {
1401 lastQ = MVT::CloneView( X, index );
1404 Q.push_back( lastQ );
1406 qcs.push_back( MVT::GetNumberVecs( *lastQ ) );
1411 Xj = MVT::CloneViewNonConst( X, indX );
1413 MXj = MVT::CloneViewNonConst( *MX, indX );
1420 MVT::MvDot( *Xj, *MXj, oldDot );
1424 for (
int i=0; i<Q.size(); i++) {
1432 MVT::MvTimesMatAddMv( -ONE, *Q[i], tempC, ONE, *Xj );
1437 OPT::Apply( *(this->_Op), *Xj, *MXj);
1441 MQ[i] = MVT::Clone( *Q[i], qcs[i] );
1442 OPT::Apply( *(this->_Op), *Q[i], *MQ[i] );
1443 MVT::MvTimesMatAddMv( -ONE, *MQ[i], tempC, ONE, *MXj );
1449 for (
int num_ortho_steps=1; num_ortho_steps < max_ortho_steps_; ++num_ortho_steps) {
1451 for (
int i=0; i<Q.size(); i++) {
1458 MVT::MvTimesMatAddMv( -ONE, *Q[i], C2, ONE, *Xj );
1464 MVT::MvTimesMatAddMv( -ONE, *MQ[i], C2, ONE, *MXj );
1466 else if (xc <= qcs[i]) {
1468 OPT::Apply( *(this->_Op), *Xj, *MXj);
1476 if (SCT::magnitude(newDot[0]) < SCT::magnitude(oldDot[0]*sing_tol_)) {
1482 ScalarType diag = SCT::squareroot(SCT::magnitude(newDot[0]));
1484 MVT::MvScale( *Xj, ONE/diag );
1487 MVT::MvScale( *MXj, ONE/diag );
1497 MVT::MvRandom( *tempXj );
1499 tempMXj = MVT::Clone( X, 1 );
1500 OPT::Apply( *(this->_Op), *tempXj, *tempMXj );
1505 MVT::MvDot( *tempXj, *tempMXj, oldDot );
1507 for (
int num_orth=0; num_orth<max_ortho_steps_; num_orth++) {
1509 for (
int i=0; i<Q.size(); i++) {
1514 MVT::MvTimesMatAddMv( -ONE, *Q[i], product, ONE, *tempXj );
1520 MVT::MvTimesMatAddMv( -ONE, *MQ[i], product, ONE, *tempMXj );
1522 else if (xc <= qcs[i]) {
1524 OPT::Apply( *(this->_Op), *tempXj, *tempMXj);
1532 MVT::MvDot( *tempXj, *tempMXj, newDot );
1535 if ( SCT::magnitude(newDot[0]) >= SCT::magnitude(oldDot[0]*sing_tol_) ) {
1536 ScalarType diag = SCT::squareroot(SCT::magnitude(newDot[0]));
1542 MVT::MvAddMv( ONE/diag, *tempXj, ZERO, *tempXj, *Xj );
1544 MVT::MvAddMv( ONE/diag, *tempMXj, ZERO, *tempMXj, *MXj );
1566 #endif // BELOS_ICGS_ORTHOMANAGER_HPP void setBlkTol(const MagnitudeType blk_tol)
Set parameter for block re-orthogonalization threshhold.
ScalarTraits< ScalarType >::magnitudeType normFrobenius() const
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &plist)
int normalize(MV &X, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B) const
This method calls normalize(X,Teuchos::null,B); see documentation for that function.
bool is_null(const boost::shared_ptr< T > &p)
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...
static magnitudeType eps()
const std::string & getLabel() const
This method returns the label being used by the timers in the orthogonalization manager.
T & get(const std::string &name, T def_value)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
bool is_null(const std::shared_ptr< T > &p)
ICGSOrthoManager(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.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Declaration of basic traits for the multivector type.
void setLabel(const std::string &label)
This method sets the label used by the timers in the orthogonalization manager.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
int normalize(MV &X, Teuchos::RCP< MV > MX, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B) const
This method takes a multivector X and attempts to compute an orthonormal basis for ...
Class which defines basic traits for the operator type.
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters() const
"Fast" but possibly unsafe or less accurate parameters.
Traits class which defines basic operations on multivectors.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void project(MV &X, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
This method calls project(X,Teuchos::null,C,Q); see documentation for that function.
~ICGSOrthoManager()
Destructor.
void setMyParamList(const RCP< ParameterList > ¶mList)
RCP< ParameterList > getNonconstParameterList()
virtual int projectAndNormalizeWithMxImpl(MV &X, Teuchos::RCP< MV > MX, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > C, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > 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 ...
void setSingTol(const MagnitudeType sing_tol)
Set parameter for singular block detection.
An implementation of the Belos::MatOrthoManager that performs orthogonalization using multiple steps ...
MagnitudeType getBlkTol() const
Return parameter for block re-orthogonalization threshhold.
TypeTo as(const TypeFrom &t)
MagnitudeType getSingTol() const
Return parameter for singular block detection.
Class which defines basic traits for the operator type.
Belos's templated virtual class for providing routines for orthogonalization and orthonormzalition of...
void innerProd(const MV &X, const MV &Y, Teuchos::SerialDenseMatrix< int, ScalarType > &Z) const
Provides the inner product defining the orthogonality concepts, using the provided operator...
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 ...
Belos header file which uses auto-configuration information to include necessary C++ headers...
ICGSOrthoManager(const std::string &label="Belos", Teuchos::RCP< const OP > Op=Teuchos::null, const int max_ortho_steps=2, const MagnitudeType blk_tol=10 *MGT::squareroot(MGT::eps()), const MagnitudeType sing_tol=10 *MGT::eps())
Constructor specifying re-orthogonalization tolerance.
void project(MV &X, Teuchos::RCP< MV > MX, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > 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 ...
Templated virtual class for providing orthogonalization/orthonormalization methods with matrix-based ...