44 #ifndef IFPACK_BLOCKPRECONDITIONER_H
45 #define IFPACK_BLOCKPRECONDITIONER_H
47 #if defined(Ifpack_SHOW_DEPRECATED_WARNINGS)
49 #warning "The Ifpack package is deprecated"
53 #include "Ifpack_ConfigDefs.h"
54 #include "Ifpack_Preconditioner.h"
55 #include "Ifpack_Partitioner.h"
56 #include "Ifpack_LinePartitioner.h"
57 #include "Ifpack_LinearPartitioner.h"
58 #include "Ifpack_GreedyPartitioner.h"
59 #include "Ifpack_METISPartitioner.h"
60 #include "Ifpack_EquationPartitioner.h"
61 #include "Ifpack_UserPartitioner.h"
62 #include "Ifpack_Graph_Epetra_RowMatrix.h"
63 #include "Ifpack_DenseContainer.h"
65 #include "Teuchos_ParameterList.hpp"
66 #include "Teuchos_RefCountPtr.hpp"
68 #include "Epetra_Map.h"
69 #include "Epetra_RowMatrix.h"
70 #include "Epetra_MultiVector.h"
71 #include "Epetra_Vector.h"
72 #include "Epetra_Time.h"
73 #include "Epetra_Import.h"
75 static const int IFPACK_JACOBI = 0;
76 static const int IFPACK_GS = 1;
77 static const int IFPACK_SGS = 2;
198 virtual int SetUseTranspose(
bool UseTranspose_in)
205 virtual const char* Label()
const;
232 return(NumLocalBlocks_);
238 return(IsInitialized_);
261 virtual double Condest(
const Ifpack_CondestType = Ifpack_Cheap,
274 std::ostream&
Print(std::ostream& os)
const;
279 return(NumInitialize_);
291 return(NumApplyInverse_);
297 return(InitializeTime_);
303 return(ComputeTime_);
309 return(ApplyInverseTime_);
315 #ifdef IFPACK_FLOPCOUNTERS
316 if (Containers_.size() == 0)
322 double total = InitializeFlops_;
323 for (
unsigned int i = 0 ; i < Containers_.size() ; ++i)
324 if(Containers_[i]) total += Containers_[i]->InitializeFlops();
333 #ifdef IFPACK_FLOPCOUNTERS
334 if (Containers_.size() == 0)
337 double total = ComputeFlops_;
338 for (
unsigned int i = 0 ; i < Containers_.size() ; ++i)
339 if(Containers_[i]) total += Containers_[i]->ComputeFlops();
348 #ifdef IFPACK_FLOPCOUNTERS
349 if (Containers_.size() == 0)
352 double total = ApplyInverseFlops_;
353 for (
unsigned int i = 0 ; i < Containers_.size() ; ++i) {
354 if(Containers_[i]) total += Containers_[i]->ApplyInverseFlops();
392 int ExtractSubmatrices();
405 mutable int NumApplyInverse_;
407 double InitializeTime_;
411 mutable double ApplyInverseTime_;
413 double InitializeFlops_;
415 double ComputeFlops_;
417 mutable double ApplyInverseFlops_;
424 double DampingFactor_;
428 Teuchos::ParameterList List_;
434 Teuchos::RefCountPtr< const Epetra_RowMatrix > Matrix_;
435 mutable std::vector<Teuchos::RefCountPtr<T> > Containers_;
439 Teuchos::RefCountPtr<Ifpack_Partitioner> Partitioner_;
440 std::string PartitionerType_;
445 bool ZeroStartingSolution_;
446 Teuchos::RefCountPtr<Ifpack_Graph> Graph_;
448 Teuchos::RefCountPtr<Epetra_Vector> W_;
453 Teuchos::RefCountPtr<Epetra_Import> Importer_;
462 IsInitialized_(false),
467 InitializeTime_(0.0),
469 ApplyInverseTime_(0.0),
470 InitializeFlops_(0.0),
472 ApplyInverseFlops_(0.0),
476 Matrix_(Teuchos::rcp(Matrix_in,false)),
477 Diagonal_( Matrix_in->Map()),
478 PartitionerType_(
"greedy"),
479 PrecType_(IFPACK_JACOBI),
480 ZeroStartingSolution_(true),
499 return(Label_.c_str());
507 int ierr = Matrix().
Apply(X,Y);
516 return(Matrix().Comm());
524 return(Matrix().OperatorDomainMap());
532 return(Matrix().OperatorRangeMap());
540 if (Partitioner_ == Teuchos::null)
543 NumLocalBlocks_ = Partitioner_->NumLocalParts();
545 Containers_.resize(NumLocalBlocks());
548 Matrix_->ExtractDiagonalCopy(Diagonal_);
550 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
552 int rows = Partitioner_->NumRowsInPart(i);
557 Containers_[i] = Teuchos::rcp(
new T(rows) );
559 IFPACK_CHK_ERR(Containers_[i]->SetParameters(List_));
560 IFPACK_CHK_ERR(Containers_[i]->Initialize());
564 for (
int j = 0 ; j < rows ; ++j) {
565 int LRID = (*Partitioner_)(i,j);
566 Containers_[i]->ID(j) = LRID;
569 IFPACK_CHK_ERR(Containers_[i]->Compute(*Matrix_));
574 #ifdef SINGLETON_DEBUG
577 for (
int i = 0 ; i < NumLocalBlocks() ; ++i)
578 issing += (
int) ( Partitioner_->NumRowsInPart(i) == 1);
579 printf(
" %d of %d containers are singleton \n",issing,NumLocalBlocks());
590 if (!IsInitialized())
591 IFPACK_CHK_ERR(Initialize());
593 Time_.ResetStartTime();
597 if (Matrix().NumGlobalRows64() != Matrix().NumGlobalCols64())
600 IFPACK_CHK_ERR(ExtractSubmatrices());
602 if (IsParallel_ && PrecType_ != IFPACK_JACOBI) {
604 Importer_ = Teuchos::rcp(
new Epetra_Import(Matrix().RowMatrixColMap(),
605 Matrix().RowMatrixRowMap()) );
607 if (Importer_ == Teuchos::null) IFPACK_CHK_ERR(-5);
610 ComputeTime_ += Time_.ElapsedTime();
625 if (X.NumVectors() != Y.NumVectors())
628 Time_.ResetStartTime();
632 Teuchos::RefCountPtr< const Epetra_MultiVector > Xcopy;
633 if (X.Pointers()[0] == Y.Pointers()[0])
636 Xcopy = Teuchos::rcp( &X,
false );
640 IFPACK_CHK_ERR(ApplyInverseJacobi(*Xcopy,Y));
643 IFPACK_CHK_ERR(ApplyInverseGS(*Xcopy,Y));
646 IFPACK_CHK_ERR(ApplyInverseSGS(*Xcopy,Y));
650 ApplyInverseTime_ += Time_.ElapsedTime();
666 if (ZeroStartingSolution_)
670 if (NumSweeps_ == 1 && ZeroStartingSolution_) {
671 int ierr = DoJacobi(X,Y);
677 for (
int j = 0; j < NumSweeps_ ; j++) {
678 IFPACK_CHK_ERR(Apply(Y,AX));
679 ApplyInverseFlops_ += X.NumVectors() * 2 * Matrix_->NumGlobalNonzeros64();
680 IFPACK_CHK_ERR(AX.Update(1.0,X,-1.0));
681 ApplyInverseFlops_ += X.NumVectors() * 2 * Matrix_->NumGlobalRows64();
682 IFPACK_CHK_ERR(DoJacobi(AX,Y));
695 int NumVectors = X.NumVectors();
697 if (OverlapLevel_ == 0) {
699 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
701 int rows = Partitioner_->NumRowsInPart(i);
710 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
711 LID = Containers_[i]->ID(j);
712 for (
int k = 0 ; k < NumVectors ; ++k) {
713 Containers_[i]->RHS(j,k) = X[k][LID];
721 IFPACK_CHK_ERR(Containers_[i]->ApplyInverse());
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 Y[k][LID] += DampingFactor_ * Containers_[i]->LHS(j,k);
733 int LRID = (*Partitioner_)(i,0);
734 double b = X[0][LRID];
735 double a = Diagonal_[LRID];
736 Y[0][LRID] += DampingFactor_* b/a;
740 #ifdef IFPACK_FLOPCOUNTERS
741 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalRows();
748 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
750 int rows = Partitioner_->NumRowsInPart(i);
759 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
760 LID = Containers_[i]->ID(j);
761 for (
int k = 0 ; k < NumVectors ; ++k) {
762 Containers_[i]->RHS(j,k) = (*W_)[LID] * X[k][LID];
768 IFPACK_CHK_ERR(Containers_[i]->ApplyInverse());
771 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
772 LID = Containers_[i]->ID(j);
773 for (
int k = 0 ; k < NumVectors ; ++k) {
774 Y[k][LID] += DampingFactor_ * (*W_)[LID] * Containers_[i]->LHS(j,k);
779 int LRID = (*Partitioner_)(i,0);
780 double w = (*W_)[LRID];
781 double b = w * X[0][LRID];
782 double a = Diagonal_[LRID];
784 Y[0][LRID] += DampingFactor_ * w * b / a;
790 #ifdef IFPACK_FLOPCOUNTERS
791 ApplyInverseFlops_ += NumVectors * 4 * Matrix_->NumGlobalRows();
805 if (ZeroStartingSolution_)
809 for (
int j = 0; j < NumSweeps_ ; j++) {
810 IFPACK_CHK_ERR(DoGaussSeidel(Xcopy,Y));
811 if (j != NumSweeps_ - 1)
828 std::vector<int> Indices(Length);
829 std::vector<double> Values(Length);
832 int NumVectors = X.NumVectors();
837 Teuchos::RefCountPtr< Epetra_MultiVector > Y2;
841 Y2 = Teuchos::rcp( &Y,
false );
845 Y.ExtractView(&y_ptr);
846 Y2->ExtractView(&y2_ptr);
850 IFPACK_CHK_ERR(Y2->Import(Y,*Importer_,Insert));
852 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
853 int rows = Partitioner_->NumRowsInPart(i);
856 if (rows!=1 && Containers_[i]->NumRows() == 0)
863 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
864 LID = (*Partitioner_)(i,j);
867 IFPACK_CHK_ERR(Matrix().ExtractMyRowCopy(LID, Length,NumEntries,
868 &Values[0], &Indices[0]));
870 for (
int k = 0 ; k < NumEntries ; ++k) {
871 int col = Indices[k];
873 for (
int kk = 0 ; kk < NumVectors ; ++kk) {
874 X[kk][LID] -= Values[k] * y2_ptr[kk][col];
882 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
883 LID = Containers_[i]->ID(j);
884 for (
int k = 0 ; k < NumVectors ; ++k) {
885 Containers_[i]->RHS(j,k) = X[k][LID];
889 IFPACK_CHK_ERR(Containers_[i]->ApplyInverse());
890 #ifdef IFPACK_FLOPCOUNTERS
891 ApplyInverseFlops_ += Containers_[i]->ApplyInverseFlops();
894 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
895 LID = Containers_[i]->ID(j);
896 for (
int k = 0 ; k < NumVectors ; ++k) {
897 double temp = DampingFactor_ * Containers_[i]->LHS(j,k);
898 y2_ptr[k][LID] += temp;
903 int LRID = (*Partitioner_)(i,0);
904 double b = X[0][LRID];
905 double a = Diagonal_[LRID];
906 y2_ptr[0][LRID]+= DampingFactor_* b/a;
912 #ifdef IFPACK_FLOPCOUNTERS
913 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalNonzeros();
914 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalRows();
920 for (
int m = 0 ; m < NumVectors ; ++m)
921 for (
int i = 0 ; i < NumMyRows ; ++i)
922 y_ptr[m][i] = y2_ptr[m][i];
933 if (ZeroStartingSolution_)
937 for (
int j = 0; j < NumSweeps_ ; j++) {
938 IFPACK_CHK_ERR(DoSGS(X,Xcopy,Y));
939 if (j != NumSweeps_ - 1)
953 int NumVectors = X.NumVectors();
956 std::vector<int> Indices;
957 std::vector<double> Values;
958 Indices.resize(Length);
959 Values.resize(Length);
964 Teuchos::RefCountPtr< Epetra_MultiVector > Y2;
968 Y2 = Teuchos::rcp( &Y,
false );
972 Y.ExtractView(&y_ptr);
973 Y2->ExtractView(&y2_ptr);
977 IFPACK_CHK_ERR(Y2->Import(Y,*Importer_,Insert));
979 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
980 int rows = Partitioner_->NumRowsInPart(i);
982 if (rows !=1 && Containers_[i]->NumRows() == 0)
989 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
990 LID = (*Partitioner_)(i,j);
992 IFPACK_CHK_ERR(Matrix().ExtractMyRowCopy(LID, Length,NumEntries,
993 &Values[0], &Indices[0]));
995 for (
int k = 0 ; k < NumEntries ; ++k) {
996 int col = Indices[k];
998 for (
int kk = 0 ; kk < NumVectors ; ++kk) {
999 Xcopy[kk][LID] -= Values[k] * y2_ptr[kk][col];
1007 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
1008 LID = Containers_[i]->ID(j);
1009 for (
int k = 0 ; k < NumVectors ; ++k) {
1010 Containers_[i]->RHS(j,k) = Xcopy[k][LID];
1014 IFPACK_CHK_ERR(Containers_[i]->ApplyInverse());
1015 #ifdef IFPACK_FLOPCOUNTERS
1016 ApplyInverseFlops_ += Containers_[i]->ApplyInverseFlops();
1019 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
1020 LID = Containers_[i]->ID(j);
1021 for (
int k = 0 ; k < NumVectors ; ++k) {
1022 y2_ptr[k][LID] += DampingFactor_ * Containers_[i]->LHS(j,k);
1027 int LRID = (*Partitioner_)(i,0);
1028 double b = Xcopy[0][LRID];
1029 double a = Diagonal_[LRID];
1030 y2_ptr[0][LRID]+= DampingFactor_* b/a;
1034 #ifdef IFPACK_FLOPCOUNTERS
1036 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalNonzeros();
1037 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalRows();
1042 for (
int i = NumLocalBlocks() - 1; i >=0 ; --i) {
1043 int rows = Partitioner_->NumRowsInPart(i);
1044 if (rows != 1 &&Containers_[i]->NumRows() == 0)
1051 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
1052 LID = (*Partitioner_)(i,j);
1055 IFPACK_CHK_ERR(Matrix().ExtractMyRowCopy(LID, Length,NumEntries,
1056 &Values[0], &Indices[0]));
1058 for (
int k = 0 ; k < NumEntries ; ++k) {
1059 int col = Indices[k];
1061 for (
int kk = 0 ; kk < NumVectors ; ++kk) {
1062 Xcopy[kk][LID] -= Values[k] * y2_ptr[kk][col];
1069 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
1070 LID = Containers_[i]->ID(j);
1071 for (
int k = 0 ; k < NumVectors ; ++k) {
1072 Containers_[i]->RHS(j,k) = Xcopy[k][LID];
1076 IFPACK_CHK_ERR(Containers_[i]->ApplyInverse());
1077 #ifdef IFPACK_FLOPCOUNTERS
1078 ApplyInverseFlops_ += Containers_[i]->ApplyInverseFlops();
1081 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
1082 LID = Containers_[i]->ID(j);
1083 for (
int k = 0 ; k < NumVectors ; ++k) {
1084 y2_ptr[k][LID] += DampingFactor_ * Containers_[i]->LHS(j,k);
1089 int LRID = (*Partitioner_)(i,0);
1090 double b = Xcopy[0][LRID];
1091 double a = Diagonal_[LRID];
1092 y2_ptr[0][LRID]+= DampingFactor_* b/a;
1096 #ifdef IFPACK_FLOPCOUNTERS
1098 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalNonzeros();
1099 ApplyInverseFlops_ += NumVectors * 2 * Matrix_->NumGlobalRows();
1105 for (
int m = 0 ; m < NumVectors ; ++m)
1106 for (
int i = 0 ; i < NumMyRows ; ++i)
1107 y_ptr[m][i] = y2_ptr[m][i];
1113 template<
typename T>
1119 if (PrecType_ == IFPACK_JACOBI)
1121 else if (PrecType_ == IFPACK_GS)
1122 PT =
"Gauss-Seidel";
1123 else if (PrecType_ == IFPACK_SGS)
1124 PT =
"symmetric Gauss-Seidel";
1126 if (!Comm().MyPID()) {
1128 os <<
"================================================================================" << endl;
1129 os <<
"Ifpack_BlockRelaxation, " << PT << endl;
1130 os <<
"Sweeps = " << NumSweeps_ << endl;
1131 os <<
"Damping factor = " << DampingFactor_;
1132 if (ZeroStartingSolution_)
1133 os <<
", using zero starting solution" << endl;
1135 os <<
", using input starting solution" << endl;
1136 os <<
"Number of local blocks = " << Partitioner_->NumLocalParts() << endl;
1138 os <<
"Global number of rows = " << Matrix_->NumGlobalRows64() << endl;
1140 os <<
"Phase # calls Total Time (s) Total MFlops MFlops/s" << endl;
1141 os <<
"----- ------- -------------- ------------ --------" << endl;
1142 os <<
"Initialize() " << std::setw(5) << NumInitialize()
1143 <<
" " << std::setw(15) << InitializeTime()
1144 <<
" " << std::setw(15) << 1.0e-6 * InitializeFlops();
1145 if (InitializeTime() != 0.0)
1146 os <<
" " << std::setw(15) << 1.0e-6 * InitializeFlops() / InitializeTime() << endl;
1148 os <<
" " << std::setw(15) << 0.0 << endl;
1149 os <<
"Compute() " << std::setw(5) << NumCompute()
1150 <<
" " << std::setw(15) << ComputeTime()
1151 <<
" " << std::setw(15) << 1.0e-6 * ComputeFlops();
1152 if (ComputeTime() != 0.0)
1153 os <<
" " << std::setw(15) << 1.0e-6 * ComputeFlops() / ComputeTime() << endl;
1155 os <<
" " << std::setw(15) << 0.0 << endl;
1156 os <<
"ApplyInverse() " << std::setw(5) << NumApplyInverse()
1157 <<
" " << std::setw(15) << ApplyInverseTime()
1158 <<
" " << std::setw(15) << 1.0e-6 * ApplyInverseFlops();
1159 if (ApplyInverseTime() != 0.0)
1160 os <<
" " << std::setw(15) << 1.0e-6 * ApplyInverseFlops() / ApplyInverseTime() << endl;
1162 os <<
" " << std::setw(15) << 0.0 << endl;
1163 os <<
"================================================================================" << endl;
1171 template<
typename T>
1178 if (PrecType_ == IFPACK_JACOBI)
1180 else if (PrecType_ == IFPACK_GS)
1181 PT =
"Gauss-Seidel";
1182 else if (PrecType_ == IFPACK_SGS)
1183 PT =
"symmetric Gauss-Seidel";
1185 PT = List.get(
"relaxation: type", PT);
1187 if (PT ==
"Jacobi") {
1188 PrecType_ = IFPACK_JACOBI;
1190 else if (PT ==
"Gauss-Seidel") {
1191 PrecType_ = IFPACK_GS;
1193 else if (PT ==
"symmetric Gauss-Seidel") {
1194 PrecType_ = IFPACK_SGS;
1196 cerr <<
"Option `relaxation: type' has an incorrect value ("
1197 << PT <<
")'" << endl;
1198 cerr <<
"(file " << __FILE__ <<
", line " << __LINE__ <<
")" << endl;
1202 NumSweeps_ = List.get(
"relaxation: sweeps", NumSweeps_);
1203 DampingFactor_ = List.get(
"relaxation: damping factor",
1205 ZeroStartingSolution_ = List.get(
"relaxation: zero starting solution",
1206 ZeroStartingSolution_);
1207 PartitionerType_ = List.get(
"partitioner: type",
1209 NumLocalBlocks_ = List.get(
"partitioner: local parts",
1212 OverlapLevel_ = List.get(
"partitioner: overlap",
1216 if (PrecType_ != IFPACK_JACOBI)
1218 if (NumLocalBlocks_ < 0)
1219 NumLocalBlocks_ = Matrix().
NumMyRows() / (-NumLocalBlocks_);
1228 if (PrecType_ == IFPACK_JACOBI)
1230 else if (PrecType_ == IFPACK_GS)
1232 else if (PrecType_ == IFPACK_SGS)
1234 Label_ =
"IFPACK (" + PT2 +
", sweeps="
1243 template<
typename T>
1246 IsInitialized_ =
false;
1247 Time_.ResetStartTime();
1250 if (Graph_ == Teuchos::null) IFPACK_CHK_ERR(-5);
1252 if (PartitionerType_ ==
"linear")
1254 else if (PartitionerType_ ==
"greedy")
1256 else if (PartitionerType_ ==
"metis")
1258 else if (PartitionerType_ ==
"equation")
1260 else if (PartitionerType_ ==
"user")
1262 else if (PartitionerType_ ==
"line")
1267 if (Partitioner_ == Teuchos::null) IFPACK_CHK_ERR(-5);
1270 IFPACK_CHK_ERR(Partitioner_->SetParameters(List_));
1271 IFPACK_CHK_ERR(Partitioner_->Compute());
1274 NumLocalBlocks_ = Partitioner_->NumLocalParts();
1277 W_ = Teuchos::rcp(
new Epetra_Vector(Matrix().RowMatrixRowMap()) );
1280 for (
int i = 0 ; i < NumLocalBlocks() ; ++i) {
1282 for (
int j = 0 ; j < Partitioner_->NumRowsInPart(i) ; ++j) {
1283 int LID = (*Partitioner_)(i,j);
1287 W_->Reciprocal(*W_);
1290 if (PartitionerType_ ==
"line") {
1293 if (PrecType_ == IFPACK_JACOBI)
1295 else if (PrecType_ == IFPACK_GS)
1297 else if (PrecType_ == IFPACK_SGS)
1299 Label_ =
"IFPACK (" + PT2 +
", auto-line, sweeps="
1305 InitializeTime_ += Time_.ElapsedTime();
1306 IsInitialized_ =
true;
1313 #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.
int NumLocalBlocks() const
Returns the number local blocks.
virtual bool IsComputed() const
Returns true if the preconditioner has been successfully computed.
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 Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const =0
virtual int MaxNumEntries() const =0
virtual const Epetra_Comm & Comm() const =0
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.
virtual int NumMyRows() const =0
Ifpack_Graph_Epetra_RowMatrix: a class to define Ifpack_Graph as a light-weight conversion of Epetra_...
std::ostream & Print(std::ostream &os) const
Prints basic information on iostream. This function is used by operator<<.
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 InitializeTime() const
Returns the time spent in Initialize().
virtual int NumProc() const =0
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 Condest(const Ifpack_CondestType=Ifpack_Cheap, const int=1550, const double=1e-9, Epetra_RowMatrix *=0)
Computes the condition number estimate, returns its value.
virtual double NormInf() const
Returns the infinity norm of the global matrix (not implemented)
std::string Ifpack_toString(const int &x)
Converts an integer to std::string.
Ifpack_GreedyPartitioner: A class to decompose Ifpack_Graph's using a simple greedy algorithm...