mpqc::math::Function< Value, Parameters > Class Template Referenceabstract
Documentation
template<typename Value, typename Parameters>
class mpqc::math::Function< Value, Parameters >
Function maps Parameters to a Value.
Function keeps parameters and value as part of its state. It recomputes the value as necessary by keeping track of timestamps on parameters and value. The value can also be made obsolete explicitly. Lastly, Function provides support for the Visitor pattern.
- Note
- both Value and Parameters are managed via shared pointers
Public Types | |
typedef Value | value_type |
typedef Parameters | parameters_type |
template<typename X > | |
using | Timestampable = ::mpqc::utility::Timestampable< X > |
Public Member Functions | |
Function ()=default | |
virtual | ~Function () |
Function (std::shared_ptr< Parameters > params) | |
std::shared_ptr< const Value > | value () |
bool | must_compute () const |
std::shared_ptr< const Parameters > | params () const |
virtual void | set_params (std::shared_ptr< Parameters > params) |
Protected Member Functions | |
const Timestampable< Value > & | get_value () const |
void | set_value (Value v) |
virtual void | compute ()=0 |
evaluates value , implemented by the derived class More... | |
Friends | |
class | FunctionVisitorBase< Function< Value, Parameters > > |
Member Typedef Documentation
◆ parameters_type
template<typename Value , typename Parameters >
typedef Parameters mpqc::math::Function< Value, Parameters >::parameters_type |
◆ Timestampable
template<typename Value , typename Parameters >
template<typename X >
using mpqc::math::Function< Value, Parameters >::Timestampable = ::mpqc::utility::Timestampable<X> |
◆ value_type
template<typename Value , typename Parameters >
typedef Value mpqc::math::Function< Value, Parameters >::value_type |
Constructor & Destructor Documentation
◆ Function() [1/2]
template<typename Value , typename Parameters >
|
default |
◆ ~Function()
template<typename Value , typename Parameters >
|
inlinevirtual |
◆ Function() [2/2]
template<typename Value , typename Parameters >
|
inlineexplicit |
Member Function Documentation
◆ compute()
template<typename Value , typename Parameters >
|
protectedpure virtual |
evaluates value
, implemented by the derived class
◆ get_value()
template<typename Value , typename Parameters >
|
inlineprotected |
Direct access to the value of this function, bypasses timestamp check
- Returns
- the current value, i.e.
value_
◆ must_compute()
template<typename Value , typename Parameters >
|
inline |
◆ params()
template<typename Value , typename Parameters >
|
inline |
◆ set_params()
template<typename Value , typename Parameters >
|
inlinevirtual |
◆ set_value()
template<typename Value , typename Parameters >
|
inlineprotected |
Sets the value of this function, used by the compute() method of derived classes or by Function visitors via FunctionVisitorBase::set_value() .
- Parameters
-
v the value to be returned by Function::value()
◆ value()
template<typename Value , typename Parameters >
|
inline |
Timestampable<Value> will be converted to temporary Value, has to return by value here
Friends And Related Function Documentation
◆ FunctionVisitorBase< Function< Value, Parameters > >
template<typename Value , typename Parameters >
|
friend |
The documentation for this class was generated from the following file:
- mpqc/math/function/function.h