MADNESS  version 0.9
Public Member Functions | Protected Attributes | Friends | List of all members
madness::FunctionFactory< T, NDIM > Singleton Reference

FunctionFactory implements the named-parameter idiom for Function. More...

#include <funcimpl.h>

Inheritance diagram for madness::FunctionFactory< T, NDIM >:
Inheritance graph
[legend]
Collaboration diagram for madness::FunctionFactory< T, NDIM >:
Collaboration graph
[legend]

Public Member Functions

 FunctionFactory (World &world)
 
virtual ~FunctionFactory ()
 
FunctionFactoryfunctor (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > &f)
 
template<typename opT >
FunctionFactoryfunctor2 (const opT &op)
 
FunctionFactoryno_functor ()
 
FunctionFactoryf (T(*f)(const coordT &))
 
virtual FunctionFactoryk (int k)
 
virtual FunctionFactorythresh (double thresh)
 
FunctionFactoryinitial_level (int initial_level)
 
FunctionFactorymax_refine_level (int max_refine_level)
 
FunctionFactorytruncate_mode (int truncate_mode)
 
FunctionFactoryrefine (bool refine=true)
 
FunctionFactorynorefine (bool norefine=true)
 
FunctionFactoryempty ()
 
FunctionFactoryautorefine ()
 
FunctionFactorynoautorefine ()
 
FunctionFactorytruncate_on_project ()
 
FunctionFactorynotruncate_on_project ()
 
FunctionFactoryfence (bool fence=true)
 
FunctionFactorynofence ()
 
virtual FunctionFactoryis_on_demand ()
 
FunctionFactorypmap (const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap)
 
int get_k () const
 
double get_thresh () const
 
Worldget_world () const
 
virtual std::shared_ptr
< FunctionFunctorInterface< T,
NDIM > > 
get_functor () const
 return the functor; override this if the functor needs deferred construction More...
 
FunctionFactoryself ()
 implement this in all derived classes for correct chaining More...
 

Protected Attributes

World_world
 
int _k
 
double _thresh
 
int _initial_level
 
int _max_refine_level
 
int _truncate_mode
 
bool _refine
 
bool _empty
 
bool _autorefine
 
bool _truncate_on_project
 
bool _fence
 
bool _is_on_demand
 
std::shared_ptr
< WorldDCPmapInterface< Key
< NDIM > > > 
_pmap
 

Friends

class FunctionImpl< T, NDIM >
 

Detailed Description

template<typename T, std::size_t NDIM>
singleton madness::FunctionFactory< T, NDIM >

FunctionFactory implements the named-parameter idiom for Function.

C++ does not provide named arguments (as does, e.g., Python). This class provides something very close. Create functions as follows

double myfunc(const double x[]);
Function<double,3> f = FunctionFactory<double,3>(world).f(myfunc).k(11).thresh(1e-9).debug()

where the methods of function factory, which specify the non-default arguments eventually passed to the Function constructor, can be used in any order.

Need to add a general functor for initial projection with a standard interface.

Constructor & Destructor Documentation

template<typename T, std::size_t NDIM>
madness::FunctionFactory< T, NDIM >::FunctionFactory ( World world)
inline
template<typename T, std::size_t NDIM>
virtual madness::FunctionFactory< T, NDIM >::~FunctionFactory ( )
inlinevirtual

Member Function Documentation

template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::autorefine ( )
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::empty ( )
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::f ( T(*)(const coordT &)  f)
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::fence ( bool  fence = true)
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::functor ( const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > &  f)
inline
template<typename T, std::size_t NDIM>
template<typename opT >
FunctionFactory& madness::FunctionFactory< T, NDIM >::functor2 ( const opT &  op)
inline
template<typename T, std::size_t NDIM>
virtual std::shared_ptr<FunctionFunctorInterface<T, NDIM> > madness::FunctionFactory< T, NDIM >::get_functor ( ) const
inlinevirtual

return the functor; override this if the functor needs deferred construction

Reimplemented in madness::FGFactory< T, NDIM >, madness::TwoElectronFactory, and madness::CompositeFactory< T, NDIM, MDIM >.

template<typename T, std::size_t NDIM>
int madness::FunctionFactory< T, NDIM >::get_k ( ) const
inline
template<typename T, std::size_t NDIM>
double madness::FunctionFactory< T, NDIM >::get_thresh ( ) const
inline
template<typename T, std::size_t NDIM>
World& madness::FunctionFactory< T, NDIM >::get_world ( ) const
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::initial_level ( int  initial_level)
inline
template<typename T, std::size_t NDIM>
virtual FunctionFactory& madness::FunctionFactory< T, NDIM >::is_on_demand ( )
inlinevirtual
template<typename T, std::size_t NDIM>
virtual FunctionFactory& madness::FunctionFactory< T, NDIM >::k ( int  k)
inlinevirtual
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::max_refine_level ( int  max_refine_level)
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::no_functor ( )
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::noautorefine ( )
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::nofence ( )
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::norefine ( bool  norefine = true)
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::notruncate_on_project ( )
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::pmap ( const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &  pmap)
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::refine ( bool  refine = true)
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::self ( )
inline

implement this in all derived classes for correct chaining

template<typename T, std::size_t NDIM>
virtual FunctionFactory& madness::FunctionFactory< T, NDIM >::thresh ( double  thresh)
inlinevirtual
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::truncate_mode ( int  truncate_mode)
inline
template<typename T, std::size_t NDIM>
FunctionFactory& madness::FunctionFactory< T, NDIM >::truncate_on_project ( )
inline

Friends And Related Function Documentation

template<typename T, std::size_t NDIM>
friend class FunctionImpl< T, NDIM >
friend

Member Data Documentation

template<typename T, std::size_t NDIM>
bool madness::FunctionFactory< T, NDIM >::_autorefine
protected
template<typename T, std::size_t NDIM>
bool madness::FunctionFactory< T, NDIM >::_empty
protected
template<typename T, std::size_t NDIM>
bool madness::FunctionFactory< T, NDIM >::_fence
protected
template<typename T, std::size_t NDIM>
int madness::FunctionFactory< T, NDIM >::_initial_level
protected
template<typename T, std::size_t NDIM>
bool madness::FunctionFactory< T, NDIM >::_is_on_demand
protected
template<typename T, std::size_t NDIM>
int madness::FunctionFactory< T, NDIM >::_k
protected
template<typename T, std::size_t NDIM>
int madness::FunctionFactory< T, NDIM >::_max_refine_level
protected
template<typename T, std::size_t NDIM>
std::shared_ptr<WorldDCPmapInterface<Key<NDIM> > > madness::FunctionFactory< T, NDIM >::_pmap
protected
template<typename T, std::size_t NDIM>
bool madness::FunctionFactory< T, NDIM >::_refine
protected
template<typename T, std::size_t NDIM>
double madness::FunctionFactory< T, NDIM >::_thresh
protected
template<typename T, std::size_t NDIM>
int madness::FunctionFactory< T, NDIM >::_truncate_mode
protected
template<typename T, std::size_t NDIM>
bool madness::FunctionFactory< T, NDIM >::_truncate_on_project
protected
template<typename T, std::size_t NDIM>
World& madness::FunctionFactory< T, NDIM >::_world
protected

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