Amesos2 - Direct Sparse Solver Interfaces Version of the Day
Public Types | Related Functions
Amesos2::Solver< Matrix, Vector > Class Template Reference

Interface to Amesos2 solver objects. More...

#include <Amesos2_Solver_decl.hpp>

Inheritance diagram for Amesos2::Solver< Matrix, Vector >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef Solver< Matrix, Vector > type

Public Member Functions

Mathematical Functions
virtual typepreOrdering (void)=0
 Pre-orders the matrix.
virtual typesymbolicFactorization (void)=0
 Performs symbolic factorization on the matrix.
virtual typenumericFactorization (void)=0
 Performs numeric factorization on the matrix.
virtual void solve (void)=0
 Solves $ A X = B$ (or $ A^T X = B$ )
virtual void solve (const Teuchos::Ptr< Vector > X, const Teuchos::Ptr< const Vector > B) const =0
 Solve $ A X = B$ using the given X and B vectors.
virtual void solve (Vector *X, const Vector *B) const =0
 Solve $ A X = B$ using the given X and B vectors.
Parameter Methods
virtual typesetParameters (const Teuchos::RCP< Teuchos::ParameterList > &parameterList)=0
 Set/update internal variables and solver options.
virtual Teuchos::RCP< const
Teuchos::ParameterList > 
getValidParameters (void) const =0
 Return a const parameter list of all of the valid parameters that this->setParameterList(...) will accept.
Accessor Methods
virtual void setA (const Teuchos::RCP< const Matrix > a, EPhase keep_phase=CLEAN)=0
 Sets the matrix A of this solver.
virtual void setA (const Matrix *a, EPhase keep_phase=CLEAN)=0
 Sets the matrix A of this solver.
virtual bool matrixShapeOK (void)=0
 Returns true if the solver can handle the matrix shape.
virtual void setX (const Teuchos::RCP< Vector > x)=0
 Sets the LHS vector X.
virtual void setX (Vector *x)=0
 Sets the LHS vector X using a raw pointer.
virtual const Teuchos::RCP
< Vector > 
getX (void)=0
 Returns the vector that is the LHS of the linear system.
virtual Vector * getXRaw (void)=0
 Returns a raw pointer to the LHS of the linear system.
virtual void setB (const Teuchos::RCP< const Vector > b)=0
 Sets the RHS vector B.
virtual void setB (const Vector *b)=0
 Sets the RHS vector B using a raw pointer.
virtual const Teuchos::RCP
< const Vector > 
getB (void)=0
 Returns the vector that is the RHS of the linear system.
virtual const Vector * getBRaw (void)=0
 Returns a raw pointer to the RHS of the linear system.
virtual Teuchos::RCP< const
Teuchos::Comm< int > > 
getComm (void) const =0
 Returns a pointer to the Teuchos::Comm communicator with this matrix.
virtual StatusgetStatus () const =0
 Returns a reference to this solver's internal status object.
virtual std::string name (void) const =0
 Return the name of this solver.
Methods implementing Describable
virtual std::string description (void) const =0
 Returns a short description of this Solver.
