15#ifndef BELOS_ICGS_ORTHOMANAGER_HPP
16#define BELOS_ICGS_ORTHOMANAGER_HPP
32#include "Teuchos_as.hpp"
33#ifdef BELOS_TEUCHOS_TIME_MONITOR
34#include "Teuchos_TimeMonitor.hpp"
40 template<
class ScalarType,
class MV,
class OP>
44 template<
class ScalarType,
class MV,
class OP>
47 template<
class ScalarType,
class MV,
class OP>
52 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType MagnitudeType;
53 typedef typename Teuchos::ScalarTraits<MagnitudeType> MGT;
54 typedef Teuchos::ScalarTraits<ScalarType> SCT;
64 Teuchos::RCP<const OP>
Op = Teuchos::null,
74#ifdef BELOS_TEUCHOS_TIME_MONITOR
76 ss << label_ +
": ICGS[" << max_ortho_steps_ <<
"]";
78 std::string
orthoLabel =
ss.str() +
": Orthogonalization";
84 std::string
normLabel =
ss.str() +
": Ortho (Norm)";
87 std::string
ipLabel =
ss.str() +
": Ortho (Inner Product)";
94 const std::string&
label =
"Belos",
95 Teuchos::RCP<const OP>
Op = Teuchos::null) :
104#ifdef BELOS_TEUCHOS_TIME_MONITOR
105 std::stringstream
ss;
106 ss << label_ +
": ICGS[" << max_ortho_steps_ <<
"]";
108 std::string
orthoLabel =
ss.str() +
": Orthogonalization";
114 std::string
normLabel =
ss.str() +
": Ortho (Norm)";
117 std::string
ipLabel =
ss.str() +
": Ortho (Inner Product)";
132 using Teuchos::Exceptions::InvalidParameterName;
133 using Teuchos::ParameterList;
134 using Teuchos::parameterList;
139 if (
plist.is_null()) {
180 params->remove (
"depTol");
201 Teuchos::RCP<const Teuchos::ParameterList>
204 if (defaultParams_.is_null()) {
208 return defaultParams_;
217 Teuchos::RCP<const Teuchos::ParameterList>
221 using Teuchos::ParameterList;
222 using Teuchos::parameterList;
242 Teuchos::RCP<Teuchos::ParameterList>
params = this->getNonconstParameterList();
256 Teuchos::RCP<Teuchos::ParameterList>
params = this->getNonconstParameterList();
307 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > C,
308 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const;
314 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > C,
315 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const {
346 Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > B)
const;
351 int normalize ( MV &
X, Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > B )
const {
401 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > C,
402 Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > B,
403 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const;
413 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
422 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
428 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
437 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
451 const std::string&
getLabel()
const {
return label_; }
477 int max_ortho_steps_;
479 MagnitudeType blk_tol_;
481 MagnitudeType sing_tol_;
485#ifdef BELOS_TEUCHOS_TIME_MONITOR
490 mutable Teuchos::RCP<Teuchos::ParameterList> defaultParams_;
493 int findBasis(MV &
X, Teuchos::RCP<MV>
MX,
494 Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > C,
498 bool blkOrtho1 ( MV &
X, Teuchos::RCP<MV>
MX,
499 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > C,
500 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const;
503 bool blkOrtho ( MV &
X, Teuchos::RCP<MV>
MX,
504 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > C,
505 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const;
520 int blkOrthoSing ( MV &
X, Teuchos::RCP<MV>
MX,
521 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > C,
522 Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > B,
523 Teuchos::ArrayView<Teuchos::RCP<const MV> >
QQ)
const;
527 template<
class ScalarType,
class MV,
class OP>
530 template<
class ScalarType,
class MV,
class OP>
531 const typename ICGSOrthoManager<ScalarType,MV,OP>::MagnitudeType
533 = 10*Teuchos::ScalarTraits<typename ICGSOrthoManager<ScalarType,MV,OP>::MagnitudeType>::squareroot(
534 Teuchos::ScalarTraits<
typename ICGSOrthoManager<ScalarType,MV,OP>::MagnitudeType>::eps() );
536 template<
class ScalarType,
class MV,
class OP>
537 const typename ICGSOrthoManager<ScalarType,MV,OP>::MagnitudeType
539 = 10*Teuchos::ScalarTraits<typename ICGSOrthoManager<ScalarType,MV,OP>::MagnitudeType>::eps();
541 template<
class ScalarType,
class MV,
class OP>
544 template<
class ScalarType,
class MV,
class OP>
545 const typename ICGSOrthoManager<ScalarType,MV,OP>::MagnitudeType
547 = Teuchos::ScalarTraits<typename ICGSOrthoManager<ScalarType,MV,OP>::MagnitudeType>::zero();
549 template<
class ScalarType,
class MV,
class OP>
550 const typename ICGSOrthoManager<ScalarType,MV,OP>::MagnitudeType
552 = Teuchos::ScalarTraits<typename ICGSOrthoManager<ScalarType,MV,OP>::MagnitudeType>::zero();
556 template<
class ScalarType,
class MV,
class OP>
559 if (
label != label_) {
561#ifdef BELOS_TEUCHOS_TIME_MONITOR
562 std::stringstream
ss;
563 ss << label_ +
": ICGS[" << max_ortho_steps_ <<
"]";
565 std::string
orthoLabel =
ss.str() +
": Orthogonalization";
571 std::string
normLabel =
ss.str() +
": Ortho (Norm)";
574 std::string
ipLabel =
ss.str() +
": Ortho (Inner Product)";
582 template<
class ScalarType,
class MV,
class OP>
583 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
586 int rank = MVT::GetNumberVecs(
X);
587 Teuchos::SerialDenseMatrix<int,ScalarType>
xTx(
rank,
rank);
592 return xTx.normFrobenius();
597 template<
class ScalarType,
class MV,
class OP>
598 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
600 int r1 = MVT::GetNumberVecs(
X1);
601 int r2 = MVT::GetNumberVecs(
X2);
602 Teuchos::SerialDenseMatrix<int,ScalarType>
xTx(
r2,
r1);
604 return xTx.normFrobenius();
609 template<
class ScalarType,
class MV,
class OP>
614 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > C,
615 Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > B,
616 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const
618 using Teuchos::Array;
620 using Teuchos::is_null;
623 using Teuchos::SerialDenseMatrix;
627#ifdef BELOS_TEUCHOS_TIME_MONITOR
632 const MagnitudeType
ZERO = MGT::zero();
635 int xc = MVT::GetNumberVecs(
X );
653 for (size_type
k = 0;
k <
nq; ++
k)
655 const int numRows = MVT::GetNumberVecs (*
Q[
k]);
664 "IMGS orthogonalization: failed to reshape "
665 "C[" <<
k <<
"] (the array of block "
666 "coefficients resulting from projecting X "
667 "against Q[1:" <<
nq <<
"]).");
673 if (
MX == Teuchos::null) {
675 MX = MVT::Clone(
X,MVT::GetNumberVecs(
X));
676 OPT::Apply(*(this->_Op),
X,*
MX);
681 MX = Teuchos::rcp( &
X,
false );
684 int mxc = MVT::GetNumberVecs( *
MX );
691 for (
int i=0;
i<
nq;
i++) {
692 numbas += MVT::GetNumberVecs( *
Q[
i] );
697 "Belos::ICGSOrthoManager::projectAndNormalize(): Size of X must be consistant with size of B" );
700 "Belos::ICGSOrthoManager::projectAndNormalize(): MVT returned negative dimensions for X,MX" );
703 "Belos::ICGSOrthoManager::projectAndNormalize(): Size of X must be consistant with size of MX" );
718 if ( B == Teuchos::null ) {
719 B = Teuchos::rcp(
new Teuchos::SerialDenseMatrix<int,ScalarType>(
xc,
xc) );
721 std::vector<ScalarType>
diag(
xc);
723#ifdef BELOS_TEUCHOS_TIME_MONITOR
728 (*B)(0,0) = SCT::squareroot(SCT::magnitude(
diag[0]));
730 if (SCT::magnitude((*B)(0,0)) >
ZERO) {
732 MVT::MvScale(
X,
ONE/(*B)(0,0) );
735 MVT::MvScale( *
MX,
ONE/(*B)(0,0) );
743 tmpX = MVT::CloneCopy(
X);
758 MVT::Assign( *
tmpX,
X );
765 rank = findBasis(
X,
MX, B,
false );
773 MVT::Assign( *
tmpX,
X );
783 "Belos::ICGSOrthoManager::projectAndNormalize(): Debug error in rank variable." );
793 template<
class ScalarType,
class MV,
class OP>
795 MV &
X, Teuchos::RCP<MV>
MX,
796 Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > B )
const {
798#ifdef BELOS_TEUCHOS_TIME_MONITOR
803 return findBasis(
X,
MX, B,
true);
810 template<
class ScalarType,
class MV,
class OP>
812 MV &
X, Teuchos::RCP<MV>
MX,
813 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > C,
814 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const {
830#ifdef BELOS_TEUCHOS_TIME_MONITOR
834 int xc = MVT::GetNumberVecs(
X );
837 std::vector<int>
qcs(
nq);
839 if (
nq == 0 ||
xc == 0 ||
xr == 0) {
851 if (
MX == Teuchos::null) {
853 MX = MVT::Clone(
X,MVT::GetNumberVecs(
X));
854 OPT::Apply(*(this->_Op),
X,*
MX);
859 MX = Teuchos::rcp( &
X,
false );
861 int mxc = MVT::GetNumberVecs( *
MX );
866 "Belos::ICGSOrthoManager::project(): MVT returned negative dimensions for X,MX" );
869 "Belos::ICGSOrthoManager::project(): Size of X not consistant with MX,Q" );
872 for (
int i=0;
i<
nq;
i++) {
874 "Belos::ICGSOrthoManager::project(): Q lengths not mutually consistant" );
875 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
877 "Belos::ICGSOrthoManager::project(): Q has less rows than columns" );
880 if ( C[
i] == Teuchos::null ) {
881 C[
i] = Teuchos::rcp(
new Teuchos::SerialDenseMatrix<int,ScalarType>(
qcs[
i],
xc) );
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>
902 Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > B,
921 const MagnitudeType
ZERO = SCT::magnitude (SCT::zero ());
923 const int xc = MVT::GetNumberVecs (
X);
937 if (
MX == Teuchos::null) {
939 MX = MVT::Clone(
X,
xc);
940 OPT::Apply(*(this->_Op),
X,*
MX);
947 if ( B == Teuchos::null ) {
948 B = Teuchos::rcp(
new Teuchos::SerialDenseMatrix<int,ScalarType>(
xc,
xc) );
951 const int mxc = (this->_hasOp) ? MVT::GetNumberVecs( *
MX ) :
xc;
956 "Belos::ICGSOrthoManager::findBasis(): X must be non-empty" );
958 "Belos::ICGSOrthoManager::findBasis(): Size of X not consistant with size of B" );
960 "Belos::ICGSOrthoManager::findBasis(): Size of X not consistant with size of MX" );
962 "Belos::ICGSOrthoManager::findBasis(): Size of X not feasible for normalization" );
964 "Belos::ICGSOrthoManager::findBasis(): Invalid howMany parameter" );
980 std::vector<int> index(1);
982 Teuchos::RCP<MV>
Xj = MVT::CloneViewNonConst(
X, index );
983 Teuchos::RCP<MV>
MXj;
986 MXj = MVT::CloneViewNonConst( *
MX, index );
1011 Teuchos::SerialDenseMatrix<int,ScalarType>
product(
numX, 1);
1017#ifdef BELOS_TEUCHOS_TIME_MONITOR
1024 "Belos::ICGSOrthoManager::findBasis(): Negative definiteness discovered in inner product" );
1028 Teuchos::SerialDenseMatrix<int,ScalarType>
P2(
numX,1);
1030 for (
int i=0;
i<max_ortho_steps_; ++
i) {
1034#ifdef BELOS_TEUCHOS_TIME_MONITOR
1043#ifdef BELOS_TEUCHOS_TIME_MONITOR
1054#ifdef BELOS_TEUCHOS_TIME_MONITOR
1071#ifdef BELOS_TEUCHOS_TIME_MONITOR
1085 if ( SCT::magnitude(
newDot[0]) < SCT::magnitude(sing_tol_*
oldDot[0]) ) {
1090 std::cout <<
"Belos::ICGSOrthoManager::findBasis() --> Random for column " <<
numX << std::endl;
1093 Teuchos::RCP<MV>
tempXj = MVT::Clone(
X, 1 );
1095 MVT::MvRandom( *
tempXj );
1104#ifdef BELOS_TEUCHOS_TIME_MONITOR
1112#ifdef BELOS_TEUCHOS_TIME_MONITOR
1118#ifdef BELOS_TEUCHOS_TIME_MONITOR
1124#ifdef BELOS_TEUCHOS_TIME_MONITOR
1132#ifdef BELOS_TEUCHOS_TIME_MONITOR
1138 if ( SCT::magnitude(
newDot[0]) >= SCT::magnitude(
oldDot[0]*sing_tol_) ) {
1154 if ( SCT::magnitude(
newDot[0]) < SCT::magnitude(
oldDot[0]*blk_tol_) ) {
1193 template<
class ScalarType,
class MV,
class OP>
1195 ICGSOrthoManager<ScalarType, MV, OP>::blkOrtho1 ( MV &X, Teuchos::RCP<MV> MX,
1196 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > C,
1197 Teuchos::ArrayView<Teuchos::RCP<const MV> > Q)
const
1200 int xc = MVT::GetNumberVecs(
X );
1203 std::vector<int>
qcs(
nq );
1204 for (
int i=0;
i<
nq;
i++) {
1205 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
1210 Teuchos::Array<Teuchos::RCP<MV> >
MQ(
nq);
1212 for (
int i=0;
i<
nq;
i++) {
1215#ifdef BELOS_TEUCHOS_TIME_MONITOR
1222#ifdef BELOS_TEUCHOS_TIME_MONITOR
1225 MVT::MvTimesMatAddMv( -
ONE, *
Q[
i], *C[
i],
ONE,
X );
1231 OPT::Apply( *(this->_Op),
X, *
MX);
1236 OPT::Apply( *(this->_Op), *
Q[
i], *
MQ[
i] );
1238#ifdef BELOS_TEUCHOS_TIME_MONITOR
1248 for (
int j = 1;
j < max_ortho_steps_; ++
j) {
1250 for (
int i=0;
i<
nq;
i++) {
1255#ifdef BELOS_TEUCHOS_TIME_MONITOR
1262#ifdef BELOS_TEUCHOS_TIME_MONITOR
1271#ifdef BELOS_TEUCHOS_TIME_MONITOR
1279 OPT::Apply( *(this->_Op),
X, *
MX);
1290 template<
class ScalarType,
class MV,
class OP>
1292 ICGSOrthoManager<ScalarType, MV, OP>::blkOrtho ( MV &X, Teuchos::RCP<MV> MX,
1293 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > C,
1294 Teuchos::ArrayView<Teuchos::RCP<const MV> > Q)
const
1297 int xc = MVT::GetNumberVecs(
X );
1301 std::vector<int>
qcs(
nq );
1302 for (
int i=0;
i<
nq;
i++) {
1303 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
1309 std::vector<ScalarType>
oldDot(
xc );
1311#ifdef BELOS_TEUCHOS_TIME_MONITOR
1317 Teuchos::Array<Teuchos::RCP<MV> >
MQ(
nq);
1319 for (
int i=0;
i<
nq;
i++) {
1322#ifdef BELOS_TEUCHOS_TIME_MONITOR
1329#ifdef BELOS_TEUCHOS_TIME_MONITOR
1332 MVT::MvTimesMatAddMv( -
ONE, *
Q[
i], *C[
i],
ONE,
X );
1337 OPT::Apply( *(this->_Op),
X, *
MX);
1342 OPT::Apply( *(this->_Op), *
Q[
i], *
MQ[
i] );
1344#ifdef BELOS_TEUCHOS_TIME_MONITOR
1354 for (
int j = 1;
j < max_ortho_steps_; ++
j) {
1356 for (
int i=0;
i<
nq;
i++) {
1361#ifdef BELOS_TEUCHOS_TIME_MONITOR
1368#ifdef BELOS_TEUCHOS_TIME_MONITOR
1377#ifdef BELOS_TEUCHOS_TIME_MONITOR
1385 OPT::Apply( *(this->_Op),
X, *
MX);
1392 std::vector<ScalarType>
newDot(
xc);
1394#ifdef BELOS_TEUCHOS_TIME_MONITOR
1401 for (
int i=0;
i<
xc;
i++){
1402 if (SCT::magnitude(
newDot[
i]) < SCT::magnitude(
oldDot[
i] * blk_tol_)) {
1411 template<
class ScalarType,
class MV,
class OP>
1413 ICGSOrthoManager<ScalarType, MV, OP>::blkOrthoSing ( MV &X, Teuchos::RCP<MV> MX,
1414 Teuchos::Array<Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > > C,
1415 Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > B,
1416 Teuchos::ArrayView<Teuchos::RCP<const MV> > QQ)
const
1418 Teuchos::Array<Teuchos::RCP<const MV> >
Q (
QQ);
1424 int xc = MVT::GetNumberVecs(
X );
1425 std::vector<int>
indX( 1 );
1428 std::vector<int>
qcs(
nq );
1429 for (
int i=0;
i<
nq;
i++) {
1430 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
1434 Teuchos::RCP<const MV>
lastQ;
1435 Teuchos::RCP<MV>
Xj,
MXj;
1436 Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> >
lastC;
1439 for (
int j=0;
j<
xc;
j++) {
1445 std::vector<int> index(
j );
1449 lastQ = MVT::CloneView(
X, index );
1454 qcs.push_back( MVT::GetNumberVecs( *
lastQ ) );
1459 Xj = MVT::CloneViewNonConst(
X,
indX );
1461 MXj = MVT::CloneViewNonConst( *
MX,
indX );
1469#ifdef BELOS_TEUCHOS_TIME_MONITOR
1475 Teuchos::Array<Teuchos::RCP<MV> >
MQ(
Q.size());
1477 for (
int i=0;
i<
Q.size();
i++) {
1480 Teuchos::SerialDenseMatrix<int,ScalarType>
tempC( Teuchos::View, *C[
i],
qcs[
i], 1, 0,
j );
1484#ifdef BELOS_TEUCHOS_TIME_MONITOR
1490#ifdef BELOS_TEUCHOS_TIME_MONITOR
1499 OPT::Apply( *(this->_Op), *
Xj, *
MXj);
1504 OPT::Apply( *(this->_Op), *
Q[
i], *
MQ[
i] );
1506#ifdef BELOS_TEUCHOS_TIME_MONITOR
1518 for (
int i=0;
i<
Q.size();
i++) {
1519 Teuchos::SerialDenseMatrix<int,ScalarType>
tempC( Teuchos::View, *C[
i],
qcs[
i], 1, 0,
j );
1520 Teuchos::SerialDenseMatrix<int,ScalarType>
C2(
qcs[
i], 1 );
1524#ifdef BELOS_TEUCHOS_TIME_MONITOR
1531#ifdef BELOS_TEUCHOS_TIME_MONITOR
1541#ifdef BELOS_TEUCHOS_TIME_MONITOR
1548 OPT::Apply( *(this->_Op), *
Xj, *
MXj);
1557#ifdef BELOS_TEUCHOS_TIME_MONITOR
1564 if (SCT::magnitude(
newDot[0]) < SCT::magnitude(
oldDot[0]*sing_tol_)) {
1583 Teuchos::RCP<MV>
tempXj = MVT::Clone(
X, 1 );
1585 MVT::MvRandom( *
tempXj );
1594#ifdef BELOS_TEUCHOS_TIME_MONITOR
1602 for (
int i=0;
i<
Q.size();
i++) {
1603 Teuchos::SerialDenseMatrix<int,ScalarType>
product(
qcs[
i], 1 );
1607#ifdef BELOS_TEUCHOS_TIME_MONITOR
1613#ifdef BELOS_TEUCHOS_TIME_MONITOR
1622#ifdef BELOS_TEUCHOS_TIME_MONITOR
1639#ifdef BELOS_TEUCHOS_TIME_MONITOR
1646 if ( SCT::magnitude(
newDot[0]) >= SCT::magnitude(
oldDot[0]*sing_tol_) ) {
1675 template<
class ScalarType,
class MV,
class OP>
1678 using Teuchos::ParameterList;
1679 using Teuchos::parameterList;
1687 "Maximum number of orthogonalization passes (includes the "
1688 "first). Default is 2, since \"twice is enough\" for Krylov "
1691 "Block reorthogonalization threshold.");
1693 "Singular block detection threshold.");
1698 template<
class ScalarType,
class MV,
class OP>
1701 using Teuchos::ParameterList;
1706 params->set (
"maxNumOrthogPasses",
Belos header file which uses auto-configuration information to include necessary C++ headers.
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.
An implementation of the Belos::MatOrthoManager that performs orthogonalization using multiple steps ...
MagnitudeType getSingTol() const
Return parameter for singular block detection.
MagnitudeType getBlkTol() const
Return parameter for block re-orthogonalization threshhold.
~ICGSOrthoManager()
Destructor.
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.
static const MagnitudeType sing_tol_fast_
Singular block detection threshold (fast).
static const MagnitudeType blk_tol_fast_
Block reorthogonalization threshold (fast).
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.
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 ...
static const int max_ortho_steps_default_
Max number of (re)orthogonalization steps, including the first (default).
void setBlkTol(const MagnitudeType blk_tol)
Set parameter for block re-orthogonalization threshhold.
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &plist)
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.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
void setSingTol(const MagnitudeType sing_tol)
Set parameter for singular block detection.
static const MagnitudeType sing_tol_default_
Singular block detection threshold (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 ...
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 ,...
const std::string & getLabel() const
This method returns the label being used by the timers in the orthogonalization manager.
static const MagnitudeType blk_tol_default_
Block reorthogonalization threshold (default).
ICGSOrthoManager(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.
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...
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters() const
"Fast" but possibly unsafe or less accurate parameters.
void setLabel(const std::string &label)
This method sets the label used by the timers in the orthogonalization manager.
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 .
static const int max_ortho_steps_fast_
Max number of (re)orthogonalization steps, including the first (fast).
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.
Alternative run-time polymorphic interface for operators.
Operator()
Default constructor (does nothing).
Teuchos::RCP< Teuchos::ParameterList > getICGSDefaultParameters()
"Default" parameters for robustness and accuracy.
Teuchos::RCP< Teuchos::ParameterList > getICGSFastParameters()
"Fast" but possibly unsafe or less accurate parameters.