43 #include "Ifpack_ConfigDefs.h"
44 #include "Ifpack_Condest.h"
45 #include "Ifpack_CondestType.h"
46 #include "Ifpack_Preconditioner.h"
47 #include "Epetra_Vector.h"
48 #include "Epetra_LinearProblem.h"
49 #include "Epetra_Map.h"
50 #include "Epetra_RowMatrix.h"
51 #ifdef HAVE_IFPACK_AZTECOO
56 const Ifpack_CondestType CT,
61 double ConditionNumberEstimate = -1.0;
63 if (CT == Ifpack_Cheap) {
73 IFPACK_CHK_ERR(OnesResult.Abs(OnesResult));
75 IFPACK_CHK_ERR(OnesResult.MaxValue(&ConditionNumberEstimate));
78 else if (CT == Ifpack_CG) {
80 #ifdef HAVE_IFPACK_AZTECOO
93 AztecOO Solver(Problem);
94 Solver.SetAztecOption(AZ_output,AZ_none);
95 Solver.SetAztecOption(AZ_solver,AZ_cg_condnum);
96 Solver.Iterate(MaxIters,Tol);
98 const double* status = Solver.GetAztecStatus();
99 ConditionNumberEstimate = status[AZ_condnum];
102 }
else if (CT == Ifpack_GMRES) {
104 #ifdef HAVE_IFPACK_AZTECOO
117 AztecOO Solver(Problem);
118 Solver.SetAztecOption(AZ_solver,AZ_gmres_condnum);
119 Solver.SetAztecOption(AZ_output,AZ_none);
123 Solver.SetAztecOption(AZ_kspace,MaxIters);
124 Solver.Iterate(MaxIters,Tol);
126 const double* status = Solver.GetAztecStatus();
127 ConditionNumberEstimate = status[AZ_condnum];
131 return(ConditionNumberEstimate);
void SetLHS(Epetra_MultiVector *X)
void SetOperator(Epetra_RowMatrix *A)
virtual const Epetra_RowMatrix & Matrix() const =0
Returns a pointer to the matrix to be preconditioned.
virtual const Epetra_Map & OperatorDomainMap() const =0
virtual const Epetra_Map & OperatorRangeMap() const =0
Ifpack_Preconditioner: basic class for preconditioning in Ifpack.
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const =0
Applies the preconditioner to vector X, returns the result in Y.
void SetRHS(Epetra_MultiVector *B)