queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::AlgorithmFactory Class Referenceabstract

#include <AlgorithmFactory.h>

Inheritance diagram for QUESO::AlgorithmFactory:
QUESO::Factory< Algorithm< GslVector, GslMatrix > > QUESO::AlgorithmFactoryImp< DerivedAlgorithm >

Public Member Functions

 AlgorithmFactory (const std::string &name)
 
virtual ~AlgorithmFactory ()
 
- Public Member Functions inherited from QUESO::Factory< Algorithm< GslVector, GslMatrix > >
virtual ~Factory ()
 

Static Public Member Functions

static void set_environment (const BaseEnvironment &env)
 
static void set_tk (const BaseTKGroup< GslVector, GslMatrix > &tk)
 
- Static Public Member Functions inherited from QUESO::Factory< Algorithm< GslVector, GslMatrix > >
static SharedPtr< Algorithm
< GslVector, GslMatrix >
>::Type 
build (const std::string &name)
 

Protected Member Functions

virtual SharedPtr< Algorithm
< GslVector, GslMatrix >
>::Type 
build_algorithm ()=0
 
- Protected Member Functions inherited from QUESO::Factory< Algorithm< GslVector, GslMatrix > >
 Factory (const std::string &name)
 

Static Protected Attributes

static const BaseEnvironmentm_env = NULL
 
static const BaseTKGroup
< GslVector, GslMatrix > * 
m_tk = NULL
 

Private Member Functions

virtual SharedPtr< Algorithm
< GslVector, GslMatrix >
>::Type 
create ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from QUESO::Factory< Algorithm< GslVector, GslMatrix > >
static std::map< std::string,
Factory< Algorithm< GslVector,
GslMatrix > > * > & 
factory_map ()
 

Detailed Description

AlgorithmFactory class defintion. Clients subclassing this for their own algorithm (aka Metropolis-Hastings acceptance ratio) should implement build_algorithm.

Definition at line 42 of file AlgorithmFactory.h.

Constructor & Destructor Documentation

QUESO::AlgorithmFactory::AlgorithmFactory ( const std::string &  name)
inline

Constructor. Takes the name to be mapped.

Definition at line 48 of file AlgorithmFactory.h.

49  : Factory<Algorithm<GslVector, GslMatrix> >(name)
50  {}
virtual QUESO::AlgorithmFactory::~AlgorithmFactory ( )
inlinevirtual

Destructor. (Empty.)

Definition at line 55 of file AlgorithmFactory.h.

55 {}

Member Function Documentation

virtual SharedPtr<Algorithm<GslVector, GslMatrix> >::Type QUESO::AlgorithmFactory::build_algorithm ( )
protectedpure virtual
SharedPtr< Algorithm< GslVector, GslMatrix > >::Type QUESO::AlgorithmFactory::create ( )
inlineprivatevirtual

Create a Base class. Force this to be implemented later.

Implements QUESO::Factory< Algorithm< GslVector, GslMatrix > >.

Definition at line 83 of file AlgorithmFactory.h.

References build_algorithm(), m_env, and m_tk.

84 {
85  queso_require_msg(m_env, "ERROR: must call set_environment() before building alg!");
86  queso_require_msg(m_tk, "ERROR: must call set_tk() before building alg!");
87 
89 
90  queso_assert(new_alg);
91 
92  return new_alg;
93 }
static const BaseTKGroup< GslVector, GslMatrix > * m_tk
virtual SharedPtr< Algorithm< GslVector, GslMatrix > >::Type build_algorithm()=0
Definition of a shared pointer.
static const BaseEnvironment * m_env
static void QUESO::AlgorithmFactory::set_environment ( const BaseEnvironment env)
inlinestatic

Definition at line 57 of file AlgorithmFactory.h.

References m_env.

Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::commonConstructor().

58  {
59  m_env = &env;
60  }
static const BaseEnvironment * m_env
static void QUESO::AlgorithmFactory::set_tk ( const BaseTKGroup< GslVector, GslMatrix > &  tk)
inlinestatic

Definition at line 62 of file AlgorithmFactory.h.

References m_tk.

Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::commonConstructor().

63  {
64  m_tk = &tk;
65  }
static const BaseTKGroup< GslVector, GslMatrix > * m_tk

Member Data Documentation

const BaseEnvironment * QUESO::AlgorithmFactory::m_env = NULL
staticprotected
const BaseTKGroup< GslVector, GslMatrix > * QUESO::AlgorithmFactory::m_tk = NULL
staticprotected

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

Generated on Tue Jun 5 2018 19:49:03 for queso-0.57.1 by  doxygen 1.8.5