virtual void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const =0
Performance and Timing
virtual void printTiming (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const =0
 Prints timing information about the current solver.
virtual void getTiming (Teuchos::ParameterList &timingParameterList) const =0
 Extracts timing information from the current solver.

Related Functions

(Note that these are not member functions.)

template<class Matrix , class Vector >
Solver< Matrix, Vector > * create (const Matrix *A, Vector *X, const Vector *B)
 Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.
template<class Matrix , class Vector >
Teuchos::RCP< Solver< Matrix,
Vector > > 
create (Teuchos::RCP< const Matrix > A, Teuchos::RCP< Vector > X, Teuchos::RCP< const Vector > B)
 Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.
template<class Matrix , class Vector >
Solver< Matrix, Vector > * create (const char *solverName, const Matrix *A, Vector *X, const Vector *B)
 Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.
template<class Matrix , class Vector >
Teuchos::RCP< Solver< Matrix,
Vector > > 
create (const char *solverName, const Teuchos::RCP< const Matrix > A, const Teuchos::RCP< Vector > X, const Teuchos::RCP< const Vector > B)
 Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.
template<class Matrix , class Vector >
Solver< Matrix, Vector > * create (const std::string solverName, const Matrix *A, Vector *X, const Vector *B)
 Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.
template<class Matrix , class Vector >
Teuchos::RCP< Solver< Matrix,
Vector > > 
create (const std::string solverName, const Teuchos::RCP< const Matrix > A, const Teuchos::RCP< Vector > X, const Teuchos::RCP< const Vector > B)
 Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.
template<class Matrix , class Vector >
Solver< Matrix, Vector > * create (const std::string solverName, const Matrix *A)
 Creates an Amesos2 Solver interface with Matrix A.
template<class Matrix , class Vector >
Teuchos::RCP< Solver< Matrix,
Vector > > 
create (const std::string solverName, const Teuchos::RCP< const Matrix > A)
 Creates an Amesos2 Solver interface with Matrix A.
bool query (const char *solverName)
 Queries the Factory for support of the named third-party library.
bool query (const std::string solverName)
 Queries the Factory for support of the named third-party library.

Detailed Description

template<class Matrix, class Vector>
class Amesos2::Solver< Matrix, Vector >

Interface to Amesos2 solver objects.

Specifies a uniform interface for interaction with Amesos2 solver wrappers to third-party libraries.

This class holds no definitions itself; it is a contract for concrete solver interfaces only.


Member Function Documentation

template<class Matrix , class Vector >
virtual type& Amesos2::Solver< Matrix, Vector >::preOrdering ( void  ) [pure virtual]
template<class Matrix , class Vector >
virtual type& Amesos2::Solver< Matrix, Vector >::symbolicFactorization ( void  ) [pure virtual]
template<class Matrix , class Vector >
virtual type& Amesos2::Solver< Matrix, Vector >::numericFactorization ( void  ) [pure virtual]

Performs numeric factorization on the matrix.

numericFactorization checks first that symbolicFactorization has successfully been called, and if not, calls it before continuing.

Precondition:
  • The matrix A must not be null
Postcondition:
  • The factors L and U of A are computed

Implemented in Amesos2::SolverCore< ConcreteSolver, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlumt, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlu, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Lapack, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superludist, Matrix, Vector >, and Amesos2::SolverCore< Amesos2::PardisoMKL, Matrix, Vector >.

template<class Matrix , class Vector >
virtual void Amesos2::Solver< Matrix, Vector >::solve ( void  ) [pure virtual]

Solves $ A X = B$ (or $ A^T X = B$ )

solve checks first that numericFactorization has successfully been called, and if not, calls it before continuing.

Precondition:
  • The (multi)vectors X and B must not be null
Postcondition:
  • The (multi)vector X (given at construction time) contains the solution to the system.

Implemented in Amesos2::SolverCore< ConcreteSolver, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlumt, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlu, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Lapack, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superludist, Matrix, Vector >, and Amesos2::SolverCore< Amesos2::PardisoMKL, Matrix, Vector >.

template<class Matrix , class Vector >
virtual void Amesos2::Solver< Matrix, Vector >::solve ( const Teuchos::Ptr< Vector >  X,
const Teuchos::Ptr< const Vector >  B 
) const [pure virtual]

Solve $ A X = B$ using the given X and B vectors.

This overload of solve uses the given X and B vectors when solving. This X and B are used in place of any X and B that were given upon construction of the Amesos2 solver instance and are used only for this solve.

If a permanent change of X and B are required, see the setX() and setB() methods.

Postcondition:
  • The (multi)vector X contains the solution to the system
  • The X and B given at construction time (if any) are unchanged.

Implemented in Amesos2::SolverCore< ConcreteSolver, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlumt, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlu, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Lapack, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superludist, Matrix, Vector >, and Amesos2::SolverCore< Amesos2::PardisoMKL, Matrix, Vector >.

template<class Matrix , class Vector >
virtual void Amesos2::Solver< Matrix, Vector >::solve ( Vector *  X,
const Vector *  B 
) const [pure virtual]

Solve $ A X = B$ using the given X and B vectors.

This overload of solve uses the given X and B vectors when solving. This X and B are used in place of any X and B that were given upon construction of the Amesos2 solver instance and are used only for this solve.

If a permanent change of X and B are required, see the setX() and setB() methods.

Postcondition:
  • The (multi)vector X contains the solution to the system
  • The X and B given at construction time (if any) are unchanged.

Implemented in Amesos2::SolverCore< ConcreteSolver, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlumt, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlu, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Lapack, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superludist, Matrix, Vector >, and Amesos2::SolverCore< Amesos2::PardisoMKL, Matrix, Vector >.

template<class Matrix , class Vector >
virtual type& Amesos2::Solver< Matrix, Vector >::setParameters ( const Teuchos::RCP< Teuchos::ParameterList > &  parameterList) [pure virtual]

Set/update internal variables and solver options.

Expects that parameterList be named "Amesos2". That list may contain Amesos2-specific parameters. In addition, it may contain sublist for solver-specific parameters. These sublists should be named according to what is returned by the name() function (i.e. The solver's name when enabling for Amesos2 during configuration).

See each solver interface directly for a list of the supported parameters for that solver.

Implemented in Amesos2::SolverCore< ConcreteSolver, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlumt, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlu, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Lapack, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superludist, Matrix, Vector >, and Amesos2::SolverCore< Amesos2::PardisoMKL, Matrix, Vector >.

template<class Matrix , class Vector >
virtual void Amesos2::Solver< Matrix, Vector >::setA ( const Teuchos::RCP< const Matrix >  a,
EPhase  keep_phase = CLEAN 
) [pure virtual]

Sets the matrix A of this solver.

Parameters:
[in]aAn RCP to a matrix will will be used for future computation steps
[in]keep_phaseThis parameter tells the solver what state it should keep. For example, you may want to replace the matrix but keep the symbolic factorization because you know the structure of the new matrix is the same as the structure of the old matrix. In this case you would pass Amesos2::SYMBFACT as this parameter.

The default value for the second parameter is Amesos2::CLEAN, which means that the internal state of the solver will be completely reset. It will be as if no previous computational steps were performed.

Implemented in Amesos2::SolverCore< ConcreteSolver, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlumt, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlu, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Lapack, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superludist, Matrix, Vector >, and Amesos2::SolverCore< Amesos2::PardisoMKL, Matrix, Vector >.

template<class Matrix , class Vector >
virtual void Amesos2::Solver< Matrix, Vector >::setA ( const Matrix *  a,
EPhase  keep_phase = CLEAN 
) [pure virtual]

Sets the matrix A of this solver.

Parameters:
[in]aAn raw C pointer to a matrix will will be used for future computation steps.
[in]keep_phaseThis parameter tells the solver what state it should keep. For example, you may want to replace the matrix but keep the symbolic factorization because you know the structure of the new matrix is the same as the structure of the old matrix. In this case you would pass Amesos2::SYMBFACT as this parameter.

The default value for the second parameter is Amesos2::CLEAN, which means that the internal state of the solver will be completely reset. It will be as if no previous computational steps were performed.

Implemented in Amesos2::SolverCore< ConcreteSolver, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlumt, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlu, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Lapack, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superludist, Matrix, Vector >, and Amesos2::SolverCore< Amesos2::PardisoMKL, Matrix, Vector >.

template<class Matrix , class Vector >
virtual void Amesos2::Solver< Matrix, Vector >::describe ( Teuchos::FancyOStream &  out,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::Describable::verbLevel_default 
) const [pure virtual]
template<class Matrix , class Vector >
virtual void Amesos2::Solver< Matrix, Vector >::getTiming ( Teuchos::ParameterList &  timingParameterList) const [pure virtual]

Extracts timing information from the current solver.

Results are placed in the parameter list timingParameterList

Parameters:
timingParameterListAccepts timing information from the current solver

Implemented in Amesos2::SolverCore< ConcreteSolver, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlumt, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superlu, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Lapack, Matrix, Vector >, Amesos2::SolverCore< Amesos2::Superludist, Matrix, Vector >, and Amesos2::SolverCore< Amesos2::PardisoMKL, Matrix, Vector >.


Friends And Related Function Documentation

template<class Matrix , class Vector >
Solver< Matrix, Vector > * create ( const Matrix *  A,
Vector *  X,
const Vector *  B 
) [related]

Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.

This is the default option which interfaces with the native KLU2 solver.

Parameters:
[in]Apointer to a matrix of coefficients
[in]Xpointer to LHS solution vector
[in]Bpointer to RHS vector
Returns:
A C pointer to a KLU2 solver interface.
template<class Matrix , class Vector >
Teuchos::RCP< Solver< Matrix, Vector > > create ( Teuchos::RCP< const Matrix >  A,
Teuchos::RCP< Vector >  X,
Teuchos::RCP< const Vector >  B 
) [related]

Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.

This is the default option which interfaces with the native KLU2 solver.

Parameters:
[in]ATeuchos::RCP to the coefficient matrix
[in]XTeuchos::RCP to LHS solution vector
[in]BTeuchos::RCP to RHS vector
Returns:
A Teuchos::RCP to a KLU2 solver interface.
template<class Matrix , class Vector >
Solver< Matrix, Vector > * create ( const char *  solverName,
const Matrix *  A,
Vector *  X,
const Vector *  B 
) [related]

Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.

Parameters:
[in]solverNameA C character string with the name of the underlying third-party solver desired.
[in]Apointer to a matrix of coefficients
[in]Xpointer to LHS solution vector
[in]Bpointer to RHS vector
Returns:
A C pointer to an Amesos2 solver interface.
Exceptions:
std::invalid_argumentThe third-party solver named by solverName is not supported.
template<class Matrix , class Vector >
Teuchos::RCP< Solver< Matrix, Vector > > create ( const char *  solverName,
const Teuchos::RCP< const Matrix >  A,
const Teuchos::RCP< Vector >  X,
const Teuchos::RCP< const Vector >  B 
) [related]

Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.

Parameters:
[in]solverNameThe name of the desired third-party solver
[in]ATeuchos::RCP to the coefficient matrix
[in]XTeuchos::RCP to LHS solution vector
[in]BTeuchos::RCP to RHS vector
Returns:
A Teuchos::RCP to an Amesos2 solver interface.
Exceptions:
std::invalid_argumentThe third-party solver named by solverName is not supported.
template<class Matrix , class Vector >
Solver< Matrix, Vector > * create ( const std::string  solverName,
const Matrix *  A,
Vector *  X,
const Vector *  B 
) [related]

Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.

Parameters:
[in]solverNameThe name of the desired third-party solver
[in]AC pointer to the coefficient matrix
[in]XC pointer to LHS solution vector
[in]BC pointer to RHS vector
Returns:
A C pointer to an Amesos2 solver interface.
Exceptions:
std::invalid_argumentThe third-party solver named by solverName is not supported.
template<class Matrix , class Vector >
Teuchos::RCP< Solver< Matrix, Vector > > create ( const std::string  solverName,
const Teuchos::RCP< const Matrix >  A,
const Teuchos::RCP< Vector >  X,
const Teuchos::RCP< const Vector >  B 
) [related]

Creates an Amesos2 Solver interface with Matrix A, LHS vector X, and RHS vector B.

Parameters:
[in]solverNameThe name of the desired third-party solver
[in]ATeuchos::RCP to the coefficient matrix
[in]XTeuchos::RCP to LHS solution vector
[in]BTeuchos::RCP to RHS vector
Returns:
A Teuchos::RCP to an Amesos2 solver interface.
Exceptions:
std::invalid_argumentThe third-party solver named by solverName is not supported.
template<class Matrix , class Vector >
Solver< Matrix, Vector > * create ( const std::string  solverName,
const Matrix *  A 
) [related]

Creates an Amesos2 Solver interface with Matrix A.

Suitable for cases where numeric factorization must be performed before the X and B vectors are known. Before a solve, the setX() and setB() functions should be used to set X and B, or the overloaded solve(X,B) method should be used.

Parameters:
[in]solverNameThe name of the desired third-party solver
[in]AC pointer to the coefficient matrix
Returns:
A C pointer to an Amesos2 solver interface.
Exceptions:
std::invalid_argumentThe third-party solver named by solverName is not supported.
template<class Matrix , class Vector >
Teuchos::RCP< Solver< Matrix, Vector > > create ( const std::string  solverName,
const Teuchos::RCP< const Matrix >  A 
) [related]

Creates an Amesos2 Solver interface with Matrix A.

Suitable for cases where numeric factorization must be performed before the X and B vectors are known. Before a solve, the setX() and setB() functions should be used to set X and B, or the overloaded solve(X,B) method should be used.

Parameters:
[in]solverNameThe name of the desired third-party solver
[in]ATeuchos::RCP to the coefficient matrix
Returns:
A Teuchos::RCP to an Amesos2 solver interface.
Exceptions:
std::invalid_argumentThe third-party solver named by solverName is not supported.
template<class Matrix , class Vector >
bool query ( const char *  solverName) [related]

Queries the Factory for support of the named third-party library.

Returns:
true if the solver is supported.
template<class Matrix , class Vector >
bool query ( const std::string  solverName) [related]

Queries the Factory for support of the named third-party library.

Returns:
true if the solver is supported.

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