44 #ifndef IFPACK_BLOCKPRECONDITIONER_H
45 #define IFPACK_BLOCKPRECONDITIONER_H
47 #include "Ifpack_ConfigDefs.h"
48 #include "Ifpack_Preconditioner.h"
49 #include "Ifpack_Partitioner.h"
50 #include "Ifpack_LinearPartitioner.h"
51 #include "Ifpack_GreedyPartitioner.h"
52 #include "Ifpack_METISPartitioner.h"
53 #include "Ifpack_EquationPartitioner.h"
54 #include "Ifpack_UserPartitioner.h"
55 #include "Ifpack_Graph_Epetra_RowMatrix.h"
56 #include "Ifpack_DenseContainer.h"
58 #include "Teuchos_ParameterList.hpp"
59 #include "Teuchos_RefCountPtr.hpp"
60 #include "Epetra_RowMatrix.h"
61 #include "Epetra_MultiVector.h"
62 #include "Epetra_Vector.h"
63 #include "Epetra_Time.h"
64 #include "Epetra_Import.h"
66 static const int IFPACK_JACOBI = 0;
67 static const int IFPACK_GS = 1;
68 static const int IFPACK_SGS = 2;
164 virtual int Apply(
const Epetra_MultiVector& X,
165 Epetra_MultiVector& Y)
const;
178 Epetra_MultiVector& Y)
const;
189 virtual int SetUseTranspose(
bool UseTranspose_in)
196 virtual const char* Label()
const;
211 virtual const Epetra_Comm &
Comm()
const;
223 return(NumLocalBlocks_);
229 return(IsInitialized_);
247 virtual const Epetra_RowMatrix&
Matrix()
const
252 virtual double Condest(
const Ifpack_CondestType CT = Ifpack_Cheap,
253 const int MaxIters = 1550,
254 const double Tol = 1e-9,
255 Epetra_RowMatrix* Matrix_in = 0)
265 std::ostream&
Print(std::ostream& os)
const;
270 return(NumInitialize_);
282 return(NumApplyInverse_);
288 return(InitializeTime_);
294 return(ComputeTime_);
300 return(ApplyInverseTime_);
306 #ifdef IFPACK_FLOPCOUNTERS
307 if (Containers_.size() == 0)
313 double total = InitializeFlops_;
314 for (
unsigned int i = 0 ; i < Containers_.size() ; ++i)
324 #ifdef IFPACK_FLOPCOUNTERS
325 if (Containers_.size() == 0)
328 double total = ComputeFlops_;
329 for (
unsigned int i = 0 ; i < Containers_.size() ; ++i)
339 #ifdef IFPACK_FLOPCOUNTERS
340 if (Containers_.size() == 0)
343 double total = ApplyInverseFlops_;
344 for (
unsigned int i = 0 ; i < Containers_.size() ; ++i) {
345 total += Containers_[i]->ApplyInverseFlops();
364 virtual int ApplyInverseJacobi(
const Epetra_MultiVector& X,
365 Epetra_MultiVector& Y)
const;
367 virtual int DoJacobi(
const Epetra_MultiVector& X,
368 Epetra_MultiVector& Y)
const;
370 virtual int ApplyInverseGS(
const Epetra_MultiVector& X,
371 Epetra_MultiVector& Y)
const;
373 virtual int DoGaussSeidel(Epetra_MultiVector& X,
374 Epetra_MultiVector& Y)
const;
376 virtual int ApplyInverseSGS(
const Epetra_MultiVector& X,
377 Epetra_MultiVector& Y)
const;
379 virtual int DoSGS(
const Epetra_MultiVector& X,
380 Epetra_MultiVector& Xtmp,
381 Epetra_MultiVector& Y)
const;
383 int ExtractSubmatrices();
396 mutable int NumApplyInverse_;
398 double InitializeTime_;
402 mutable double ApplyInverseTime_;
404 double InitializeFlops_;
406 double ComputeFlops_;
408 mutable double ApplyInverseFlops_;
415 double DampingFactor_;
419 Teuchos::ParameterList List_;
425 Teuchos::RefCountPtr< const Epetra_RowMatrix > Matrix_;
426 mutable std::vector<Teuchos::RefCountPtr<T> > Containers_;
428 Teuchos::RefCountPtr<Ifpack_Partitioner> Partitioner_;
429 string PartitionerType_;
434 bool ZeroStartingSolution_;
435 Teuchos::RefCountPtr<Ifpack_Graph> Graph_;
437 Teuchos::RefCountPtr<Epetra_Vector> W_;
440 mutable Epetra_Time Time_;
442 Teuchos::RefCountPtr<Epetra_Import> Importer_;
451 IsInitialized_(false),
456 InitializeTime_(0.0),
458 ApplyInverseTime_(0.0),
459 InitializeFlops_(0.0),
461 ApplyInverseFlops_(0.0),
465 Matrix_(Teuchos::rcp(Matrix_in,false)),
466 PartitionerType_(
"greedy"),
467 PrecType_(IFPACK_JACOBI),
468 ZeroStartingSolution_(true),
473 if (Matrix_in->Comm().NumProc() != 1)
487 return(Label_.c_str());
493 Apply(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const
495 IFPACK_RETURN(Matrix().Apply(X,Y));
503 return(Matrix().Comm());
511 return(Matrix().OperatorDomainMap());
519 return(Matrix().OperatorRangeMap());
527 if (Partitioner_ == Teuchos::null)
530 NumLocalBlocks_ = Partitioner_->NumLocalParts();
532 Containers_.resize(NumLocalBlocks());
534 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
536 int rows = Partitioner_->NumRowsInPart(i);
537 Containers_[i] = Teuchos::rcp(
new T(rows) );
542 if (Containers_[i] == Teuchos::null)
545 IFPACK_CHK_ERR(Containers_[i]->SetParameters(List_));
546 IFPACK_CHK_ERR(Containers_[i]->Initialize());
550 for (
int j = 0 ; j < rows ; ++j) {
551 int LRID = (*Partitioner_)(i,j);
552 Containers_[i]->ID(j) = LRID;
555 IFPACK_CHK_ERR(Containers_[i]->Compute(*Matrix_));
568 if (!IsInitialized())
569 IFPACK_CHK_ERR(Initialize());
571 Time_.ResetStartTime();
575 if (Matrix().NumGlobalRows() != Matrix().NumGlobalCols())
578 IFPACK_CHK_ERR(ExtractSubmatrices());
580 if (IsParallel_ && PrecType_ != IFPACK_JACOBI) {
582 Importer_ = Teuchos::rcp(
new Epetra_Import(Matrix().RowMatrixColMap(),
583 Matrix().RowMatrixRowMap()) );
585 if (Importer_ == Teuchos::null) IFPACK_CHK_ERR(-5);
588 ComputeTime_ += Time_.ElapsedTime();
603 if (X.NumVectors() != Y.NumVectors())
606 Time_.ResetStartTime();
610 Teuchos::RefCountPtr< const Epetra_MultiVector > Xcopy;
611 if (X.Pointers()[0] == Y.Pointers()[0])
612 Xcopy = Teuchos::rcp(
new Epetra_MultiVector(X) );
614 Xcopy = Teuchos::rcp( &X,
false );
618 IFPACK_CHK_ERR(ApplyInverseJacobi(*Xcopy,Y));
621 IFPACK_CHK_ERR(ApplyInverseGS(*Xcopy,Y));
624 IFPACK_CHK_ERR(ApplyInverseSGS(*Xcopy,Y));
628 ApplyInverseTime_ += Time_.ElapsedTime();
641 Epetra_MultiVector& Y)
const
644 if (ZeroStartingSolution_)
648 if (NumSweeps_ == 1 && ZeroStartingSolution_) {
649 IFPACK_RETURN(DoJacobi(X,Y));
652 Epetra_MultiVector AX(Y);
654 for (
int j = 0; j < NumSweeps_ ; j++) {
655 IFPACK_CHK_ERR(Apply(Y,AX));
656 ApplyInverseFlops_ += X.NumVectors() * 2 * Matrix_->NumGlobalNonzeros();
657 IFPACK_CHK_ERR(AX.Update(1.0,X,-1.0));
658 ApplyInverseFlops_ += X.NumVectors() * 2 * Matrix_->NumGlobalRows();
659 IFPACK_CHK_ERR(DoJacobi(AX,Y));
670 DoJacobi(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const
672 int NumVectors = X.NumVectors();
674 if (OverlapLevel_ == 0) {
676 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
679 if (Containers_[i]->NumRows() == 0)
685 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
686 LID = Containers_[i]->ID(j);
687 for (
int k = 0 ; k < NumVectors ; ++k) {
688 Containers_[i]->RHS(j,k) = X[k][LID];
695 IFPACK_CHK_ERR(Containers_[i]->ApplyInverse());
698 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
699 LID = Containers_[i]->ID(j);
700 for (
int k = 0 ; k < NumVectors ; ++k) {
701 Y[k][LID] += DampingFactor_ * Containers_[i]->LHS(j,k);
708 #ifdef IFPACK_FLOPCOUNTERS
709 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalRows();
715 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
718 if (Containers_[i]->NumRows() == 0)
724 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
725 LID = Containers_[i]->ID(j);
726 for (
int k = 0 ; k < NumVectors ; ++k) {
727 Containers_[i]->RHS(j,k) = (*W_)[LID] * X[k][LID];
732 IFPACK_CHK_ERR(Containers_[i]->ApplyInverse());
735 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
736 LID = Containers_[i]->ID(j);
737 for (
int k = 0 ; k < NumVectors ; ++k) {
738 Y[k][LID] += DampingFactor_ * (*W_)[LID] * Containers_[i]->LHS(j,k);
746 #ifdef IFPACK_FLOPCOUNTERS
747 ApplyInverseFlops_ += NumVectors * 4 * Matrix_->NumGlobalRows();
758 Epetra_MultiVector& Y)
const
761 if (ZeroStartingSolution_)
764 Epetra_MultiVector Xcopy(X);
765 for (
int j = 0; j < NumSweeps_ ; j++) {
766 IFPACK_CHK_ERR(DoGaussSeidel(Xcopy,Y));
767 if (j != NumSweeps_ - 1)
778 DoGaussSeidel(Epetra_MultiVector& X, Epetra_MultiVector& Y)
const
783 int Length = Matrix().MaxNumEntries();
784 std::vector<int> Indices(Length);
785 std::vector<double> Values(Length);
787 int NumMyRows = Matrix().NumMyRows();
788 int NumVectors = X.NumVectors();
793 Teuchos::RefCountPtr< Epetra_MultiVector > Y2;
795 Y2 = Teuchos::rcp(
new Epetra_MultiVector(Importer_->TargetMap(), NumVectors) );
797 Y2 = Teuchos::rcp( &Y,
false );
801 Y.ExtractView(&y_ptr);
802 Y2->ExtractView(&y2_ptr);
806 IFPACK_CHK_ERR(Y2->Import(Y,*Importer_,Insert));
808 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
811 if (Containers_[i]->NumRows() == 0)
818 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
819 LID = Containers_[i]->ID(j);
822 IFPACK_CHK_ERR(Matrix().ExtractMyRowCopy(LID, Length,NumEntries,
823 &Values[0], &Indices[0]));
825 for (
int k = 0 ; k < NumEntries ; ++k) {
826 int col = Indices[k];
828 for (
int kk = 0 ; kk < NumVectors ; ++kk) {
829 X[kk][LID] -= Values[k] * y2_ptr[kk][col];
836 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
837 LID = Containers_[i]->ID(j);
838 for (
int k = 0 ; k < NumVectors ; ++k) {
839 Containers_[i]->RHS(j,k) = X[k][LID];
843 IFPACK_CHK_ERR(Containers_[i]->ApplyInverse());
844 #ifdef IFPACK_FLOPCOUNTERS
845 ApplyInverseFlops_ += Containers_[i]->ApplyInverseFlops();
848 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
849 LID = Containers_[i]->ID(j);
850 for (
int k = 0 ; k < NumVectors ; ++k) {
851 y2_ptr[k][LID] += DampingFactor_ * Containers_[i]->LHS(j,k);
860 #ifdef IFPACK_FLOPCOUNTERS
861 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalNonzeros();
862 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalRows();
868 for (
int m = 0 ; m < NumVectors ; ++m)
869 for (
int i = 0 ; i < NumMyRows ; ++i)
870 y_ptr[m][i] = y2_ptr[m][i];
878 ApplyInverseSGS(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const
881 if (ZeroStartingSolution_)
884 Epetra_MultiVector Xcopy(X);
885 for (
int j = 0; j < NumSweeps_ ; j++) {
886 IFPACK_CHK_ERR(DoSGS(X,Xcopy,Y));
887 if (j != NumSweeps_ - 1)
896 DoSGS(
const Epetra_MultiVector& X, Epetra_MultiVector& Xcopy,
897 Epetra_MultiVector& Y)
const
900 int NumMyRows = Matrix().NumMyRows();
901 int NumVectors = X.NumVectors();
903 int Length = Matrix().MaxNumEntries();
904 std::vector<int> Indices;
905 std::vector<double> Values;
906 Indices.resize(Length);
907 Values.resize(Length);
912 Teuchos::RefCountPtr< Epetra_MultiVector > Y2;
914 Y2 = Teuchos::rcp(
new Epetra_MultiVector(Importer_->TargetMap(), NumVectors) );
916 Y2 = Teuchos::rcp( &Y,
false );
920 Y.ExtractView(&y_ptr);
921 Y2->ExtractView(&y2_ptr);
925 IFPACK_CHK_ERR(Y2->Import(Y,*Importer_,Insert));
927 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
930 if (Containers_[i]->NumRows() == 0)
937 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
938 LID = Containers_[i]->ID(j);
941 IFPACK_CHK_ERR(Matrix().ExtractMyRowCopy(LID, Length,NumEntries,
942 &Values[0], &Indices[0]));
944 for (
int k = 0 ; k < NumEntries ; ++k) {
945 int col = Indices[k];
947 for (
int kk = 0 ; kk < NumVectors ; ++kk) {
948 Xcopy[kk][LID] -= Values[k] * y2_ptr[kk][col];
955 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
956 LID = Containers_[i]->ID(j);
957 for (
int k = 0 ; k < NumVectors ; ++k) {
958 Containers_[i]->RHS(j,k) = Xcopy[k][LID];
962 IFPACK_CHK_ERR(Containers_[i]->ApplyInverse());
963 #ifdef IFPACK_FLOPCOUNTERS
964 ApplyInverseFlops_ += Containers_[i]->ApplyInverseFlops();
967 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
968 LID = Containers_[i]->ID(j);
969 for (
int k = 0 ; k < NumVectors ; ++k) {
970 y2_ptr[k][LID] += DampingFactor_ * Containers_[i]->LHS(j,k);
975 #ifdef IFPACK_FLOPCOUNTERS
977 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalNonzeros();
978 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalRows();
983 for (
int i = NumLocalBlocks() - 1; i >=0 ; --i) {
985 if (Containers_[i]->NumRows() == 0)
992 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
993 LID = Containers_[i]->ID(j);
996 IFPACK_CHK_ERR(Matrix().ExtractMyRowCopy(LID, Length,NumEntries,
997 &Values[0], &Indices[0]));
999 for (
int k = 0 ; k < NumEntries ; ++k) {
1000 int col = Indices[k];
1002 for (
int kk = 0 ; kk < NumVectors ; ++kk) {
1003 Xcopy[kk][LID] -= Values[k] * y2_ptr[kk][col];
1010 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
1011 LID = Containers_[i]->ID(j);
1012 for (
int k = 0 ; k < NumVectors ; ++k) {
1013 Containers_[i]->RHS(j,k) = Xcopy[k][LID];
1017 IFPACK_CHK_ERR(Containers_[i]->ApplyInverse());
1018 #ifdef IFPACK_FLOPCOUNTERS
1019 ApplyInverseFlops_ += Containers_[i]->ApplyInverseFlops();
1022 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
1023 LID = Containers_[i]->ID(j);
1024 for (
int k = 0 ; k < NumVectors ; ++k) {
1025 y2_ptr[k][LID] += DampingFactor_ * Containers_[i]->LHS(j,k);
1030 #ifdef IFPACK_FLOPCOUNTERS
1032 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalNonzeros();
1033 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalRows();
1039 for (
int m = 0 ; m < NumVectors ; ++m)
1040 for (
int i = 0 ; i < NumMyRows ; ++i)
1041 y_ptr[m][i] = y2_ptr[m][i];
1047 template<
typename T>
1052 if (PrecType_ == IFPACK_JACOBI)
1054 else if (PrecType_ == IFPACK_GS)
1055 PT =
"Gauss-Seidel";
1056 else if (PrecType_ == IFPACK_SGS)
1057 PT =
"symmetric Gauss-Seidel";
1059 if (!Comm().MyPID()) {
1061 os <<
"================================================================================" << endl;
1062 os <<
"Ifpack_BlockRelaxation, " << PT << endl;
1063 os <<
"Sweeps = " << NumSweeps_ << endl;
1064 os <<
"Damping factor = " << DampingFactor_;
1065 if (ZeroStartingSolution_)
1066 os <<
", using zero starting solution" << endl;
1068 os <<
", using input starting solution" << endl;
1069 os <<
"Number of local blocks = " << Partitioner_->NumLocalParts() << endl;
1071 os <<
"Global number of rows = " << Matrix_->NumGlobalRows() << endl;
1073 os <<
"Phase # calls Total Time (s) Total MFlops MFlops/s" << endl;
1074 os <<
"----- ------- -------------- ------------ --------" << endl;
1075 os <<
"Initialize() " << std::setw(5) << NumInitialize()
1076 <<
" " << std::setw(15) << InitializeTime()
1077 <<
" " << std::setw(15) << 1.0e-6 * InitializeFlops();
1078 if (InitializeTime() != 0.0)
1079 os <<
" " << std::setw(15) << 1.0e-6 * InitializeFlops() / InitializeTime() << endl;
1081 os <<
" " << std::setw(15) << 0.0 << endl;
1082 os <<
"Compute() " << std::setw(5) << NumCompute()
1083 <<
" " << std::setw(15) << ComputeTime()
1084 <<
" " << std::setw(15) << 1.0e-6 * ComputeFlops();
1085 if (ComputeTime() != 0.0)
1086 os <<
" " << std::setw(15) << 1.0e-6 * ComputeFlops() / ComputeTime() << endl;
1088 os <<
" " << std::setw(15) << 0.0 << endl;
1089 os <<
"ApplyInverse() " << std::setw(5) << NumApplyInverse()
1090 <<
" " << std::setw(15) << ApplyInverseTime()
1091 <<
" " << std::setw(15) << 1.0e-6 * ApplyInverseFlops();
1092 if (ApplyInverseTime() != 0.0)
1093 os <<
" " << std::setw(15) << 1.0e-6 * ApplyInverseFlops() / ApplyInverseTime() << endl;
1095 os <<
" " << std::setw(15) << 0.0 << endl;
1096 os <<
"================================================================================" << endl;
1104 template<
typename T>
1109 if (PrecType_ == IFPACK_JACOBI)
1111 else if (PrecType_ == IFPACK_GS)
1112 PT =
"Gauss-Seidel";
1113 else if (PrecType_ == IFPACK_SGS)
1114 PT =
"symmetric Gauss-Seidel";
1116 PT = List.get(
"relaxation: type", PT);
1118 if (PT ==
"Jacobi") {
1119 PrecType_ = IFPACK_JACOBI;
1121 else if (PT ==
"Gauss-Seidel") {
1122 PrecType_ = IFPACK_GS;
1124 else if (PT ==
"symmetric Gauss-Seidel") {
1125 PrecType_ = IFPACK_SGS;
1127 cerr <<
"Option `relaxation: type' has an incorrect value ("
1128 << PT <<
")'" << endl;
1129 cerr <<
"(file " << __FILE__ <<
", line " << __LINE__ <<
")" << endl;
1133 NumSweeps_ = List.get(
"relaxation: sweeps", NumSweeps_);
1134 DampingFactor_ = List.get(
"relaxation: damping factor",
1136 ZeroStartingSolution_ = List.get(
"relaxation: zero starting solution",
1137 ZeroStartingSolution_);
1138 PartitionerType_ = List.get(
"partitioner: type",
1140 NumLocalBlocks_ = List.get(
"partitioner: local parts",
1143 OverlapLevel_ = List.get(
"partitioner: overlap",
1147 if (PrecType_ != IFPACK_JACOBI)
1149 if (NumLocalBlocks_ < 0)
1150 NumLocalBlocks_ = Matrix().NumMyRows() / (-NumLocalBlocks_);
1159 if (PrecType_ == IFPACK_JACOBI)
1161 else if (PrecType_ == IFPACK_GS)
1163 else if (PrecType_ == IFPACK_SGS)
1165 Label_ =
"IFPACK (" + PT2 +
", sweeps="
1174 template<
typename T>
1177 IsInitialized_ =
false;
1178 Time_.ResetStartTime();
1181 if (Graph_ == Teuchos::null) IFPACK_CHK_ERR(-5);
1183 if (PartitionerType_ ==
"linear")
1185 else if (PartitionerType_ ==
"greedy")
1187 else if (PartitionerType_ ==
"metis")
1189 else if (PartitionerType_ ==
"equation")
1191 else if (PartitionerType_ ==
"user")
1196 if (Partitioner_ == Teuchos::null) IFPACK_CHK_ERR(-5);
1199 IFPACK_CHK_ERR(Partitioner_->SetParameters(List_));
1200 IFPACK_CHK_ERR(Partitioner_->Compute());
1203 NumLocalBlocks_ = Partitioner_->NumLocalParts();
1206 W_ = Teuchos::rcp(
new Epetra_Vector(Matrix().RowMatrixRowMap()) );
1209 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
1211 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
1212 int LID = (*Partitioner_)(i,j);
1216 W_->Reciprocal(*W_);
1218 InitializeTime_ += Time_.ElapsedTime();
1219 IsInitialized_ =
true;
1226 #endif // IFPACK_BLOCKPRECONDITIONER_H
virtual const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
Ifpack_BlockRelaxation: a class to define block relaxation preconditioners of Epetra_RowMatrix's.
Ifpack_UserPartitioner: A class to define linear partitions.
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
virtual double ApplyInverseFlops() const
Returns the number of flops in the application of the preconditioner.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
virtual int NumInitialize() const
Returns the number of calls to Initialize().
virtual double ApplyInverseTime() const
Returns the time spent in ApplyInverse().
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Applies the block Jacobi preconditioner to X, returns the result in Y.
std::ostream & Print(std::ostream &os) const
Prints basic information on iostream. This function is used by operator<<.
int NumLocalBlocks() const
Returns the number local blocks.
virtual bool IsComputed() const
Returns true if the preconditioner has been successfully computed.
string Ifpack_toString(const int &x)
Convertes an integer to string.
virtual double ComputeTime() const
Returns the time spent in Compute().
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
virtual bool IsInitialized() const
Returns true if the preconditioner has been successfully computed.
Ifpack_EquationPartitioner: A class to decompose an Ifpack_Graph so that each block will contain all ...
virtual double ComputeFlops() const
Returns the number of flops in the computation phase.
virtual const Epetra_RowMatrix & Matrix() const
Returns a pointer to the matrix to be preconditioned.
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Applies the matrix to an Epetra_MultiVector.
virtual int Compute()
Computes the preconditioner.
Ifpack_METISPartitioner: A class to decompose Ifpack_Graph's using METIS.
Ifpack_Preconditioner: basic class for preconditioning in Ifpack.
Ifpack_BlockRelaxation(const Epetra_RowMatrix *Matrix)
Ifpack_BlockRelaxation constructor with given Epetra_RowMatrix.
virtual int SetParameters(Teuchos::ParameterList &List)
Sets all the parameters for the preconditioner.
Ifpack_Graph_Epetra_RowMatrix: a class to define Ifpack_Graph as a light-weight conversion of Epetra_...
virtual int NumCompute() const
Returns the number of calls to Compute().
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
virtual double Condest(const Ifpack_CondestType CT=Ifpack_Cheap, const int MaxIters=1550, const double Tol=1e-9, Epetra_RowMatrix *Matrix_in=0)
Computes the condition number estimate, returns its value.
virtual double InitializeTime() const
Returns the time spent in Initialize().
virtual double Condest() const
Returns the computed condition number estimate, or -1.0 if not computed.
virtual int Initialize()
Initializes the preconditioner.
Ifpack_LinearPartitioner: A class to define linear partitions.
virtual double InitializeFlops() const
Returns the number of flops in the initialization phase.
virtual int NumApplyInverse() const
Returns the number of calls to ApplyInverse().
virtual double NormInf() const
Returns the infinity norm of the global matrix (not implemented)
Ifpack_GreedyPartitioner: A class to decompose Ifpack_Graph's using a simple greedy algorithm...