QMCPACK
FakeFunctor< T > Struct Template Reference
+ Inheritance diagram for FakeFunctor< T >:
+ Collaboration diagram for FakeFunctor< T >:

Public Member Functions

 FakeFunctor (const std::string &my_name)
 default constructor More...
 
void setCusp (real_type cusp) override
 
OptimizableFunctorBasemakeClone () const override
 create a clone of this object More...
 
void reset () override
 reset function More...
 
real_type evaluate (real_type r) const
 
real_type evaluate (real_type r, real_type &dudr, real_type &d2udr2) const
 
real_type evaluate (real_type r, real_type &dudr, real_type &d2udr2, real_type &d3udr3) const
 
real_type evaluateV (const int iat, const int iStart, const int iEnd, const T *restrict _distArray, T *restrict distArrayCompressed) const
 
void evaluateVGL (const int iat, const int iStart, const int iEnd, const T *distArray, T *restrict valArray, T *restrict gradArray, T *restrict laplArray, T *restrict distArrayCompressed, int *restrict distIndices) const
 
real_type f (real_type r) override
 
real_type df (real_type r) override
 
bool evaluateDerivatives (real_type r, std::vector< TinyVector< real_type, 3 >> &derivs) override
 
bool evaluateDerivatives (real_type r, std::vector< real_type > &derivs) override
 compute derivatives with respect to variational parameters More...
 
bool put (xmlNodePtr cur) override
 process xmlnode and registers variables to optimize More...
 
void checkInVariablesExclusive (opt_variables_type &active) override
 check in variational parameters to the global list of parameters used by the optimizer. More...
 
void checkOutVariables (const opt_variables_type &active) override
 check out variational optimizable variables More...
 
void resetParametersExclusive (const opt_variables_type &active) override
 reset the parameters during optimizations. More...
 
- Public Member Functions inherited from OptimizableFunctorBase
 OptimizableFunctorBase (const std::string &name="")
 default constructor More...
 
virtual ~OptimizableFunctorBase ()=default
 virtual destrutor More...
 
void getIndex (const opt_variables_type &active)
 
virtual real_type f (real_type r)=0
 evaluate the value at r More...
 
virtual real_type df (real_type r)=0
 evaluate the first derivative More...
 
virtual void setDensity (real_type n)
 empty virtual function to help builder classes More...
 
virtual void setCusp (real_type cusp)
 empty virtual function to help builder classes More...
 
virtual void setPeriodic (bool periodic)
 empty virtual function to help builder classes More...
 
virtual bool evaluateDerivatives (real_type r, std::vector< qmcplusplus::TinyVector< real_type, 3 >> &derivs)
 
virtual bool evaluateDerivatives (real_type r, std::vector< real_type > &derivs)
 
virtual void setGridManager (bool willmanage)
 
virtual void checkInVariablesExclusive (opt_variables_type &active)=0
 check in variational parameters to the global list of parameters used by the optimizer. More...
 
virtual void resetParametersExclusive (const opt_variables_type &active)=0
 reset the parameters during optimizations More...
 
- Public Member Functions inherited from OptimizableObject
 OptimizableObject (const std::string &name)
 
const std::string & getName () const
 
bool isOptimized () const
 
virtual void reportStatus (std::ostream &os)
 print the state, e.g., optimizables More...
 
void setOptimization (bool state)
 
virtual void writeVariationalParameters (hdf_archive &hout)
 Write the variational parameters for this object to the VP HDF file. More...
 
virtual void readVariationalParameters (hdf_archive &hin)
 Read the variational parameters for this object from the VP HDF file. More...
 

Static Public Member Functions

static void mw_evaluateV (const int num_groups, const FakeFunctor *const functors[], const int n_src, const int *grp_ids, const int num_pairs, const int *ref_at, const T *mw_dist, const int dist_stride, T *mw_vals, Vector< char, OffloadPinnedAllocator< char >> &transfer_buffer)
 
static void mw_evaluateVGL (const int iat, const int num_groups, const FakeFunctor *const functors[], const int n_src, const int *grp_ids, const int nw, T *mw_vgl, const int n_padded, const T *mw_dist, T *mw_cur_allu, Vector< char, OffloadPinnedAllocator< char >> &transfer_buffer)
 
