QMCPACK
OptimizableObject Class Referenceabstract
+ Inheritance diagram for OptimizableObject:
+ Collaboration diagram for OptimizableObject:

Public Member Functions

 OptimizableObject (const std::string &name)
 
const std::string & getName () const
 
bool isOptimized () const
 
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...
 
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...
 

Private Attributes

const std::string name_
 Name of the optimizable object. More...
 
bool is_optimized_ = false
 If true, this object is actively modified during WFOpt. More...
 

Detailed Description

Definition at line 26 of file OptimizableObject.h.

Constructor & Destructor Documentation

◆ OptimizableObject()

OptimizableObject ( const std::string &  name)
inline

Definition at line 29 of file OptimizableObject.h.

29 : name_(name) {}
const std::string name_
Name of the optimizable object.

Member Function Documentation

◆ checkInVariablesExclusive()

virtual void checkInVariablesExclusive ( opt_variables_type active)
pure virtual

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.

Implemented in PolynomialFunctor3D, ScaledPadeFunctor< T >, PadeTwo2ndOrderFunctor< T >, BsplineFunctor< REAL >, ShortRangeCuspFunctor< T >, Pade2ndOrderFunctor< T >, ShortRangePartAdapter< T >, UserFunctor< T >, PadeFunctor< T >, RotatedSPOs, CubicSplineSingle< RT, FNOUT >, BackflowTransformation, kSpaceJastrow, FakeFunctor< T >, GaussianTimesRN< T >, CountingJastrow< RegionType >, MultiSlaterDetTableMethod, ExampleHeComponent, and FakeOptimizableObject.

◆ getName()

const std::string& getName ( ) const
inline

Definition at line 31 of file OptimizableObject.h.

References OptimizableObject::name_.

Referenced by UniqueOptObjRefs::push_back().

31 { return name_; }
const std::string name_
Name of the optimizable object.

◆ isOptimized()

bool isOptimized ( ) const
inline

Definition at line 32 of file OptimizableObject.h.

References OptimizableObject::is_optimized_.

32 { return is_optimized_; }
bool is_optimized_
If true, this object is actively modified during WFOpt.

◆ readVariationalParameters()

virtual void readVariationalParameters ( hdf_archive hin)
inlinevirtual

Read the variational parameters for this object from the VP HDF file.

The hin parameter should come from VariableSet::readFromHDF

By default the parameters are read in VariableSet::readFromHDF, and objects do not need to implement this function (yet).

Reimplemented in RotatedSPOs, and FakeOptimizableObject.

Definition at line 95 of file OptimizableObject.h.

95 {};

◆ reportStatus()

virtual void reportStatus ( std::ostream &  os)
inlinevirtual

print the state, e.g., optimizables

Reimplemented in BsplineFunctor< REAL >, CountingJastrow< RegionType >, BackflowTransformation, and CubicSplineSingle< RT, FNOUT >.

Definition at line 72 of file OptimizableObject.h.

72 {}

◆ resetParametersExclusive()

◆ setOptimization()

void setOptimization ( bool  state)
inline

Definition at line 74 of file OptimizableObject.h.

References OptimizableObject::is_optimized_.

74 { is_optimized_ = state; }
bool is_optimized_
If true, this object is actively modified during WFOpt.

◆ writeVariationalParameters()

virtual void writeVariationalParameters ( hdf_archive hout)
inlinevirtual

Write the variational parameters for this object to the VP HDF file.

The hout parameter should come from VariableSet::writeToHDF

Objects can use this function to store additional information to the file.

By default the parameters are saved in VariableSet::writeToHDF, and objects do not need to implement this function (yet).

Reimplemented in RotatedSPOs, and FakeOptimizableObject.

Definition at line 86 of file OptimizableObject.h.

86 {};

Member Data Documentation

◆ is_optimized_

bool is_optimized_ = false
private

If true, this object is actively modified during WFOpt.

Definition at line 40 of file OptimizableObject.h.

Referenced by OptimizableObject::isOptimized(), and OptimizableObject::setOptimization().

◆ name_

const std::string name_
private

Name of the optimizable object.

Definition at line 37 of file OptimizableObject.h.

Referenced by OptimizableObject::getName().


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