

Public Member Functions | |
| def | __init__ |
| def | getParameterList |
| def | SymbolicFactorization |
| def | NumericFactorization |
| def | Solve |
| def | SetUseTranspose |
| def | UseTranspose |
| def | SetParameters |
| def | GetProblem |
| def | MatrixShapeOK |
| def | Comm |
| def | NumSymbolicFact |
| def | NumNumericFact |
| def | NumSolve |
| def | PrintStatus |
| def | PrintTiming |
| def | setParameterList |
| def | getNonconstParameterList |
| def | unsetParameterList |
| def | GetTiming |
Amesos_BaseSolver: A pure virtual class for direct solution of real-
valued double- precision operators.
Pure virtual class for all Amesos concrete implementions.
The Amesos_BaseSolver class is a pure virtual class (that is, it
specifies interface only) that enables the use of real-valued double-
precision direct sparse solvers. Every Amesos class named Amesos_
SolverName derives from Amesos_BaseSolver.
Usage Examples
Basic calling sequence
The basic calling sequence solves A x = b or AT x = b without
specifying how A has changed between each call to Solve().
Re-using the symbolic factorization
The following calling sequence performs multiple solves of A x = b or
AT x = b in cases where the non-zero structure of A remains unchanged
between each call to Solve().
Re-using the numeric factorization
The following calling sequence performs multiple solves of A x = b or
AT x = b provided that A remains unchanged between each call to
Solve().
Constructor requirements
Every Amesos_SolverName class should accept an Epetra_LinearProblem
Mathematical methods
Four mathematical methods are defined in the base class
Amesos_BaseSolver: SymbolicFactorization(), NumericFactorization(),
and Solve().
Switching concrete classes
Different concrete classes, each based on a different third party
solver, will have different performance characteristics and will
accept different parameters.
Changing the values of the underlying matrix operator.
Any changes to the values of a matrix must be accompanied by a call to
NumericFactorization() before the next call to Solve() or the behavior
of Solve() is undefined. Any changes to the numerical structure of the
matrix must be followed by a call to SymbolicFactorization() and
NumericalFactorization() before the next call to Solve().
Once SymbolicFactorization() has been called, classes implementing
this interface may assume that any change made to the non-zero
structure of the underlying matrix will be accompanied by a call to
SymbolicFactorization() prior to a subsequent call to
NumericFactorization or Solve().
Named Parameters
Parameters can be changed or added at any time by calling
SetParameters(ParamList) with the new parameters specified in
ParamList.
It is left to the user to be sure that changes made to the parameters
are appropriate for the concrete class that they are using.
Examples of appropriate changes in parameters include: Changing
iterative refinement rules between calls to Solve()
Changing drop tolerance rules between calls to NumericFactorization()
Examples of inappropriate changes in parameters include: Changing
drop tolerance rules between solve steps.
Solver.NumericFactorization();
Solver.getList()->set("DropTolerance",.001); Solver.Solve();
Results of making inappropriate changes in parameters is unpredictable
and could include an error return, a bogus result or ignoring the
parameter change.
Transpose solve
Any class implementing Amesos_BaseSolver should handle calls to
SetUseTranspose() at any point. However, the result of a call to
SetUseTranspose() which is not followed by a call to
SymbolicFactorization() and NumericFactorization() is implementation
dependent. Some third party libraries are able to solve AT x = b and
Ax = b using the same factorization. Others will require a new
factorization anytime that a call to SetUseTranspose() changes the
intended solve from AT x = b to Ax = b or vice-versa.
Performance expectations
The following is a list of performance guidelines that classes which
implement the Amesos_BaseSolver class are expected to maintain.
Memory usage:
For serial codes, no more than one extra copy of the original matrix
should be required. Except that some codes require matrix transpostion
which requires additional copies of the input matrix.
For distributed memory codes, no serial copies of the original matrix
should be required.
Robustness requirements
Failures should be caught by AMESOS_CHK_ERR(). The following error
codes should be used: 1: Singular matrix
2: Non-symmetric matrix
3: Matrix is not positive definite
4: Insufficient memory
Because we do not check to see if a matrix has changed between the
call to SymbolicFactorization() and the call to
NumericFactorization(), it is possible that a change to the matrix
will cause a potentially catastrophic error.
C++ includes: Amesos_BaseSolver.h
| def PyTrilinos.Amesos.BaseSolver.Comm | ( | self, | |
| args | |||
| ) |
Comm(BaseSolver self) -> Comm virtual const Epetra_Comm& Amesos_BaseSolver::Comm() const =0 Returns a pointer to the Epetra_Comm communicator associated with this operator.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.getNonconstParameterList | ( | self, | |
| args | |||
| ) |
getNonconstParameterList(BaseSolver self) -> Teuchos::RCP< Teuchos::ParameterList > virtual Teuchos::RCP<Teuchos::ParameterList> Amesos_BaseSolver::getNonconstParameterList() This is an empty stub.
Reimplemented from PyTrilinos.Teuchos.ParameterListAcceptor.
| def PyTrilinos.Amesos.BaseSolver.getParameterList | ( | self, | |
| args | |||
| ) |
getParameterList(BaseSolver self) -> Teuchos::RCP< Teuchos::ParameterList const > Teuchos::RCP< const Teuchos::ParameterList > Teuchos::ParameterListAcceptor::getParameterList() const Get const version of the parameter list that was set using setParameterList(). The default implementation returns:
Reimplemented from PyTrilinos.Teuchos.ParameterListAcceptor.
| def PyTrilinos.Amesos.BaseSolver.GetProblem | ( | self, | |
| args | |||
| ) |
GetProblem(BaseSolver self) -> LinearProblem virtual const Epetra_LinearProblem* Amesos_BaseSolver::GetProblem() const =0 Returns the Epetra_LinearProblem. Warning! Do not call return->SetOperator(...) to attempt to change the Epetra_Operator object (even if the new matrix has the same structure). This new operator matrix will be ignored!
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.GetTiming | ( | self, | |
| args | |||
| ) |
GetTiming(BaseSolver self, ParameterList TimingParameterList) virtual void Amesos_BaseSolver::GetTiming(Teuchos::ParameterList &TimingParameterList) const Extracts timing information from the current solver and places it in the parameter list.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.MatrixShapeOK | ( | self, | |
| args | |||
| ) |
MatrixShapeOK(BaseSolver self) -> bool virtual bool Amesos_BaseSolver::MatrixShapeOK() const =0 Returns true if the solver can handle this matrix shape. Returns true if the matrix shape is one that the underlying sparse direct solver can handle. Classes that work only on square matrices should return false for rectangular matrices. Classes that work only on symmetric matrices whould return false for non-symmetric matrices.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.NumericFactorization | ( | self, | |
| args | |||
| ) |
NumericFactorization(BaseSolver self) -> int virtual int Amesos_BaseSolver::NumericFactorization()=0 Performs NumericFactorization on the matrix A. In addition to performing numeric factorization on the matrix A, the call to NumericFactorization() implies that no change will be made to the underlying matrix without a subsequent call to NumericFactorization(). <br >Preconditions: GetProblem().GetOperator() != 0 (return -1) MatrixShapeOk( GetProblem().GetOperator()) == true (return -6) The non-zero structure of the matrix should not have changed since the last call to SymbolicFactorization(). (return -2 if the number of non- zeros changes) Other changes can have arbitrary consequences. The distribution of the matrix should not have changed since the last call to SymbolicFactorization() The matrix should be indexed from 0 to n-1, unless the parameter "Reindex" was set to "true" prior to the call to SymbolicFactorization(). (return -3 - if caught) The paremeter "Reindex" should not be set to "true" except on CrsMatrices. (return -4) The paremeter "Reindex" should not be set to "true" unless Amesos was built with EpetraExt, i.e. with --enable-epetraext on the configure line. (return -4) Internal errors retur -5. <br >Postconditions: Numeric Factorization will be performed (or marked to be performed) allowing Solve() to be performed correctly despite a potential change in in the matrix values (though not in the non-zero structure). Integer error code, set to 0 if successful.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.NumNumericFact | ( | self, | |
| args | |||
| ) |
NumNumericFact(BaseSolver self) -> int virtual int Amesos_BaseSolver::NumNumericFact() const =0 Returns the number of numeric factorizations performed by this object.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.NumSolve | ( | self, | |
| args | |||
| ) |
NumSolve(BaseSolver self) -> int virtual int Amesos_BaseSolver::NumSolve() const =0 Returns the number of solves performed by this object.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.NumSymbolicFact | ( | self, | |
| args | |||
| ) |
NumSymbolicFact(BaseSolver self) -> int virtual int Amesos_BaseSolver::NumSymbolicFact() const =0 Returns the number of symbolic factorizations performed by this object.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.PrintStatus | ( | self, | |
| args | |||
| ) |
PrintStatus(BaseSolver self) virtual void Amesos_BaseSolver::PrintStatus() const =0 Prints status information about the current solver.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.PrintTiming | ( | self, | |
| args | |||
| ) |
PrintTiming(BaseSolver self) virtual void Amesos_BaseSolver::PrintTiming() const =0 Prints timing information about the current solver.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.setParameterList | ( | self, | |
| args | |||
| ) |
setParameterList(BaseSolver self, Teuchos::RCP< Teuchos::ParameterList > const & paramList) virtual void Amesos_BaseSolver::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const ¶mList) Redefined from Teuchos::ParameterListAcceptor.
Reimplemented from PyTrilinos.Teuchos.ParameterListAcceptor.
Reimplemented in PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.SetParameters | ( | self, | |
| args | |||
| ) |
SetParameters(BaseSolver self, ParameterList ParameterList) -> int virtual int Amesos_BaseSolver::SetParameters(Teuchos::ParameterList &ParameterList)=0 Updates internal variables. <br >Preconditions: None. <br >Postconditions: Internal variables controlling the factorization and solve will be updated and take effect on all subseuent calls to NumericFactorization() and Solve(). All parameters whose value are to differ from the default values must be included in ParameterList. Parameters not specified in ParameterList revert to their default values. Integer error code, set to 0 if successful.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.SetUseTranspose | ( | self, | |
| args | |||
| ) |
SetUseTranspose(BaseSolver self, bool UseTranspose) -> int virtual int Amesos_BaseSolver::SetUseTranspose(bool UseTranspose)=0 If set true, X will be set to the solution of AT X = B (not A X = B) If the implementation of this interface does not support transpose use, this method should return a value of -1. <br >Preconditions: SetUseTranspose() should be called prior to the call to SymbolicFactorization() If NumericFactorization() or Solve() is called after SetUseTranspose() without an intervening call to SymbolicFactorization() the result is implementation dependent. <br >Postconditions: The next factorization and solve will be performed with the new value of UseTranspose. Parameters: ----------- UseTranspose: -- (In) If true, solve AT X = B, otherwise solve A X = B. Integer error code, set to 0 if successful. Set to -1 if this implementation does not support transpose.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.Solve | ( | self, | |
| args | |||
| ) |
Solve(BaseSolver self) -> int virtual int Amesos_BaseSolver::Solve()=0 Solves A X = B (or AT x = B) <br >Preconditions: GetProblem().GetOperator() != 0 (return -1) MatrixShapeOk( GetProblem().GetOperator()) == true (return -6) GetProblem()->CheckInput (see Epetra_LinearProblem::CheckInput() for return values) The non-zero structure of the matrix should not have changed since the last call to SymbolicFactorization(). The distribution of the matrix should not have changed since the last call to SymbolicFactorization() The matrix should not have changed since the last call to NumericFactorization(). <br >Postconditions: X will be set such that A X = B (or AT X = B), within the limits of the accuracy of the underlying solver. Integer error code, set to 0 if successful.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.SymbolicFactorization | ( | self, | |
| args | |||
| ) |
SymbolicFactorization(BaseSolver self) -> int virtual int Amesos_BaseSolver::SymbolicFactorization()=0 Performs SymbolicFactorization on the matrix A. In addition to performing symbolic factorization on the matrix A, the call to SymbolicFactorization() implies that no change will be made to the non-zero structure of the underlying matrix without a subsequent call to SymbolicFactorization(). <br >Preconditions: GetProblem().GetOperator() != 0 (return -1) MatrixShapeOk( GetProblem().GetOperator()) == true (return -6) <br >Postconditions: Symbolic Factorization will be performed (or marked to be performed) allowing NumericFactorization() and Solve() to be called. Integer error code, set to 0 if successful.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.unsetParameterList | ( | self, | |
| args | |||
| ) |
unsetParameterList(BaseSolver self) -> Teuchos::RCP< Teuchos::ParameterList > virtual Teuchos::RCP<Teuchos::ParameterList> Amesos_BaseSolver::unsetParameterList() This is an empty stub.
Reimplemented from PyTrilinos.Teuchos.ParameterListAcceptor.
Reimplemented in PyTrilinos.Amesos.Lapack.
| def PyTrilinos.Amesos.BaseSolver.UseTranspose | ( | self, | |
| args | |||
| ) |
UseTranspose(BaseSolver self) -> bool virtual bool Amesos_BaseSolver::UseTranspose() const =0 Returns the current UseTranspose setting.
Reimplemented in PyTrilinos.Amesos.Klu, and PyTrilinos.Amesos.Lapack.
1.7.6.1