#include <evaluator.h>
Public Types | |
typedef _Base::node_data_type | node_data_type |
typedef _Base::return_value | return_value |
typedef _Base::const_walker | const_walker |
typedef _Tp | data_type |
Public Member Functions | |
int | preorder (const node_data_type &__data) |
void | postorder (const node_data_type &__data) |
int | collect (const node_data_type &__data, const return_value &__rval) |
int | vcollect (const return_value &__rval) |
return_value | value () |
return_value | vvalue () |
void | vinit () |
virtual bool | is_cached (const node_data_type &__data) |
virtual void | initialize () |
virtual int | calculate (const node_data_type &__data) |
virtual void | cleanup (const node_data_type &__data) |
virtual void | retrieve_from_cache (const node_data_type &__data) |
virtual int | update (const return_value &__rval) |
virtual int | update (const node_data_type &__data, const return_value &__rval) |
virtual return_value | calculate_value (bool eval_all) |
virtual int | preorder (const node_data_type &__data) |
virtual const_walker | short_cut_to (const node_data_type &__data) |
virtual int | vcollect (const return_value &__cresult) |
virtual int | collect (const node_data_type &__data, const return_value &__cresult) |
virtual void | postorder (const node_data_type &__data) |
Protected Attributes | |
const variable_indicator * | v_ind |
_Tp | eval_data |
Definition at line 841 of file evaluator.h.
typedef _Base::const_walker coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::const_walker |
This is the type of the walker, which is used for the short-cuts.
Reimplemented from coco::cached_evaluator_base< _Tp, _NData, _Result, _Walker >.
Definition at line 853 of file evaluator.h.
typedef _Tp coco::_evaluator_base< _Tp , _NData , _Result , _Walker >::data_type [inherited] |
The data_type specifies the type of the internal data of the evaluator.
Definition at line 305 of file evaluator.h.
typedef _Base::node_data_type coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::node_data_type |
The node_data_type is the datatype of the nodes of the graph.
Reimplemented from coco::cached_evaluator_base< _Tp, _NData, _Result, _Walker >.
Definition at line 849 of file evaluator.h.
typedef _Base::return_value coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::return_value |
This type is the result type of the evaluator.
Reimplemented from coco::cached_evaluator_base< _Tp, _NData, _Result, _Walker >.
Definition at line 851 of file evaluator.h.
virtual int coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::calculate | ( | const node_data_type & | __data | ) | [inline, virtual] |
This method is called right before all children of a node are visited. The __data
parameter contains the node data of the graph node being visited. The return value determines how the graph walk proceeds.
<0 | perform a short-cut (the short_cut_to method will be called), |
0 | don't visit the children, proceed with postorder, |
>0 | continue with the walk by visiting the children. |
Reimplemented in coco::der_eval, coco::der_eval, coco::hessBackwardEvaluator, coco::ider_eval, coco::ihessBackwardEvaluator, coco::islp_eval, and coco::model::model::lincoeff_visitor.
Definition at line 921 of file evaluator.h.
virtual return_value coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::calculate_value | ( | bool | eval_all | ) | [inline, virtual] |
This method is called last for every graph node, and it produces the return value of the visitor. The parameter eval_all
is true
whether the node is a virtual node.
Reimplemented in coco::der_eval, coco::der_eval, coco::hessBackwardEvaluator, coco::ider_eval, coco::ihessBackwardEvaluator, coco::islp_eval, and coco::model::model::lincoeff_visitor.
Definition at line 956 of file evaluator.h.
virtual void coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::cleanup | ( | const node_data_type & | __data | ) | [inline, virtual] |
The cleanup method is called just before calculate_value and should be used to clean up dynamically allocated data. The __data
parameter contains the node data of the graph node being visited.
Reimplemented in coco::der_eval, coco::der_eval, coco::hessBackwardEvaluator, coco::ider_eval, coco::ihessBackwardEvaluator, and coco::islp_eval.
Definition at line 925 of file evaluator.h.
virtual int coco::_evaluator_base< _Tp , _NData , _Result , _Walker >::collect | ( | const node_data_type & | __data, | |
const return_value & | __cresult | |||
) | [inline, virtual, inherited] |
This method is needed by a visitor (see VGTL documentation) and is called for each normal node everytime a child node has been visited passing the return value of the child. The return value has the following effect:
<0 | stop visiting children of this node, |
0 | continue with the graph walk downwards the next child, |
>0 | skip as many children. |
Definition at line 359 of file evaluator.h.
int coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::collect | ( | const node_data_type & | __data, | |
const return_value & | __rval | |||
) | [inline] |
This method is needed by a visitor (see VGTL documentation) and is called for each normal node everytime a child node has been visited passing the return value of the child. It is translated to a call to update.
Definition at line 879 of file evaluator.h.
virtual void coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::initialize | ( | ) | [inline, virtual] |
This method is called at a virtual node before any children are visited.
Reimplemented in coco::der_eval, coco::der_eval, coco::hessBackwardEvaluator, coco::ider_eval, coco::ihessBackwardEvaluator, coco::islp_eval, and coco::model::model::lincoeff_visitor.
Definition at line 910 of file evaluator.h.
virtual bool coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::is_cached | ( | const node_data_type & | __data | ) | [inline, virtual] |
This method checks whether the return value for this method is in the cache or can be calculated without visiting the children.
Reimplemented in coco::der_eval, coco::der_eval, coco::hessBackwardEvaluator, coco::ider_eval, coco::ihessBackwardEvaluator, coco::islp_eval, and coco::model::model::lincoeff_visitor.
Definition at line 905 of file evaluator.h.
virtual void coco::_evaluator_base< _Tp , _NData , _Result , _Walker >::postorder | ( | const node_data_type & | __data | ) | [inline, virtual, inherited] |
This method is needed by a visitor (see VGTL documentation) and is called right after all children of a node have been visited.
Definition at line 364 of file evaluator.h.
void coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::postorder | ( | const node_data_type & | __data | ) | [inline] |
This method is needed by a visitor (see VGTL documentation) and is called right after all children of a node have been visited. It is translated into a call to cleanup.
Definition at line 874 of file evaluator.h.
virtual int coco::cached_evaluator_base< _Tp , _NData , _Result , _Walker >::preorder | ( | const node_data_type & | __data | ) | [inline, virtual, inherited] |
This method is needed by a visitor (see VGTL documentation) and is called right before any children of a node are visited. The return value of the method influences the further graph walk:
<0 | perform a short-cut (the short_cut_to method will be called), |
0 | don't visit the children, proceed with postorder, |
>0 | continue with the walk by visiting the children. |
Definition at line 446 of file evaluator.h.
int coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::preorder | ( | const node_data_type & | __data | ) | [inline] |
This method is needed by a visitor (see VGTL documentation) and is called right before any children of a node are visited. It checks whether the result of this node is cached and calls either retrieve_from_cache and stops the downwards walk or calls calculate.
Definition at line 862 of file evaluator.h.
virtual void coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::retrieve_from_cache | ( | const node_data_type & | __data | ) | [inline, virtual] |
The retrieve_from_cache method is called for retrieving the result for this node from the cache or calculate it without visiting the node's children.
Reimplemented in coco::der_eval, coco::der_eval, coco::ider_eval, coco::islp_eval, and coco::model::model::lincoeff_visitor.
Definition at line 929 of file evaluator.h.
virtual const_walker coco::cached_evaluator_base< _Tp , _NData , _Result , _Walker >::short_cut_to | ( | const node_data_type & | __data | ) | [inline, virtual, inherited] |
The short_cut_to method is called whenever a short-cut is signalled during the graph walk, and the const_walker
returned is the target of the short-cut.
Definition at line 450 of file evaluator.h.
virtual int coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::update | ( | const node_data_type & | __data, | |
const return_value & | __rval | |||
) | [inline, virtual] |
The update method is called for each virtual node everytime a child node has been visited passing the return value of the child. The __data
parameter contains the node data of the graph node being visited. The return value has the following effect:
<0 | stop visiting children of this node, |
0 | continue with the graph walk downwards the next child, |
>0 | skip as many children. |
Reimplemented in coco::der_eval, coco::der_eval, coco::hessBackwardEvaluator, coco::ider_eval, coco::ihessBackwardEvaluator, and coco::islp_eval.
Definition at line 951 of file evaluator.h.
virtual int coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::update | ( | const return_value & | __rval | ) | [inline, virtual] |
The update method is called for each virtual node everytime a child node has been visited passing the return value of the child. The __data
parameter contains the node data of the graph node being visited. The return value has the following effect:
<0 | stop visiting children of this node, |
0 | continue with the graph walk downwards the next child, |
>0 | skip as many children. |
Reimplemented in coco::der_eval, coco::der_eval, coco::hessBackwardEvaluator, coco::ider_eval, coco::ihessBackwardEvaluator, and coco::islp_eval.
Definition at line 940 of file evaluator.h.
return_value coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::value | ( | ) | [inline, virtual] |
This method is needed by a visitor (see VGTL documentation) and is called right before the end of the visit of a normal node to retrieve the return value. It is translated to a call to calculate_value with parameter false
.
Reimplemented from coco::_evaluator_base< _Tp, _NData, _Result,_Walker >.
Definition at line 891 of file evaluator.h.
virtual int coco::_evaluator_base< _Tp , _NData , _Result , _Walker >::vcollect | ( | const return_value & | __cresult | ) | [inline, virtual, inherited] |
This method is needed by a visitor (see VGTL documentation) and is called for each virtual node everytime a child node has been visited passing the return value of the child. The return value has the following effect:
<0 | stop visiting children of this node, |
0 | continue with the graph walk downwards the next child, |
>0 | skip as many children. |
Definition at line 348 of file evaluator.h.
int coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::vcollect | ( | const return_value & | __rval | ) | [inline] |
This method is needed by a visitor (see VGTL documentation) and is called for each virtual node everytime a child node has been visited passing the return value of the child. It is translated to a call to update.
Definition at line 885 of file evaluator.h.
void coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::vinit | ( | ) | [inline] |
This method is needed by a visitor using recursive_short_cut_walk for traversing the graph. It is called before performing any graph walk when at a virtual node. It is translated to initialize.
Definition at line 900 of file evaluator.h.
return_value coco::cached_backward_evaluator_base< _Tp, _NData, _Result, _Walker >::vvalue | ( | ) | [inline, virtual] |
This method is needed by a visitor (see VGTL documentation) and is called right before the end of the visit of a virtual node to retrieve the return value. It is translated to a call to calculate_value with parameter true
.
Reimplemented from coco::_evaluator_base< _Tp, _NData, _Result,_Walker >.
Definition at line 896 of file evaluator.h.
_Tp coco::_evaluator_base< _Tp , _NData , _Result , _Walker >::eval_data [protected, inherited] |
The internal data of the evaluator
Definition at line 316 of file evaluator.h.
const variable_indicator* coco::cached_evaluator_base< _Tp , _NData , _Result , _Walker >::v_ind [protected, inherited] |
For caching a variable indicator is needed to check which nodes need not be re-evaluated.
Definition at line 427 of file evaluator.h.