#include <islp_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 std::vector < std::vector< interval > > * | data_type |
Public Member Functions | |
prep_islp_eval (std::vector< std::vector< interval > > &__d, unsigned int _num_of_nodes) | |
prep_islp_eval (const prep_islp_eval &__x) | |
~prep_islp_eval () | |
bool | is_cached (const expression_node &__data) |
int | initialize (const expression_node &__data) |
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 void | cleanup (const node_data_type &__data) |
virtual int | update (const node_data_type &__data, const return_value &__rval) |
virtual int | update (const return_value &__rval) |
virtual const_walker | short_cut_to (const node_data_type &__data) |
void | initialize () |
void | retrieve_from_cache (const expression_node &__data) |
void | calculate (const expression_node &__data) |
int | update (bool __rval) |
int | update (const expression_node &__data, bool __rval) |
bool | calculate_value (bool eval_all) |
Protected Attributes | |
const variable_indicator * | v_ind |
std::vector< std::vector < interval > > * | eval_data |
Definition at line 74 of file islp_evaluator.h.
typedef _Base::const_walker coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_walker >::const_walker [inherited] |
This is the type of the walker, which is used for the short-cuts.
Reimplemented from coco::cached_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool,expression_const_walker >.
Definition at line 723 of file evaluator.h.
typedef std::vector< std::vector< interval > > * coco::_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_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_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_walker >::node_data_type [inherited] |
The node_data_type is the datatype of the nodes of the graph.
Reimplemented from coco::cached_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool,expression_const_walker >.
Definition at line 719 of file evaluator.h.
typedef _Base::return_value coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_walker >::return_value [inherited] |
This type is the result type of the evaluator.
Reimplemented from coco::cached_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool,expression_const_walker >.
Definition at line 721 of file evaluator.h.
coco::prep_islp_eval::prep_islp_eval | ( | std::vector< std::vector< interval > > & | __d, | |
unsigned int | _num_of_nodes | |||
) | [inline] |
Constructor, which takes __d
as first order slope data structure which is to be prepared, and the number of nodes _num_of_nodes
of the DAG.
Definition at line 87 of file islp_evaluator.h.
coco::prep_islp_eval::prep_islp_eval | ( | const prep_islp_eval & | __x | ) | [inline] |
Standard Copy Constructor
Definition at line 97 of file islp_evaluator.h.
coco::prep_islp_eval::~prep_islp_eval | ( | ) | [inline] |
Standard Destructor
Definition at line 100 of file islp_evaluator.h.
void coco::prep_islp_eval::calculate | ( | const expression_node & | __data | ) | [inline, virtual] |
The retrieve_from_cache, initialize, calculate, calculate_value, and update methods are basically NOP versions.
Reimplemented from coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool, expression_const_walker >.
Definition at line 123 of file islp_evaluator.h.
bool coco::prep_islp_eval::calculate_value | ( | bool | eval_all | ) | [inline, virtual] |
The retrieve_from_cache, initialize, calculate, calculate_value, and update methods are basically NOP versions.
Reimplemented from coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool, expression_const_walker >.
Definition at line 130 of file islp_evaluator.h.
virtual void coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_walker >::cleanup | ( | const node_data_type & | __data | ) | [inline, virtual, inherited] |
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.
Definition at line 804 of file evaluator.h.
int coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_walker >::collect | ( | const node_data_type & | __data, | |
const return_value & | __rval | |||
) | [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. It is translated to a call to update.
Reimplemented from coco::_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool,expression_const_walker >.
Definition at line 750 of file evaluator.h.
void coco::prep_islp_eval::initialize | ( | ) | [inline, virtual] |
The retrieve_from_cache, initialize, calculate, calculate_value, and update methods are basically NOP versions.
Reimplemented from coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool, expression_const_walker >.
Definition at line 119 of file islp_evaluator.h.
int coco::prep_islp_eval::initialize | ( | const expression_node & | __data | ) | [inline, virtual] |
Initialize method for normal nodes
Reimplemented from coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool, expression_const_walker >.
Definition at line 109 of file islp_evaluator.h.
bool coco::prep_islp_eval::is_cached | ( | const expression_node & | __data | ) | [inline, virtual] |
Check whether this node has already been visited
Reimplemented from coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool, expression_const_walker >.
Definition at line 103 of file islp_evaluator.h.
void coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_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. It is translated into calls to calculate and cleanup.
Reimplemented from coco::_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool,expression_const_walker >.
Definition at line 744 of file evaluator.h.
int coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_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. It checks whether the result of this node is cached and calls either retrieve_from_cache and stops the downwards walk or calls initialize.
Reimplemented from coco::cached_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool,expression_const_walker >.
Definition at line 732 of file evaluator.h.
void coco::prep_islp_eval::retrieve_from_cache | ( | const expression_node & | __data | ) | [inline, virtual] |
The retrieve_from_cache, initialize, calculate, calculate_value, and update methods are basically NOP versions.
Reimplemented from coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool, expression_const_walker >.
Definition at line 121 of file islp_evaluator.h.
virtual const_walker coco::cached_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_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_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_walker >::update | ( | const return_value & | __rval | ) | [inline, virtual, inherited] |
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. |
Definition at line 826 of file evaluator.h.
virtual int coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_walker >::update | ( | const node_data_type & | __data, | |
const return_value & | __rval | |||
) | [inline, virtual, inherited] |
The update method 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 814 of file evaluator.h.
int coco::prep_islp_eval::update | ( | const expression_node & | __data, | |
bool | __rval | |||
) | [inline] |
The retrieve_from_cache, initialize, calculate, calculate_value, and update methods are basically NOP versions.
Definition at line 127 of file islp_evaluator.h.
int coco::prep_islp_eval::update | ( | bool | __rval | ) | [inline] |
The retrieve_from_cache, initialize, calculate, calculate_value, and update methods are basically NOP versions.
Definition at line 125 of file islp_evaluator.h.
return_value coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_walker >::value | ( | ) | [inline, virtual, inherited] |
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< std::vector< std::vector< interval > > *, expression_node, bool,expression_const_walker >.
Definition at line 762 of file evaluator.h.
int coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_walker >::vcollect | ( | const return_value & | __rval | ) | [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. It is translated to a call to update.
Reimplemented from coco::_evaluator_base< std::vector< std::vector< interval > > *, expression_node, bool,expression_const_walker >.
Definition at line 756 of file evaluator.h.
void coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_walker >::vinit | ( | ) | [inline, inherited] |
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 771 of file evaluator.h.
return_value coco::cached_forward_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_walker >::vvalue | ( | ) | [inline, virtual, inherited] |
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< std::vector< std::vector< interval > > *, expression_node, bool,expression_const_walker >.
Definition at line 767 of file evaluator.h.
std::vector< std::vector< interval > > * coco::_evaluator_base< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_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< std::vector< std::vector< interval > > * , expression_node , bool , expression_const_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.