Belos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Static Public Member Functions | List of all members
Belos::InnerSolverTraits< Scalar, MV, OP > Class Template Reference

Wrap an InnerSolver in an OP (operator). More...

#include <BelosInnerSolver.hpp>

Public Types

typedef Scalar scalar_type
 
typedef MV multivector_type
 
typedef OP operator_type
 
typedef InnerSolver
< scalar_type,
multivector_type,
operator_type
inner_solver_type
 
typedef UndefinedWrapperType
< Scalar, MV, OP > 
wrapper_type
 

Static Public Member Functions

static Teuchos::RCP< OP > makeInnerSolverOperator (const Teuchos::RCP< InnerSolver< Scalar, MV, OP > > &solver)
 Wrap the given inner solver in a wrapper_type. More...
 
static Teuchos::RCP
< inner_solver_type
getInnerSolver (const Teuchos::RCP< operator_type > &op)
 Return the given wrapper's inner solver object. More...
 

Detailed Description

template<class Scalar, class MV, class OP>
class Belos::InnerSolverTraits< Scalar, MV, OP >

Wrap an InnerSolver in an OP (operator).

Take an InnerSolver instance, and wrap it in an implementation of OP, where OP is one of the base operator interfaces that Belos supports (currently Thyra::LinearOpBase, Tpetra::Operator, and Epetra_Operator).

Note
The reason for this class is that Belos solvers require that the preconditioner(s) and the operator have the same type (OP). So, if we want to use the InnerSolver as e.g., a preconditioner for a Tpetra::CrsMatrix (which implements Tpetra::Operator), we have to wrap the InnerSolver in something that implements the Tpetra::Operator interface. Otherwise, we would just use the above definition of OperatorTraits for InnerSolver above.
The reason this is a class and not just a template function, is that C++ doesn't allow partial template specialization of template functions.

Definition at line 323 of file BelosInnerSolver.hpp.

Member Typedef Documentation

template<class Scalar , class MV , class OP >
typedef Scalar Belos::InnerSolverTraits< Scalar, MV, OP >::scalar_type

Definition at line 325 of file BelosInnerSolver.hpp.

template<class Scalar , class MV , class OP >
typedef MV Belos::InnerSolverTraits< Scalar, MV, OP >::multivector_type

Definition at line 326 of file BelosInnerSolver.hpp.

template<class Scalar , class MV , class OP >
typedef OP Belos::InnerSolverTraits< Scalar, MV, OP >::operator_type

Definition at line 327 of file BelosInnerSolver.hpp.

template<class Scalar , class MV , class OP >
typedef InnerSolver<scalar_type, multivector_type, operator_type> Belos::InnerSolverTraits< Scalar, MV, OP >::inner_solver_type

Definition at line 328 of file BelosInnerSolver.hpp.

template<class Scalar , class MV , class OP >
typedef UndefinedWrapperType<Scalar, MV, OP> Belos::InnerSolverTraits< Scalar, MV, OP >::wrapper_type

Definition at line 329 of file BelosInnerSolver.hpp.

Member Function Documentation

template<class Scalar , class MV , class OP >
static Teuchos::RCP<OP> Belos::InnerSolverTraits< Scalar, MV, OP >::makeInnerSolverOperator ( const Teuchos::RCP< InnerSolver< Scalar, MV, OP > > &  solver)
inlinestatic

Wrap the given inner solver in a wrapper_type.

The wrapper_type class implements the operator_type interface, which can be used directly in Belos.

Definition at line 336 of file BelosInnerSolver.hpp.

template<class Scalar , class MV , class OP >
static Teuchos::RCP<inner_solver_type> Belos::InnerSolverTraits< Scalar, MV, OP >::getInnerSolver ( const Teuchos::RCP< operator_type > &  op)
inlinestatic

Return the given wrapper's inner solver object.

If op is an inner solver wrapper instance, return the inner solver object. Otherwise, throw an std::bad_cast exception.

Note
After calling this method, the inner solver object will persist beyond the scope of op. Thus, if you don't care about the wrapper that implements the operator_type interface, you can get rid of the wrapper (by setting the RCP to null) and keep the inner solver.

Definition at line 357 of file BelosInnerSolver.hpp.


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