Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Amesos2_Factory.hpp File Reference

Contains declarations for Amesos2::create and Amesos2::query. More...

#include "Amesos2_config.h"
#include "Amesos2_Solver.hpp"
#include "Amesos2_SolverTraits.hpp"
#include "Teuchos_ScalarTraits.hpp"
#include "Amesos2_MultiVecAdapter.hpp"
#include "Amesos2_MatrixTraits.hpp"
#include "Amesos2_ctassert.hpp"
#include "Amesos2_KLU2.hpp"
#include "Amesos2_Superludist.hpp"
Include dependency graph for Amesos2_Factory.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Detailed Description

Contains declarations for Amesos2::create and Amesos2::query.

Author
Eric Bavier etbav.nosp@m.ie@s.nosp@m.andia.nosp@m..gov
Date
Tue Jun 7 16:25:16 2011

Amesos2 defines the nonmember factory method Amesos2::create for creating instances of Amesos2 solvers. If a users asks Amesos2::create to create a solver with a matrix whose scalar type is not supported by that solver, then a runtime std::invalid_argument exception will be thrown.

The Amesos2::query function can be used to ask Amesos2 at runtime whether a particular solver is supported.

Attention
Users should favor these factory methods for creating Amesos2 solver instances over explicitly instantiating their own.
Note
A solver's third-party library must be enabled in the Trilinos build, and Amesos2 must be also told to enable it. Put Amesos2_ENABLE_SOLVERNAME:BOOL=ON in your Trilinos configuration script to do this, where SOLVERNAME is the name of the solver you would like to enable.

Example Usage

typedef Tpetra::CrsMatrix<double,int> MAT;
typedef Tpetra::MultiVector<double,int> VEC;
// ... Create A of type RCP<MAT>, and X and B of type RCP<VEC> ...
RCP<Amesos2::Solver<MAT,VEC> > solver = Amesos2::create<MAT,VEC>("SuperLU", A, X, B);