static void mw_updateVGL (const int iat, const std::vector< bool > &isAccepted, const int num_groups, const FakeFunctor *const functors[], const int n_src, const int *grp_ids, const int nw, T *mw_vgl, const int n_padded, const T *mw_dist, T *mw_allUat, T *mw_cur_allu, Vector< char, OffloadPinnedAllocator< char >> &transfer_buffer)
 

Public Attributes

std::vector< TinyVector< real_type, 3 > > derivs_
 
- Public Attributes inherited from OptimizableFunctorBase
real_type cutoff_radius = 0.0
 maximum cutoff More...
 
opt_variables_type myVars
 set of variables to be optimized More...
 

Additional Inherited Members

- Public Types inherited from OptimizableFunctorBase
using real_type = optimize::VariableSet::real_type
 typedef for real values More...
 
using opt_variables_type = optimize::VariableSet
 typedef for variableset: this is going to be replaced More...
 

Detailed Description

template<class T>
struct qmcplusplus::FakeFunctor< T >

Definition at line 27 of file FakeFunctor.h.

Constructor & Destructor Documentation

◆ FakeFunctor()

FakeFunctor ( const std::string &  my_name)
inline

default constructor

Definition at line 30 of file FakeFunctor.h.

Referenced by FakeFunctor< T >::makeClone().

30 : OptimizableFunctorBase(my_name) {}
OptimizableFunctorBase(const std::string &name="")
default constructor

Member Function Documentation

◆ checkInVariablesExclusive()

void checkInVariablesExclusive ( opt_variables_type active)
inlineoverridevirtual

check in variational parameters to the global list of parameters used by the optimizer.

Parameters
activea super set of optimizable variables

The existing checkInVariables implementation in WFC/SPO/.. are inclusive and it calls checkInVariables of its members class A: public SPOSet {} class B: public WFC { A objA; checkInVariables() { objA.checkInVariables(); } };

