54#include "Teuchos_ParameterList.hpp"
100 Teuchos::ParameterList RHSList(rhs.
List());
143 if (
Comm().NumProc() != 1) {
144 cout <<
"Class Ifpack_Amesos must be used for serial runs;" << endl;
145 cout <<
"for parallel runs you should declare objects as:" << endl;
146 cout <<
"Ifpack_AdditiveSchwarz<Ifpack_Amesos> APrec(Matrix)" << endl;
156 if (
Matrix_->NumGlobalRows64() == 0) {
166 if (
Time_ == Teuchos::null)
185 cerr <<
"IFPACK WARNING: In class Ifpack_Amesos:" << endl;
186 cerr <<
"IFPACK WARNING: Using LAPACK because other Amesos" << endl;
187 cerr <<
"IFPACK WARNING: solvers are not available. LAPACK" << endl;
188 cerr <<
"IFPACK WARNING: allocates memory to store the matrix as" << endl;
189 cerr <<
"IFPACK WARNING: dense, I hope you have enough memory..." << endl;
190 cerr <<
"IFPACK WARNING: (file " << __FILE__ <<
", line " << __LINE__
225 Time_->ResetStartTime();
274 Time_->ResetStartTime();
278 Teuchos::RefCountPtr<const Epetra_MultiVector> Xcopy;
282 Xcopy = Teuchos::rcp( &X,
false );
303 return((
char*)
Label_.c_str());
327 return(
Matrix_->OperatorDomainMap());
333 return(
Matrix_->OperatorRangeMap());
338 const int MaxIters,
const double Tol,
356 if (!
Comm().MyPID()) {
358 os <<
"================================================================================" << endl;
359 os <<
"Ifpack_Amesos: " <<
Label () << endl << endl;
360 os <<
"Condition number estimate = " <<
Condest() << endl;
361 os <<
"Global number of rows = " <<
Matrix_->NumGlobalRows64() << endl;
363 os <<
"Phase # calls Total Time (s) Total MFlops MFlops/s" << endl;
364 os <<
"----- ------- -------------- ------------ --------" << endl;
367 <<
" 0.0 0.0" << endl;
374 os <<
" " << std::setw(15) << 0.0 << endl;
381 os <<
" " << std::setw(15) << 0.0 << endl;
382 os <<
"================================================================================" << endl;
Ifpack_CondestType
Ifpack_CondestType: enum to define the type of condition number estimate.
double Ifpack_Condest(const Ifpack_Preconditioner &IFP, const Ifpack_CondestType CT, const int MaxIters, const double Tol, Epetra_RowMatrix *Matrix)
#define IFPACK_CHK_ERR(ifpack_err)
Amesos_BaseSolver * Create(const char *ClassType, const Epetra_LinearProblem &LinearProblem)
double ** Pointers() const
Teuchos::RefCountPtr< Amesos_BaseSolver > Solver_
Amesos solver, use to apply the inverse of the local matrix.
Teuchos::RefCountPtr< Epetra_Time > Time_
Time object.
double ComputeFlops_
Contains the number of flops for Compute().
int NumInitialize_
Contains the number of successful calls to Initialize().
double Condest_
Contains the estimated condition number.
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Applies the matrix to an Epetra_MultiVector.
virtual double ComputeFlops() const
Returns the total number of flops to computate the preconditioner.
virtual int NumApplyInverse() const
Returns the number of calls to ApplyInverse().
Teuchos::ParameterList List_
Contains a copy of the input parameter list.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
virtual const Teuchos::ParameterList & List() const
double ComputeTime_
Contains the time for all successful calls to Compute().
double InitializeTime_
Contains the time for all successful calls to Initialize().
int NumCompute_
Contains the number of successful call to Compute().
virtual double InitializeTime() const
Returns the total time spent in Initialize().
virtual double Condest(const Ifpack_CondestType CT=Ifpack_Cheap, const int MaxIters=1550, const double Tol=1e-9, Epetra_RowMatrix *Matrix_in=0)
Returns the estimated condition number, computes it if necessary.
virtual const char * Label() const
Returns a character string describing the operator.
virtual int Initialize()
Initializes the preconditioners.
virtual int Compute()
Computes the preconditioners.
virtual double ApplyInverseFlops() const
Returns the total number of flops to apply the preconditioner.
virtual int NumCompute() const
Returns the number of calls to Compute().
std::string Label_
Contains the label of this object.
virtual int SetUseTranspose(bool UseTranspose_in)
If set true, transpose of this operator will be applied (not implemented).
virtual double ApplyInverseTime() const
Returns the total time spent in ApplyInverse().
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Applies the preconditioner to X, returns the result in Y.
bool IsEmpty_
If true, the linear system on this processor is empty, thus the preconditioner is null operation.
virtual int SetParameters(Teuchos::ParameterList &List)
Sets all the parameters for the preconditioner.
virtual bool IsComputed() const
Returns true if the preconditioner has been successfully computed.
virtual int NumInitialize() const
Returns the number of calls to Initialize().
double ApplyInverseTime_
Contains the time for all successful calls to ApplyInverse().
virtual double ComputeTime() const
Returns the total time spent in Compute().
Teuchos::RefCountPtr< Epetra_LinearProblem > Problem_
Linear problem required by Solver_.
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
virtual double Condest() const
Returns the estimated condition number, never computes it.
bool IsInitialized_
If true, the preconditioner has been successfully initialized.
Ifpack_Amesos(Epetra_RowMatrix *Matrix)
Constructor.
virtual std::ostream & Print(std::ostream &os) const
Prints on ostream basic information about this object.
bool IsComputed_
If true, the preconditioner has been successfully computed.
double ApplyInverseFlops_
Contain sthe number of flops for ApplyInverse().
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
virtual const Epetra_RowMatrix & Matrix() const
Returns a const reference to the internally stored matrix.
virtual double NormInf() const
Returns the infinity norm of the global matrix (not implemented).
bool UseTranspose_
If true, the preconditioner solves for the transpose of the matrix.
virtual const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
Teuchos::RefCountPtr< const Epetra_RowMatrix > Matrix_
Pointers to the matrix to be preconditioned.
int NumApplyInverse_
Contains the number of successful call to ApplyInverse().
virtual bool IsInitialized() const
Returns true is the preconditioner has been successfully initialized.