coco::model::model::lincoeff_visitor Class Reference

#include <model.hpp>

Inheritance diagram for coco::model::model::lincoeff_visitor:

Inheritance graph
[legend]
Collaboration diagram for coco::model::model::lincoeff_visitor:

Collaboration graph
[legend]

List of all members.

Public Types

typedef _Base::node_data_type node_data_type
typedef _Base::return_value return_value
typedef _Base::const_walker const_walker
typedef lincoeff_visitor_st data_type

Public Member Functions

 lincoeff_visitor (const std::vector< interval > *_rg, linalg::sparse_vector< double > *_cf, double *_cs, const model *_m)
 lincoeff_visitor (const lincoeff_visitor &__x)
 ~lincoeff_visitor ()
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 return_value &__rval)
virtual int update (const node_data_type &__data, const return_value &__rval)
bool is_cached (const expression_node &__data)
virtual const_walker short_cut_to (const expression_node &__data)
void initialize ()
void initialize (const expression_node &__data)
void retrieve_from_cache (const expression_node &__data)
int calculate (const expression_node &__data)
int update (const expression_node &__data, const lincoeff_visitor_ret &__rval)
int update (const lincoeff_visitor_ret &__rval)
lincoeff_visitor_ret calculate_value (bool eval_all)

Protected Attributes

const variable_indicatorv_ind
lincoeff_visitor_st eval_data


Detailed Description

This cached backward evaluator is used to collect the coefficients of a linear node on a DAG.

Definition at line 2109 of file model.hpp.


Member Typedef Documentation

This is the type of the walker, which is used for the short-cuts.

Reimplemented from coco::cached_evaluator_base< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret,model::const_walker >.

Definition at line 853 of file evaluator.h.

The data_type specifies the type of the internal data of the evaluator.

Definition at line 305 of file evaluator.h.

The node_data_type is the datatype of the nodes of the graph.

Reimplemented from coco::cached_evaluator_base< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret,model::const_walker >.

Definition at line 849 of file evaluator.h.

This type is the result type of the evaluator.

Reimplemented from coco::cached_evaluator_base< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret,model::const_walker >.

Definition at line 851 of file evaluator.h.


Constructor & Destructor Documentation

coco::model::model::lincoeff_visitor::lincoeff_visitor ( const std::vector< interval > *  _rg,
linalg::sparse_vector< double > *  _cf,
double *  _cs,
const model _m 
) [inline]

Constructor, which initializes the node ranges ranges with _rg, the results coeffs and constant with _cf and _cs, respectively, and the model mod with _m.

Definition at line 2122 of file model.hpp.

coco::model::model::lincoeff_visitor::lincoeff_visitor ( const lincoeff_visitor __x  )  [inline]

Standard Copy Constructor

Definition at line 2142 of file model.hpp.

coco::model::model::lincoeff_visitor::~lincoeff_visitor (  )  [inline]

Standard Destructor

Definition at line 2145 of file model.hpp.


Member Function Documentation

int coco::model::model::lincoeff_visitor::calculate ( const expression_node __data  )  [inline, virtual]

This is a method as needed by a cached backward evaluator.

See also:
cached_backward_evaluator_base.

Reimplemented from coco::cached_backward_evaluator_base< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret, model::const_walker >.

Definition at line 2205 of file model.hpp.

lincoeff_visitor_ret coco::model::model::lincoeff_visitor::calculate_value ( bool  eval_all  )  [inline, virtual]

This is a method as needed by a cached backward evaluator.

See also:
cached_backward_evaluator_base.

Reimplemented from coco::cached_backward_evaluator_base< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret, model::const_walker >.

Definition at line 2791 of file model.hpp.

virtual void coco::cached_backward_evaluator_base< lincoeff_visitor_st , expression_node , lincoeff_visitor_ret , model::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 925 of file evaluator.h.

int coco::cached_backward_evaluator_base< lincoeff_visitor_st , expression_node , lincoeff_visitor_ret , model::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< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret,model::const_walker >.

Definition at line 879 of file evaluator.h.

