Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Common::LinearSolverTestBase< MV, OP, NormType > Class Template Referenceabstract

#include <Common.hpp>

Inheritance diagram for Common::LinearSolverTestBase< MV, OP, NormType >:
Inheritance graph
[legend]

Public Member Functions

virtual ~LinearSolverTestBase ()
 
void setMatrix (const Teuchos::RCP< const OP > &A)
 Set the solver's matrix. More...
 
Teuchos::RCP< const OP > getMatrix () const
 Get a pointer to this solver's matrix. More...
 
void setParameters (const Teuchos::RCP< Teuchos::ParameterList > &)
 Set this solver's parameters. More...
 
void symbolic ()
 Set up any part of the solve that depends on the structure of the input matrix, but not its numerical values. More...
 
void numeric ()
 Set up any part of the solve that depends on both the structure and the numerical values of the input matrix. More...
 
- Public Member Functions inherited from Trilinos::Details::LinearSolver< MV, OP, NormType >
virtual ~LinearSolver ()
 Destructor (virtual for memory safety of derived classes). More...
 
virtual void solve (MV &X, const MV &B)=0
 Solve the linear system(s) AX=B. More...
 

Protected Member Functions

virtual std::string name () const =0
 

Private Attributes

Teuchos::RCP< const OP > A_
 

Detailed Description

template<class MV, class OP, class NormType>
class Common::LinearSolverTestBase< MV, OP, NormType >

Definition at line 39 of file Common.hpp.

Constructor & Destructor Documentation

template<class MV , class OP , class NormType >
virtual Common::LinearSolverTestBase< MV, OP, NormType >::~LinearSolverTestBase ( )
inlinevirtual

Definition at line 44 of file Common.hpp.

Member Function Documentation

template<class MV , class OP , class NormType >
virtual std::string Common::LinearSolverTestBase< MV, OP, NormType >::name ( ) const
protectedpure virtual
template<class MV , class OP , class NormType >
void Common::LinearSolverTestBase< MV, OP, NormType >::setMatrix ( const Teuchos::RCP< const OP > &  A)
inlinevirtual

Set the solver's matrix.

Parameters
A[in] Pointer to the matrix A in the linear system(s) AX=B to solve.

This LinearSolver instance keeps the matrix (by pointer) given to it by this method, and does not modify it. The solver stores any additional data needed for solves separately from the matrix.

Calling this method resets the solver's state. After calling this method, you must call symbolic() and numeric() before you may call solve().

You are allowed to change the structure and/or numerical values in the matrix that this LinearSolver instance holds. If you do so, you do NOT need to call this method. If you change the graph structure of the matrix, you must call symbolic() and numeric() before you may call solve(). If you change the numerical values but not the graph structure of the matrix, you must call numeric() before you may call solve().

Teuchos::RCP is just like std::shared_ptr. It uses reference counting for automatic deallocation. Passing in a "const OP" implies that the solver may not modify A.

Implements Trilinos::Details::LinearSolver< MV, OP, NormType >.

Definition at line 46 of file Common.hpp.

template<class MV , class OP , class NormType >
Teuchos::RCP<const OP> Common::LinearSolverTestBase< MV, OP, NormType >::getMatrix ( ) const
inlinevirtual

Get a pointer to this solver's matrix.

If this LinearSolver instance does not (yet) have a matrix, this method will return Teuchos::null. The solver must have a matrix before you may call solve().

Teuchos::RCP is just like std::shared_ptr. It uses reference counting for automatic deallocation. Returning a "const OP" implies that the caller may not modify A.

Implements Trilinos::Details::LinearSolver< MV, OP, NormType >.

Definition at line 51 of file Common.hpp.

template<class MV , class OP , class NormType >
void Common::LinearSolverTestBase< MV, OP, NormType >::setParameters ( const Teuchos::RCP< Teuchos::ParameterList > &  params)
inlinevirtual

Set this solver's parameters.

Depending on the solver and which parameters you set or changed, you may have to recompute the symbolic or numeric setup (by calling symbolic() resp. numeric()) after calling setParameters(), before you may call solve() again.

Different solver implementations have different ideas about how to treat parameters. Some of them (like those in Ifpack2) treat the input parameter list as a complete snapshot of the desired state. Many that do this also fill the input list with unspecified parameters set to default values. Other solvers (like those in Belos) treat the input list as a "delta" – a set of changes from the current state – and thus generally do not fill in the input list.

This interface is compatible with either variant. The solver reserves the right to modify the input list, or to keep a pointer to the input list. Callers are responsible for copying the list if they don't want the solver to see changes, or if the Teuchos::RCP is nonowning. Users are responsible for knowing how the different solvers behave.

Implements Trilinos::Details::LinearSolver< MV, OP, NormType >.

Definition at line 56 of file Common.hpp.

template<class MV , class OP , class NormType >
void Common::LinearSolverTestBase< MV, OP, NormType >::symbolic ( )
inlinevirtual

Set up any part of the solve that depends on the structure of the input matrix, but not its numerical values.

If the structure of the matrix has changed, or if you have not yet called this method on this LinearSolver instance, then you must call this method before you may call numeric() or solve().

There is no way that the solver can tell users whether the symbolic factorization is "done," because the solver may have no way to know whether the structure of the matrix has changed. Users are responsible for notifying the solver of structure changes, by calling symbolic(). (This is why there is no "symbolicDone" Boolean method.)

Note
To developers: If you find it necessary to separate "preordering" from the symbolic factorization, you may use a mix-in for that.

Implements Trilinos::Details::LinearSolver< MV, OP, NormType >.

Definition at line 60 of file Common.hpp.

template<class MV , class OP , class NormType >
void Common::LinearSolverTestBase< MV, OP, NormType >::numeric ( )
inlinevirtual

Set up any part of the solve that depends on both the structure and the numerical values of the input matrix.

If any values in the matrix have changed, or if you have not yet called this method on this LinearSolver instance, then you must call this method before you may call solve().

There is no way that the solver can tell users whether the numeric factorization is "done," because the solver may have no way to know whether the values of the matrix has changed. Users are responsible for notifying the solver of changes to values, by calling numeric(). (This is why there is no "numericDone" Boolean method.)

Implements Trilinos::Details::LinearSolver< MV, OP, NormType >.

Definition at line 64 of file Common.hpp.

Member Data Documentation

template<class MV , class OP , class NormType >
Teuchos::RCP<const OP> Common::LinearSolverTestBase< MV, OP, NormType >::A_
private

Definition at line 69 of file Common.hpp.


The documentation for this class was generated from the following file: