![]() |
QMCPACK
|
Public Member Functions | |
FakeOptimizableObject (const std::string &my_name, double var1=0.0, double var2=0.0) | |
void | checkInVariablesExclusive (opt_variables_type &active) override |
check in variational parameters to the global list of parameters used by the optimizer. More... | |
void | resetParametersExclusive (const opt_variables_type &active) override |
reset the parameters during optimizations. More... | |
void | writeVariationalParameters (hdf_archive &hout) override |
Write the variational parameters for this object to the VP HDF file. More... | |
void | readVariationalParameters (hdf_archive &hin) override |
Read the variational parameters for this object from the VP HDF file. More... | |
![]() | |
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) |
Public Attributes | |
double | extra_data |
opt_variables_type | myVars |
Definition at line 22 of file test_OptimizableObject.cpp.
|
inline |
Definition at line 25 of file test_OptimizableObject.cpp.
References VariableSet::insert(), and FakeOptimizableObject::myVars.
|
inlineoverridevirtual |
check in variational parameters to the global list of parameters used by the optimizer.
active | a 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 30 of file test_OptimizableObject.cpp.
References VariableSet::insertFrom(), and FakeOptimizableObject::myVars.
Referenced by qmcplusplus::TEST_CASE().
|
inlineoverridevirtual |
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 from OptimizableObject.
Definition at line 49 of file test_OptimizableObject.cpp.
References VariableSet::clear(), FakeOptimizableObject::extra_data, VariableSet::insert(), FakeOptimizableObject::myVars, hdf_archive::pop(), hdf_archive::push(), and hdf_archive::read().
Referenced by qmcplusplus::TEST_CASE().
|
inlineoverridevirtual |
reset the parameters during optimizations.
Exclusive, see checkInVariablesExclusive
Implements OptimizableObject.
Definition at line 32 of file test_OptimizableObject.cpp.
|
inlineoverridevirtual |
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 from OptimizableObject.
Definition at line 34 of file test_OptimizableObject.cpp.
References FakeOptimizableObject::extra_data, FakeOptimizableObject::myVars, hdf_archive::pop(), hdf_archive::push(), and hdf_archive::write().
Referenced by qmcplusplus::TEST_CASE().
double extra_data |
Definition at line 65 of file test_OptimizableObject.cpp.
Referenced by FakeOptimizableObject::readVariationalParameters(), qmcplusplus::TEST_CASE(), and FakeOptimizableObject::writeVariationalParameters().
opt_variables_type myVars |