void coco::model::model::lincoeff_visitor::initialize ( const expression_node __data  )  [inline]

This is a method as needed by a cached backward evaluator.

See also:
cached_backward_evaluator_base.

Definition at line 2172 of file model.hpp.

void coco::model::model::lincoeff_visitor::initialize (  )  [inline, virtual]

This is a method as needed by a cached backward evaluator.

See also:
cached_backward_evaluator_base.

Reimplemented from coco::cached_backward_evaluator_base< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret, model::const_walker >.

Definition at line 2161 of file model.hpp.

bool coco::model::model::lincoeff_visitor::is_cached ( const expression_node __data  )  [inline, virtual]

This is a method as needed by a cached backward evaluator.

See also:
cached_backward_evaluator_base.

Reimplemented from coco::cached_backward_evaluator_base< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret, model::const_walker >.

Definition at line 2150 of file model.hpp.

void coco::cached_backward_evaluator_base< lincoeff_visitor_st , expression_node , lincoeff_visitor_ret , model::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 a call to cleanup.

Reimplemented from coco::_evaluator_base< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret,model::const_walker >.

Definition at line 874 of file evaluator.h.

int coco::cached_backward_evaluator_base< lincoeff_visitor_st , expression_node , lincoeff_visitor_ret , model::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 calculate.

Reimplemented from coco::cached_evaluator_base< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret,model::const_walker >.

Definition at line 862 of file evaluator.h.

void coco::model::model::lincoeff_visitor::retrieve_from_cache ( const expression_node __data  )  [inline, virtual]

This is a method as needed by a cached backward evaluator.

See also:
cached_backward_evaluator_base.

Reimplemented from coco::cached_backward_evaluator_base< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret, model::const_walker >.

Definition at line 2183 of file model.hpp.

virtual const_walker coco::model::model::lincoeff_visitor::short_cut_to ( const expression_node __data  )  [inline, virtual]

This is a method as needed by a cached backward evaluator.

See also:
cached_backward_evaluator_base.

Reimplemented from coco::cached_evaluator_base< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret,model::const_walker >.

Definition at line 2156 of file model.hpp.

virtual int coco::cached_backward_evaluator_base< lincoeff_visitor_st , expression_node , lincoeff_visitor_ret , model::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 __data parameter contains the node data of the graph node being visited. The return value has the following effect:
<0stop visiting children of this node,
0continue with the graph walk downwards the next child,
>0skip as many children.

Definition at line 951 of file evaluator.h.

virtual int coco::cached_backward_evaluator_base< lincoeff_visitor_st , expression_node , lincoeff_visitor_ret , model::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:
<0stop visiting children of this node,
0continue with the graph walk downwards the next child,
>0skip as many children.

Definition at line 940 of file evaluator.h.

int coco::model::model::lincoeff_visitor::update ( const lincoeff_visitor_ret __rval  )  [inline]

This is a method as needed by a cached backward evaluator.

See also:
cached_backward_evaluator_base.

Definition at line 2783 of file model.hpp.

int coco::model::model::lincoeff_visitor::update ( const expression_node __data,
const lincoeff_visitor_ret __rval 
) [inline]

This is a method as needed by a cached backward evaluator.

See also:
cached_backward_evaluator_base.

Definition at line 2311 of file model.hpp.

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< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret,model::const_walker >.

Definition at line 891 of file evaluator.h.

int coco::cached_backward_evaluator_base< lincoeff_visitor_st , expression_node , lincoeff_visitor_ret , model::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< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret,model::const_walker >.

Definition at line 885 of file evaluator.h.

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.

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< lincoeff_visitor_st, expression_node, lincoeff_visitor_ret,model::const_walker >.

Definition at line 896 of file evaluator.h.


Member Data Documentation

The internal data of the evaluator

Definition at line 316 of file evaluator.h.

For caching a variable indicator is needed to check which nodes need not be re-evaluated.

Definition at line 427 of file evaluator.h.


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

Generated on Tue Feb 9 14:49:42 2010 for COCONUT API by  doxygen 1.5.8