With OptimizableObject, class A: public OptimizableObject {} class B: public OptimizableObject { A objA; checkInVariablesExclusive() { // should not call objA.checkInVariablesExclusive() if objA has been extracted; } }; A vector of OptimizableObject, will be created by calling extractOptimizableObjects(). All the checkInVariablesExclusive() will be called through this vector and thus checkInVariablesExclusive implementation should only handle non-OptimizableObject members.

Implements OptimizableObject.

Definition at line 134 of file FakeFunctor.h.

134 {}

◆ checkOutVariables()

void checkOutVariables ( const opt_variables_type active)
inlineoverridevirtual

check out variational optimizable variables

Parameters
activea super set of optimizable variables

Implements OptimizableFunctorBase.

Definition at line 136 of file FakeFunctor.h.

136 {}

◆ df()

real_type df ( real_type  r)
inlineoverride

Definition at line 104 of file FakeFunctor.h.

104 { return 0.0; }

◆ evaluate() [1/3]

real_type evaluate ( real_type  r) const
inline

Definition at line 38 of file FakeFunctor.h.

Referenced by FakeFunctor< T >::f().

38 { return 0.0; }

◆ evaluate() [2/3]

real_type evaluate ( real_type  r,
real_type dudr,
real_type d2udr2 
) const
inline

Definition at line 41 of file FakeFunctor.h.

42  {
43  dudr = 0.0;
44  d2udr2 = 0.0;
45  return 0.0;
46  }

◆ evaluate() [3/3]

real_type evaluate ( real_type  r,
real_type dudr,
real_type d2udr2,
real_type d3udr3 
) const
inline

Definition at line 48 of file FakeFunctor.h.

49  {
50  dudr = 0.0;
51  d2udr2 = 0.0;
52  d3udr3 = 0.0;
53  return 0.0;
54  }

◆ evaluateDerivatives() [1/2]

bool evaluateDerivatives ( real_type  r,
std::vector< TinyVector< real_type, 3 >> &  derivs 
)
inlineoverride

Definition at line 121 of file FakeFunctor.h.

References FakeFunctor< T >::derivs_.

122  {
123  derivs = derivs_;
124  return true;
125  }
std::vector< TinyVector< real_type, 3 > > derivs_
Definition: FakeFunctor.h:141

◆ evaluateDerivatives() [2/2]

bool evaluateDerivatives ( real_type  r,
std::vector< real_type > &  derivs 
)
inlineoverride

compute derivatives with respect to variational parameters

Definition at line 129 of file FakeFunctor.h.

129 { return true; }

◆ evaluateV()

real_type evaluateV ( const int  iat,
const int  iStart,
const int  iEnd,
const T *restrict  _distArray,
T *restrict  distArrayCompressed 
) const
inline

Definition at line 57 of file FakeFunctor.h.

62  {
63  return 0.0;
64  }

◆ evaluateVGL()

void evaluateVGL ( const int  iat,
const int  iStart,
const int  iEnd,
const T *  distArray,
T *restrict  valArray,
T *restrict  gradArray,
T *restrict  laplArray,
T *restrict  distArrayCompressed,
int *restrict  distIndices 
) const
inline

Definition at line 78 of file FakeFunctor.h.

87  {}

◆ f()

real_type f ( real_type  r)
inlineoverride

Definition at line 102 of file FakeFunctor.h.

References FakeFunctor< T >::evaluate().

102 { return evaluate(r); }
real_type evaluate(real_type r) const
Definition: FakeFunctor.h:38

◆ makeClone()

OptimizableFunctorBase* makeClone ( ) const
inlineoverridevirtual

create a clone of this object

Implements OptimizableFunctorBase.

Definition at line 34 of file FakeFunctor.h.

References FakeFunctor< T >::FakeFunctor().

34 { return new FakeFunctor(*this); }
FakeFunctor(const std::string &my_name)
default constructor
Definition: FakeFunctor.h:30

◆ mw_evaluateV()

static void mw_evaluateV ( const int  num_groups,
const FakeFunctor< T > *const  functors[],
const int  n_src,
const int *  grp_ids,
const int  num_pairs,
const int *  ref_at,
const T *  mw_dist,
const int  dist_stride,
T *  mw_vals,
Vector< char, OffloadPinnedAllocator< char >> &  transfer_buffer 
)
inlinestatic

Definition at line 66 of file FakeFunctor.h.

76  {}

◆ mw_evaluateVGL()

static void mw_evaluateVGL ( const int  iat,
const int  num_groups,
const FakeFunctor< T > *const  functors[],
const int  n_src,
const int *  grp_ids,
const int  nw,
T *  mw_vgl,
const int  n_padded,
const T *  mw_dist,
T *  mw_cur_allu,
Vector< char, OffloadPinnedAllocator< char >> &  transfer_buffer 
)
inlinestatic

Definition at line 89 of file FakeFunctor.h.

100  {}

◆ mw_updateVGL()

static void mw_updateVGL ( const int  iat,
const std::vector< bool > &  isAccepted,
const int  num_groups,
const FakeFunctor< T > *const  functors[],
const int  n_src,
const int *  grp_ids,
const int  nw,
T *  mw_vgl,
const int  n_padded,
const T *  mw_dist,
T *  mw_allUat,
T *  mw_cur_allu,
Vector< char, OffloadPinnedAllocator< char >> &  transfer_buffer 
)
inlinestatic

Definition at line 106 of file FakeFunctor.h.

119  {}

◆ put()

bool put ( xmlNodePtr  cur)
inlineoverridevirtual

process xmlnode and registers variables to optimize

Parameters
curxmlNode for a functor

Implements OptimizableFunctorBase.

Definition at line 131 of file FakeFunctor.h.

131 { return true; }

◆ reset()

void reset ( )
inlineoverridevirtual

reset function

Implements OptimizableFunctorBase.

Definition at line 36 of file FakeFunctor.h.

36 {}

◆ resetParametersExclusive()

void resetParametersExclusive ( const opt_variables_type active)
inlineoverridevirtual

reset the parameters during optimizations.

Exclusive, see checkInVariablesExclusive

Implements OptimizableObject.

Definition at line 138 of file FakeFunctor.h.

138 {}

◆ setCusp()

void setCusp ( real_type  cusp)
inlineoverride

Definition at line 32 of file FakeFunctor.h.

32 {}

Member Data Documentation

◆ derivs_

std::vector<TinyVector<real_type, 3> > derivs_

Definition at line 141 of file FakeFunctor.h.

Referenced by FakeFunctor< T >::evaluateDerivatives().


The documentation for this struct was generated from the following file: