15#ifndef BELOS_ICGS_ORTHOMANAGER_HPP
16#define BELOS_ICGS_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_ +
": ICGS[" << 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_ +
": ICGS[" << 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)";
136 using Teuchos::Exceptions::InvalidParameterName;
137 using Teuchos::ParameterList;
138 using Teuchos::parameterList;
143 if (
plist.is_null()) {
184 params->remove (
"depTol");
205 Teuchos::RCP<const Teuchos::ParameterList>
208 if (defaultParams_.is_null()) {
212 return defaultParams_;
221 Teuchos::RCP<const Teuchos::ParameterList>
225 using Teuchos::ParameterList;
226 using Teuchos::parameterList;
246 Teuchos::RCP<Teuchos::ParameterList>
params = this->getNonconstParameterList();
260 Teuchos::RCP<Teuchos::ParameterList>
params = this->getNonconstParameterList();
311 Teuchos::Array<Teuchos::RCP<DM>> C,
312 Teuchos::ArrayView<Teuchos::RCP<const MV>>
Q)
const;
318 Teuchos::Array<Teuchos::RCP<DM>> C,
319 Teuchos::ArrayView<Teuchos::RCP<const MV>>
Q)
const {
350 Teuchos::RCP<DM> B)
const;
405 Teuchos::Array<Teuchos::RCP<DM> > C,
407 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const;
417 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
426 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
432 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
441 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
455 const std::string&
getLabel()
const {
return label_; }
481 int max_ortho_steps_;
483 MagnitudeType blk_tol_;
485 MagnitudeType sing_tol_;
489#ifdef BELOS_TEUCHOS_TIME_MONITOR
494 mutable Teuchos::RCP<Teuchos::ParameterList> defaultParams_;
497 int findBasis(MV &
X, Teuchos::RCP<MV>
MX,
502 bool blkOrtho1 ( MV &
X, Teuchos::RCP<MV>
MX,
503 Teuchos::Array<Teuchos::RCP<DM>> C,
504 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const;
507 bool blkOrtho ( MV &
X, Teuchos::RCP<MV>
MX,
508 Teuchos::Array<Teuchos::RCP<DM>> C,
509 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const;
524 int blkOrthoSing ( MV &
X, Teuchos::RCP<MV>
MX,
525 Teuchos::Array<Teuchos::RCP<DM> > C,
527 Teuchos::ArrayView<Teuchos::RCP<const MV> >
QQ)
const;
531 template<
class ScalarType,
class MV,
class OP,
class DM >
534 template<
class ScalarType,
class MV,
class OP,
class DM >
535 const typename ICGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType
537 = 10*Teuchos::ScalarTraits<typename ICGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType>::squareroot(
538 Teuchos::ScalarTraits<
typename ICGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType>::eps() );
540 template<
class ScalarType,
class MV,
class OP,
class DM >
541 const typename ICGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType
543 = 10*Teuchos::ScalarTraits<typename ICGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType>::eps();
545 template<
class ScalarType,
class MV,
class OP,
class DM >
548 template<
class ScalarType,
class MV,
class OP,
class DM >
549 const typename ICGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType
551 = Teuchos::ScalarTraits<typename ICGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType>::zero();
553 template<
class ScalarType,
class MV,
class OP,
class DM >
554 const typename ICGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType
556 = Teuchos::ScalarTraits<typename ICGSOrthoManager<ScalarType,MV,OP,DM>::MagnitudeType>::zero();
560 template<
class ScalarType,
class MV,
class OP,
class DM >
563 if (
label != label_) {
565#ifdef BELOS_TEUCHOS_TIME_MONITOR
566 std::stringstream
ss;
567 ss << label_ +
": ICGS[" << max_ortho_steps_ <<
"]";
569 std::string
orthoLabel =
ss.str() +
": Orthogonalization";
575 std::string
normLabel =
ss.str() +
": Ortho (Norm)";
578 std::string
ipLabel =
ss.str() +
": Ortho (Inner Product)";
586 template<
class ScalarType,
class MV,
class OP,
class DM >
587 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
590 int rank = MVT::GetNumberVecs(
X);
593 DMT::SyncDeviceToHost(*
xTx);
597 DMT::SyncHostToDevice(*
xTx);
598 return DMT::NormFrobenius(*
xTx);
603 template<
class ScalarType,
class MV,
class OP,
class DM >
604 typename Teuchos::ScalarTraits<ScalarType>::magnitudeType
606 int r1 = MVT::GetNumberVecs(
X1);
607 int r2 = MVT::GetNumberVecs(
X2);
608 Teuchos::RCP<DM>
xTx = DMT::Create(
r2,
r1);
610 return DMT::NormFrobenius(*
xTx);
615 template<
class ScalarType,
class MV,
class OP,
class DM >
620 Teuchos::Array<Teuchos::RCP<DM> > C,
622 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const
624 using Teuchos::Array;
626 using Teuchos::is_null;
631#ifdef BELOS_TEUCHOS_TIME_MONITOR
636 const MagnitudeType
ZERO = MGT::zero();
639 int xc = MVT::GetNumberVecs(
X );
647 B = DMT::Create(
xc,
xc);
657 for (size_type
k = 0;
k <
nq; ++
k) {
658 const int numRows = MVT::GetNumberVecs (*
Q[
k]);
664 else if (DMT::GetNumRows(*C[
k]) !=
numRows || DMT::GetNumCols(*C[
k]) !=
numCols) {
671 if (
MX == Teuchos::null) {
673 MX = MVT::Clone(
X,MVT::GetNumberVecs(
X));
674 OPT::Apply(*(this->_Op),
X,*
MX);
679 MX = Teuchos::rcp( &
X,
false );
682 int mxc = MVT::GetNumberVecs( *
MX );
689 for (
int i=0;
i<
nq;
i++) {
690 numbas += MVT::GetNumberVecs( *
Q[
i] );
695 "Belos::ICGSOrthoManager::projectAndNormalize(): Size of X must be consistant with size of B" );
698 "Belos::ICGSOrthoManager::projectAndNormalize(): MVT returned negative dimensions for X,MX" );
701 "Belos::ICGSOrthoManager::projectAndNormalize(): Size of X must be consistant with size of MX" );
716 if ( B == Teuchos::null ) {
717 B = DMT::Create(
xc,
xc);
720 std::vector<ScalarType>
dot(
xc);
722#ifdef BELOS_TEUCHOS_TIME_MONITOR
725 MVT::MvDot(
X, *
MX,
dot );
739 Teuchos::RCP<DM>
B00 = DMT::Subview(*B,1,1);
746 tmpX = MVT::CloneCopy(
X);
761 MVT::Assign( *
tmpX,
X );
768 rank = findBasis(
X,
MX, B,
false );
776 MVT::Assign( *
tmpX,
X );
786 "Belos::ICGSOrthoManager::projectAndNormalize(): Debug error in rank variable." );
796 template<
class ScalarType,
class MV,
class OP,
class DM >
798 MV &
X, Teuchos::RCP<MV>
MX,
799 Teuchos::RCP<DM> B )
const {
801#ifdef BELOS_TEUCHOS_TIME_MONITOR
806 return findBasis(
X,
MX, B,
true);
813 template<
class ScalarType,
class MV,
class OP,
class DM >
815 MV &
X, Teuchos::RCP<MV>
MX,
816 Teuchos::Array<Teuchos::RCP<DM> > C,
817 Teuchos::ArrayView<Teuchos::RCP<const MV> >
Q)
const {
833#ifdef BELOS_TEUCHOS_TIME_MONITOR
837 int xc = MVT::GetNumberVecs(
X );
840 std::vector<int>
qcs(
nq);
842 if (
nq == 0 ||
xc == 0 ||
xr == 0) {
854 if (
MX == Teuchos::null) {
856 MX = MVT::Clone(
X,MVT::GetNumberVecs(
X));
857 OPT::Apply(*(this->_Op),
X,*
MX);
862 MX = Teuchos::rcp( &
X,
false );
864 int mxc = MVT::GetNumberVecs( *
MX );
869 "Belos::ICGSOrthoManager::project(): MVT returned negative dimensions for X,MX" );
872 "Belos::ICGSOrthoManager::project(): Size of X not consistant with MX,Q" );
875 for (
int i=0;
i<
nq;
i++) {
877 "Belos::ICGSOrthoManager::project(): Q lengths not mutually consistant" );
878 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
880 "Belos::ICGSOrthoManager::project(): Q has less rows than columns" );
883 if ( C[
i] == Teuchos::null ) {
888 "Belos::ICGSOrthoManager::project(): Size of Q not consistant with size of C" );
893 blkOrtho(
X,
MX, C,
Q );
900 template<
class ScalarType,
class MV,
class OP,
class DM >
924 const MagnitudeType
ZERO = SCT::magnitude (SCT::zero ());
926 const int xc = MVT::GetNumberVecs (
X);
940 if (
MX == Teuchos::null) {
942 MX = MVT::Clone(
X,
xc);
943 OPT::Apply(*(this->_Op),
X,*
MX);
950 if ( B == Teuchos::null ) {
951 B = DMT::Create(
xc,
xc);
954 const int mxc = (this->_hasOp) ? MVT::GetNumberVecs( *
MX ) :
xc;
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" );
983 std::vector<int> index(1);
985 Teuchos::RCP<MV>
Xj = MVT::CloneViewNonConst(
X, index );
986 Teuchos::RCP<MV>
MXj;
989 MXj = MVT::CloneViewNonConst( *
MX, index );
1020#ifdef BELOS_TEUCHOS_TIME_MONITOR
1027 "Belos::ICGSOrthoManager::findBasis(): Negative definiteness discovered in inner product" );
1031 Teuchos::RCP<DM>
P2 = DMT::Create(
numX,1);
1033 for (
int i=0;
i<max_ortho_steps_; ++
i) {
1037#ifdef BELOS_TEUCHOS_TIME_MONITOR
1046#ifdef BELOS_TEUCHOS_TIME_MONITOR
1057#ifdef BELOS_TEUCHOS_TIME_MONITOR
1074#ifdef BELOS_TEUCHOS_TIME_MONITOR
1088 if ( SCT::magnitude(
newDot[0]) < SCT::magnitude(sing_tol_*
oldDot[0]) ) {
1093 std::cout <<
"Belos::ICGSOrthoManager::findBasis() --> Random for column " <<
numX << std::endl;
1096 Teuchos::RCP<MV>
tempXj = MVT::Clone(
X, 1 );
1098 MVT::MvRandom( *
tempXj );
1107#ifdef BELOS_TEUCHOS_TIME_MONITOR
1115#ifdef BELOS_TEUCHOS_TIME_MONITOR
1121#ifdef BELOS_TEUCHOS_TIME_MONITOR
1127#ifdef BELOS_TEUCHOS_TIME_MONITOR
1135#ifdef BELOS_TEUCHOS_TIME_MONITOR
1141 if ( SCT::magnitude(
newDot[0]) >= SCT::magnitude(
oldDot[0]*sing_tol_) ) {
1157 if ( SCT::magnitude(
newDot[0]) < SCT::magnitude(
oldDot[0]*blk_tol_) ) {
1175 Teuchos::RCP<DM>
Bjj = DMT::Subview(*B,1,1,
j,
j);
1185 Teuchos::RCP<DM>
Bcolj = DMT::Subview(*B,
numX,1,0,
j);
1196 template<
class ScalarType,
class MV,
class OP,
class DM >
1198 ICGSOrthoManager<ScalarType, MV, OP, DM>::blkOrtho1 ( MV &X, Teuchos::RCP<MV> MX,
1199 Teuchos::Array<Teuchos::RCP<DM> > C,
1200 Teuchos::ArrayView<Teuchos::RCP<const MV> > Q)
const
1203 int xc = MVT::GetNumberVecs(
X );
1206 std::vector<int>
qcs(
nq );
1207 for (
int i=0;
i<
nq;
i++) {
1208 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
1213 Teuchos::Array<Teuchos::RCP<MV> >
MQ(
nq);
1215 for (
int i=0;
i<
nq;
i++) {
1218#ifdef BELOS_TEUCHOS_TIME_MONITOR
1225#ifdef BELOS_TEUCHOS_TIME_MONITOR
1228 MVT::MvTimesMatAddMv( -
ONE, *
Q[
i], *C[
i],
ONE,
X );
1234 OPT::Apply( *(this->_Op),
X, *
MX);
1239 OPT::Apply( *(this->_Op), *
Q[
i], *
MQ[
i] );
1241#ifdef BELOS_TEUCHOS_TIME_MONITOR
1251 for (
int j = 1;
j < max_ortho_steps_; ++
j) {
1253 for (
int i=0;
i<
nq;
i++) {
1254 Teuchos::RCP<DM>
C2 = DMT::Create(DMT::GetNumRows(*C[
i]),DMT::GetNumCols(*C[
i]));
1258#ifdef BELOS_TEUCHOS_TIME_MONITOR
1263 DMT::Add(*C[
i],*
C2);
1265#ifdef BELOS_TEUCHOS_TIME_MONITOR
1274#ifdef BELOS_TEUCHOS_TIME_MONITOR
1282 OPT::Apply( *(this->_Op),
X, *
MX);
1293 template<
class ScalarType,
class MV,
class OP,
class DM >
1295 ICGSOrthoManager<ScalarType, MV, OP, DM>::blkOrtho ( MV &X, Teuchos::RCP<MV> MX,
1296 Teuchos::Array<Teuchos::RCP<DM> > C,
1297 Teuchos::ArrayView<Teuchos::RCP<const MV> > Q)
const
1300 int xc = MVT::GetNumberVecs(
X );
1304 std::vector<int>
qcs(
nq );
1305 for (
int i=0;
i<
nq;
i++) {
1306 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
1312 std::vector<ScalarType>
oldDot(
xc );
1314#ifdef BELOS_TEUCHOS_TIME_MONITOR
1320 Teuchos::Array<Teuchos::RCP<MV> >
MQ(
nq);
1322 for (
int i=0;
i<
nq;
i++) {
1325#ifdef BELOS_TEUCHOS_TIME_MONITOR
1332#ifdef BELOS_TEUCHOS_TIME_MONITOR
1335 MVT::MvTimesMatAddMv( -
ONE, *
Q[
i], *C[
i],
ONE,
X );
1340 OPT::Apply( *(this->_Op),
X, *
MX);
1345 OPT::Apply( *(this->_Op), *
Q[
i], *
MQ[
i] );
1347#ifdef BELOS_TEUCHOS_TIME_MONITOR
1357 for (
int j = 1;
j < max_ortho_steps_; ++
j) {
1359 for (
int i=0;
i<
nq;
i++) {
1360 Teuchos::RCP<DM>
C2 = DMT::Create(DMT::GetNumRows(*C[
i]),DMT::GetNumCols(*C[
i]));
1364#ifdef BELOS_TEUCHOS_TIME_MONITOR
1369 DMT::Add(*C[
i],*
C2);
1371#ifdef BELOS_TEUCHOS_TIME_MONITOR
1380#ifdef BELOS_TEUCHOS_TIME_MONITOR
1388 OPT::Apply( *(this->_Op),
X, *
MX);
1395 std::vector<ScalarType>
newDot(
xc);
1397#ifdef BELOS_TEUCHOS_TIME_MONITOR
1404 for (
int i=0;
i<
xc;
i++){
1405 if (SCT::magnitude(
newDot[
i]) < SCT::magnitude(
oldDot[
i] * blk_tol_)) {
1414 template<
class ScalarType,
class MV,
class OP,
class DM >
1416 ICGSOrthoManager<ScalarType, MV, OP, DM>::blkOrthoSing ( MV &X, Teuchos::RCP<MV> MX,
1417 Teuchos::Array<Teuchos::RCP<DM> > C,
1419 Teuchos::ArrayView<Teuchos::RCP<const MV> > QQ)
const
1421 Teuchos::Array<Teuchos::RCP<const MV> >
Q (
QQ);
1427 int xc = MVT::GetNumberVecs(
X );
1428 std::vector<int>
indX( 1 );
1431 std::vector<int>
qcs(
nq );
1432 for (
int i=0;
i<
nq;
i++) {
1433 qcs[
i] = MVT::GetNumberVecs( *
Q[
i] );
1437 Teuchos::RCP<const MV>
lastQ;
1438 Teuchos::RCP<MV>
Xj,
MXj;
1441 for (
int j=0;
j<
xc;
j++) {
1447 std::vector<int> index(
j );
1451 lastQ = MVT::CloneView(
X, index );
1456 qcs.push_back( MVT::GetNumberVecs( *
lastQ ) );
1461 Xj = MVT::CloneViewNonConst(
X,
indX );
1463 MXj = MVT::CloneViewNonConst( *
MX,
indX );
1471#ifdef BELOS_TEUCHOS_TIME_MONITOR
1477 Teuchos::Array<Teuchos::RCP<MV> >
MQ(
Q.size());
1479 for (
int i=0;
i<
Q.size();
i++) {
1482 Teuchos::RCP<DM>
tempC = DMT::Subview(*C[
i],
qcs[
i], 1, 0,
j);
1486#ifdef BELOS_TEUCHOS_TIME_MONITOR
1492#ifdef BELOS_TEUCHOS_TIME_MONITOR
1501 OPT::Apply( *(this->_Op), *
Xj, *
MXj);
1506 OPT::Apply( *(this->_Op), *
Q[
i], *
MQ[
i] );
1508#ifdef BELOS_TEUCHOS_TIME_MONITOR
1520 for (
int i=0;
i<
Q.size();
i++) {
1521 Teuchos::RCP<DM>
tempC = DMT::Subview(*C[
i],
qcs[
i], 1, 0,
j);
1522 Teuchos::RCP<DM>
C2 = DMT::Create(
qcs[
i], 1 );
1526#ifdef BELOS_TEUCHOS_TIME_MONITOR
1533#ifdef BELOS_TEUCHOS_TIME_MONITOR
1543#ifdef BELOS_TEUCHOS_TIME_MONITOR
1550 OPT::Apply( *(this->_Op), *
Xj, *
MXj);
1559#ifdef BELOS_TEUCHOS_TIME_MONITOR
1566 if (SCT::magnitude(
newDot[0]) < SCT::magnitude(
oldDot[0]*sing_tol_)) {
1581 Teuchos::RCP<DM>
Bjj = DMT::Subview(*B,1,1,
j,
j);
1586 Teuchos::RCP<MV>
tempXj = MVT::Clone(
X, 1 );
1588 MVT::MvRandom( *
tempXj );
1597#ifdef BELOS_TEUCHOS_TIME_MONITOR
1605 for (
int i=0;
i<
Q.size();
i++) {
1610#ifdef BELOS_TEUCHOS_TIME_MONITOR
1616#ifdef BELOS_TEUCHOS_TIME_MONITOR
1625#ifdef BELOS_TEUCHOS_TIME_MONITOR
1642#ifdef BELOS_TEUCHOS_TIME_MONITOR
1649 if ( SCT::magnitude(
newDot[0]) >= SCT::magnitude(
oldDot[0]*sing_tol_) ) {
1653 Teuchos::RCP<DM>
Bjj = DMT::Subview(*B,1,1,
j,
j);
1679 template<
class ScalarType,
class MV,
class OP,
class DM>
1682 using Teuchos::ParameterList;
1683 using Teuchos::parameterList;
1691 "Maximum number of orthogonalization passes (includes the "
1692 "first). Default is 2, since \"twice is enough\" for Krylov "
1695 "Block reorthogonalization threshold.");
1697 "Singular block detection threshold.");
1702 template<
class ScalarType,
class MV,
class OP,
class DM>
1705 using Teuchos::ParameterList;
1710 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 ...
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 ,...
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 ...
~ICGSOrthoManager()
Destructor.
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters() const
"Fast" but possibly unsafe or less accurate parameters.
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 ...
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 .
static const MagnitudeType sing_tol_default_
Singular block detection threshold (default).
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
const std::string & getLabel() const
This method returns the label being used by the timers in the orthogonalization manager.
static const int max_ortho_steps_fast_
Max number of (re)orthogonalization steps, including the first (fast).
static const int max_ortho_steps_default_
Max number of (re)orthogonalization steps, including the first (default).
static const MagnitudeType blk_tol_fast_
Block reorthogonalization threshold (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...
static const MagnitudeType blk_tol_default_
Block reorthogonalization threshold (default).
void setLabel(const std::string &label)
This method sets the label used by the timers in the orthogonalization manager.
void setSingTol(const MagnitudeType sing_tol)
Set parameter for singular block detection.
int normalize(MV &X, Teuchos::RCP< DM > B) const
This method calls normalize(X,Teuchos::null,B); see documentation for that function.
void setBlkTol(const MagnitudeType blk_tol)
Set parameter for block re-orthogonalization threshhold.
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 setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &plist)
MagnitudeType getBlkTol() const
Return parameter for block re-orthogonalization threshhold.
static const MagnitudeType sing_tol_fast_
Singular block detection threshold (fast).
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.
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.
MagnitudeType getSingTol() const
Return parameter for singular block detection.
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 > getICGSFastParameters()
"Fast" but possibly unsafe or less accurate parameters.
Teuchos::RCP< Teuchos::ParameterList > getICGSDefaultParameters()
"Default" parameters for robustness and accuracy.