Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
remainder
example
SolverFactory
PackageB.cpp
Go to the documentation of this file.
1
#include "
PackageB.hpp
"
2
3
namespace
B
{
4
5
// Creating an instance of this "object" registers B::FactoryB<MV,
6
// OP> with the central registry of packages' factories. That lets
7
// B::getLinearSolver create solvers from package B.
8
template
<
class
MV,
class
OP,
class
NormType>
9
class
RegisterFactoryB
{
10
public
:
11
RegisterFactoryB
() {
12
#ifdef HAVE_TEUCHOSCORE_CXX11
13
typedef
std::shared_ptr<Trilinos::Details::LinearSolverFactory<MV, OP, NormType> > ptr_type;
14
#else
15
typedef
Teuchos::RCP<Trilinos::Details::LinearSolverFactory<MV, OP, NormType>
> ptr_type;
16
#endif // HAVE_TEUCHOSCORE_CXX11
17
18
ptr_type factory (
new
FactoryB<MV, OP, NormType>
());
19
Trilinos::Details::registerLinearSolverFactory<MV, OP, NormType> (
"B"
, factory);
20
}
21
};
22
23
}
// namespace B
24
25
namespace
{
// (anonymous)
26
//
27
// See PackageA.cpp for an explanation of the macro and its use.
28
//
29
#define INSTMACRO( SCALAR ) \
30
B::RegisterFactoryB< Common::MultiVector< SCALAR >, Common::Operator< SCALAR >, SCALAR > registerer_##SCALAR;
31
32
//B::RegisterFactoryB< Common::MultiVector<double>, Common::Operator<double>, double > registerer_double;
33
INSTMACRO
(
double
)
34
35
//B::RegisterFactoryB< Common::MultiVector<float>, Common::Operator<float>, float > registerer_float;
36
INSTMACRO
(
float
)
37
38
}
// namespace (anonymous)
39
B::RegisterFactoryB
Definition:
PackageB.cpp:9
B
Definition:
core/test/dyn_cast/cxx_main.cpp:48
PackageB.hpp
B::FactoryB
Definition:
PackageB.hpp:62
B::RegisterFactoryB::RegisterFactoryB
RegisterFactoryB()
Definition:
PackageB.cpp:11
INSTMACRO
#define INSTMACRO(SCALAR)
Definition:
PackageB.cpp:29
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition:
Teuchos_RCPDecl.hpp:429
Generated by
1.8.5