MADNESS 0.10.1
|
FunctionFactory implements the named-parameter idiom for Function. More...
#include <function_factory.h>
Public Member Functions | |
FunctionFactory (World &world) | |
virtual | ~FunctionFactory () |
FunctionFactory & | autorefine () |
FunctionFactory & | compressed (bool value=true) |
FunctionFactory & | empty () |
FunctionFactory & | f (T(*f)(const coordT &)) |
FunctionFactory & | fence (bool fence=true) |
template<typename opT > | |
std::enable_if< std::is_base_of< FunctionFunctorInterface< T, NDIM >, opT >::value, FunctionFactory & >::type | functor (const opT &op) |
pass in a functor that is derived from FunctionFunctorInterface | |
template<typename opT > | |
std::enable_if< notstd::is_base_of< FunctionFunctorInterface< T, NDIM >, opT >::value, FunctionFactory & >::type | functor (const opT &op) |
pass in a functor that is not derived from FunctionFunctorInterface | |
FunctionFactory & | functor (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > &f) |
virtual std::shared_ptr< FunctionFunctorInterface< T, NDIM > > | get_functor () const |
return the functor; override this if the functor needs deferred construction | |
int | get_k () const |
double | get_thresh () const |
World & | get_world () const |
FunctionFactory & | initial_level (int initial_level) |
virtual FunctionFactory & | is_on_demand () |
virtual FunctionFactory & | k (int k) |
FunctionFactory & | max_refine_level (int max_refine_level) |
FunctionFactory & | no_functor () |
FunctionFactory & | noautorefine () |
FunctionFactory & | nofence () |
FunctionFactory & | norefine (bool norefine=true) |
FunctionFactory & | notruncate_on_project () |
FunctionFactory & | pmap (const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap) |
FunctionFactory & | refine (bool refine=true) |
FunctionFactory & | self () |
implement this in all derived classes for correct chaining | |
FunctionFactory & | special_level (int special_level) |
FunctionFactory & | special_points (std::vector< Vector< double, NDIM > > &special_points) |
virtual FunctionFactory & | thresh (double thresh) |
FunctionFactory & | truncate_mode (int truncate_mode) |
FunctionFactory & | truncate_on_project () |
Protected Attributes | |
bool | _autorefine |
bool | _empty |
bool | _fence |
int | _initial_level = FunctionDefaults<NDIM>::get_initial_level() |
int | _k |
int | _max_refine_level |
std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > | _pmap |
bool | _refine |
int | _special_level = FunctionDefaults<NDIM>::get_special_level() |
std::vector< Vector< double, NDIM > > | _special_points |
double | _thresh |
TreeState | _tree_state |
int | _truncate_mode |
bool | _truncate_on_project |
World & | _world |
Private Types | |
typedef Vector< double, NDIM > | coordT |
Type of vector holding coordinates. | |
Private Attributes | |
std::shared_ptr< FunctionFunctorInterface< T, NDIM > > | _functor |
Friends | |
class | FunctionImpl< 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
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.
|
private |
Type of vector holding coordinates.
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
References madness::f, madness::FunctionFactory< T, NDIM >::functor(), and madness::FunctionFactory< T, NDIM >::self().
Referenced by cplxfunc0(), cplxfunc1(), cplxfunc2(), data< T, NDIM >::initialize(), main(), madness::smooth< T, NDIM >::make_inv_mask(), madness::LRFunctorF12< T, NDIM, LDIM >::norm2(), realfunc0(), realfunc1(), realfunc2(), test_add(), test_hartree_product(), test_he(), test_he_potential(), test_hf_be(), test_hf_h2(), test_hf_he(), test_hydro(), test_per(), test_periodic(), test_periodic1(), test_periodic2(), test_periodic_bsh(), test_projector_outer(), test_swap_particles(), test_vector_composite(), test_xc2(), testNavierStokes(), and testPeriodicCoulomb3d().
|
inline |
|
inline |
pass in a functor that is derived from FunctionFunctorInterface
similar to the first version of functor, but easy-to-use FunctionFunctorInterface must be a public base of opT
References madness::FunctionFactory< T, NDIM >::_functor, op(), and madness::FunctionFactory< T, NDIM >::self().
|
inline |
pass in a functor that is not derived from FunctionFunctorInterface
similar to the first version of functor, but easy-to-use
References madness::FunctionFactory< T, NDIM >::_functor, op(), and madness::FunctionFactory< T, NDIM >::self().
|
inline |
References madness::FunctionFactory< T, NDIM >::_functor, madness::f, and madness::FunctionFactory< T, NDIM >::self().
Referenced by dnuclear_anchor_test(), madness::exchange_anchor_test(), exchange_anchor_test(), madness::FunctionFactory< T, NDIM >::f(), nuclear_anchor_test(), madness::InitParameters::readnw(), test_add(), test_apply_push_1d(), test_arithmetic(), test_asymmetric(), test_basic(), test_bsh(), test_combined_operators(), test_construction_optimization(), test_conv(), test_converged_function(), test_convergence(), test_coulomb(), test_cross(), test_diff(), test_dot(), madness::test_exchange(), test_exchange(), test_fock(), test_full_rank_functor(), test_hermiticity(), test_hf_he(), test_inner(), test_inner(), test_io(), test_kinetic(), test_lowrank_function(), test_math(), test_matrix_mul_sparse(), test_molecular_grid(), test_multi_to_multi_op(), test_op(), test_operator_apply(), test_plot(), test_proj(), test_projector(), test_Q12_projector(), test_rot(), test_transform(), test_unaryop(), test_XCOperator(), and madness::LowRankFunctionFactory< T, NDIM, LDIM >::Yformer().
|
inlinevirtual |
return the functor; override this if the functor needs deferred construction
Reimplemented in madness::CompositeFactory< T, NDIM, MDIM >, and madness::TwoElectronFactory< T, NDIM >.
References madness::FunctionFactory< T, NDIM >::_functor.
|
inline |
References madness::FunctionFactory< T, NDIM >::_k.
|
inline |
References madness::FunctionFactory< T, NDIM >::_thresh.
|
inline |
References madness::FunctionFactory< T, NDIM >::_world.
|
inline |
References madness::FunctionFactory< T, NDIM >::_initial_level, madness::FunctionFactory< T, NDIM >::initial_level(), and madness::FunctionFactory< T, NDIM >::self().
Referenced by madness::FunctionFactory< T, NDIM >::initial_level(), main(), test_conv(), test_coulomb(), test_hf_be(), test_hydro(), and test_per().
|
inlinevirtual |
References madness::FunctionFactory< T, NDIM >::_tree_state, madness::on_demand, and madness::FunctionFactory< T, NDIM >::self().
Referenced by test_vector_composite().
|
inlinevirtual |
References madness::FunctionFactory< T, NDIM >::_k, k, and madness::FunctionFactory< T, NDIM >::self().
Referenced by madness::apply(), madness::Function< T, NDIM >::dirac_convolution(), madness::hartree_product(), madness::hartree_product(), madness::innerXX(), madness::project(), madness::Function< T, NDIM >::project_out(), and test_conv().
|
inline |
|
inline |
|
inline |
|
inline |
References madness::FunctionFactory< T, NDIM >::_fence, and madness::FunctionFactory< T, NDIM >::self().
Referenced by madness::innerXX().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
implement this in all derived classes for correct chaining
Referenced by madness::FunctionFactory< T, NDIM >::autorefine(), madness::FunctionFactory< T, NDIM >::compressed(), madness::FunctionFactory< T, NDIM >::empty(), madness::FunctionFactory< T, NDIM >::f(), madness::FunctionFactory< T, NDIM >::fence(), madness::FunctionFactory< T, NDIM >::functor(), madness::FunctionFactory< T, NDIM >::functor(), madness::FunctionFactory< T, NDIM >::initial_level(), madness::FunctionFactory< T, NDIM >::is_on_demand(), madness::FunctionFactory< T, NDIM >::k(), madness::FunctionFactory< T, NDIM >::max_refine_level(), madness::FunctionFactory< T, NDIM >::no_functor(), madness::FunctionFactory< T, NDIM >::noautorefine(), madness::FunctionFactory< T, NDIM >::nofence(), madness::FunctionFactory< T, NDIM >::norefine(), madness::FunctionFactory< T, NDIM >::notruncate_on_project(), madness::FunctionFactory< T, NDIM >::pmap(), madness::FunctionFactory< T, NDIM >::refine(), madness::FunctionFactory< T, NDIM >::special_level(), madness::FunctionFactory< T, NDIM >::special_points(), madness::FunctionFactory< T, NDIM >::thresh(), madness::FunctionFactory< T, NDIM >::truncate_mode(), and madness::FunctionFactory< T, NDIM >::truncate_on_project().
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented in madness::TwoElectronFactory< T, NDIM >.
References madness::FunctionFactory< T, NDIM >::_thresh, madness::FunctionFactory< T, NDIM >::self(), and thresh.
Referenced by madness::apply(), madness::exchange_anchor_test(), exchange_anchor_test(), madness::MP2::guess_mp1_3(), madness::hartree_product(), madness::hartree_product(), madness::innerXX(), madness::MP2::make_Uphi0(), madness::MP2::multiply_with_0th_order_Hamiltonian(), madness::project(), madness::Function< T, NDIM >::project_out(), test_coulomb(), madness::test_exchange(), test_exchange(), test_he(), test_hf_be(), and test_hydro().
|
inline |
|
inline |
References madness::FunctionFactory< T, NDIM >::_truncate_on_project, and madness::FunctionFactory< T, NDIM >::self().
Referenced by dnuclear_anchor_test(), madness::exchange_anchor_test(), exchange_anchor_test(), nuclear_anchor_test(), test_asymmetric(), test_coulomb(), madness::test_exchange(), test_exchange(), test_fock(), test_hermiticity(), test_kinetic(), and testNavierStokes().
|
friend |
|
protected |
|
protected |
|
protected |
|
private |
|
protected |
Referenced by madness::FunctionFactory< T, NDIM >::initial_level().
|
protected |
Referenced by madness::FunctionFactory< T, NDIM >::get_k(), and madness::FunctionFactory< T, NDIM >::k().
|
protected |
Referenced by madness::FunctionFactory< T, NDIM >::max_refine_level().
|
protected |
Referenced by madness::FunctionFactory< T, NDIM >::pmap().
|
protected |
|
protected |
Referenced by madness::FunctionFactory< T, NDIM >::special_level().
|
protected |
Referenced by madness::FunctionFactory< T, NDIM >::special_points().
|
protected |
|
protected |
|
protected |
Referenced by madness::FunctionFactory< T, NDIM >::truncate_mode().
|
protected |
|
protected |
Referenced by madness::FunctionFactory< T, NDIM >::get_world().