coco::hessBackwardEvaluator Class Reference

#include <hess_evaluator.h>

Inheritance diagram for coco::hessBackwardEvaluator:

Inheritance graph
[legend]
Collaboration diagram for coco::hessBackwardEvaluator:

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 hessBackwardEvaluatorType data_type

Public Member Functions

 hessBackwardEvaluator (std::vector< std::vector< double > > *__der_data, std::vector< std::vector< double > > *__hess_data, variable_indicator &__v, const model &__m, std::vector< std::vector< double > > *__d, std::vector< std::vector< double > > *__h, std::vector< double > *__grad, std::vector< double > *__hess)
 hessBackwardEvaluator (const hessBackwardEvaluator &__he)
 ~hessBackwardEvaluator ()
void newPoint (std::vector< std::vector< double > > *__der_data, std::vector< std::vector< double > > *__hess_data, const variable_indicator &__v)
void newResult (std::vector< double > *__grad, std::vector< double > *__hess)
void set_mult (double scal)
expression_const_walker short_cut_to (const expression_node &__data)
void initialize ()
int calculate (const expression_node &__data)
void cleanup (const expression_node &__data)
int update (const bool &__rval)
int update (const expression_node &__data, const bool &__rval)
bool calculate_value (bool eval_all)
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 retrieve_from_cache (const node_data_type &__data)

Protected Member Functions

bool is_cached (const node_data_type &__data)

Protected Attributes

const variable_indicatorv_ind
hessBackwardEvaluatorType eval_data


Detailed Description

Definition at line 1167 of file hess_evaluator.h.


Member Typedef Documentation

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

Reimplemented from coco::cached_evaluator_base< hessBackwardEvaluatorType, expression_node, bool,expression_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< hessBackwardEvaluatorType, expression_node, bool,expression_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< hessBackwardEvaluatorType, expression_node, bool,expression_const_walker >.

Definition at line 851 of file evaluator.h.


Constructor & Destructor Documentation

coco::hessBackwardEvaluator::hessBackwardEvaluator ( std::vector< std::vector< double > > *  __der_data,
std::vector< std::vector< double > > *  __hess_data,
variable_indicator __v,
const model __m,
std::vector< std::vector< double > > *  __d,
std::vector< std::vector< double > > *  __h,
std::vector< double > *  __grad,
std::vector< double > *  __hess 
) [inline]

Definition at line 1189 of file hess_evaluator.h.

coco::hessBackwardEvaluator::hessBackwardEvaluator ( const hessBackwardEvaluator __he  )  [inline]

Definition at line 1219 of file hess_evaluator.h.

coco::hessBackwardEvaluator::~hessBackwardEvaluator (  )  [inline]

Definition at line 1221 of file hess_evaluator.h.


Member Function Documentation

int coco::hessBackwardEvaluator::calculate ( const expression_node __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.
<0perform a short-cut (the short_cut_to method will be called),
0don't visit the children, proceed with postorder,
>0continue with the walk by visiting the children.

Reimplemented from coco::cached_backward_evaluator_base< hessBackwardEvaluatorType, expression_node, bool, expression_const_walker >.

Definition at line 1261 of file hess_evaluator.h.

bool coco::hessBackwardEvaluator::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 from coco::cached_backward_evaluator_base< hessBackwardEvaluatorType, expression_node, bool, expression_const_walker >.

Definition at line 1500 of file hess_evaluator.h.

void coco::hessBackwardEvaluator::cleanup ( const expression_node __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 from coco::cached_backward_evaluator_base< hessBackwardEvaluatorType, expression_node, bool, expression_const_walker >.

Definition at line 1398 of file hess_evaluator.h.

int coco::cached_backward_evaluator_base< hessBackwardEvaluatorType , 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< hessBackwardEvaluatorType, expression_node, bool,expression_const_walker >.

Definition at line 879 of file evaluator.h.

void coco::hessBackwardEvaluator::initialize (  )  [inline, virtual]

This method is called at a virtual node before any children are visited.

Reimplemented from coco::cached_backward_evaluator_base< hessBackwardEvaluatorType, expression_node, bool, expression_const_walker >.

Definition at line 1250 of file hess_evaluator.h.

bool coco::hessBackwardEvaluator::is_cached ( const node_data_type __data  )  [inline, protected, virtual]

This method checks whether the return value for this method is in the cache or can be calculated without visiting the children.

Reimplemented from coco::cached_backward_evaluator_base< hessBackwardEvaluatorType, expression_node, bool, expression_const_walker >.

Definition at line 1176 of file hess_evaluator.h.

void coco::hessBackwardEvaluator::newPoint ( std::vector< std::vector< double > > *  __der_data,
std::vector< std::vector< double > > *  __hess_data,
const variable_indicator __v 
) [inline]

Definition at line 1223 of file hess_evaluator.h.

void coco::hessBackwardEvaluator::newResult ( std::vector< double > *  __grad,
std::vector< double > *  __hess 
) [inline]

Definition at line 1233 of file hess_evaluator.h.

void coco::cached_backward_evaluator_base< hessBackwardEvaluatorType , 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 a call to cleanup.

Reimplemented from coco::_evaluator_base< hessBackwardEvaluatorType, expression_node, bool,expression_const_walker >.

Definition at line 874 of file evaluator.h.

int coco::cached_backward_evaluator_base< hessBackwardEvaluatorType , 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 calculate.

Reimplemented from coco::cached_evaluator_base< hessBackwardEvaluatorType, expression_node, bool,expression_const_walker >.

Definition at line 862 of file evaluator.h.

virtual void coco::cached_backward_evaluator_base< hessBackwardEvaluatorType , expression_node , bool , expression_const_walker >::retrieve_from_cache ( const node_data_type __data  )  [inline, virtual, inherited]

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.

Definition at line 929 of file evaluator.h.

void coco::hessBackwardEvaluator::set_mult ( double  scal  )  [inline]

Definition at line 1239 of file hess_evaluator.h.

expression_const_walker coco::hessBackwardEvaluator::short_cut_to ( const expression_node __data  )  [inline, virtual]

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.

Reimplemented from coco::cached_evaluator_base< hessBackwardEvaluatorType, expression_node, bool,expression_const_walker >.

Definition at line 1246 of file hess_evaluator.h.

int coco::hessBackwardEvaluator::update ( const expression_node __data,
const bool &  __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:
<0stop visiting children of this node,
0continue with the graph walk downwards the next child,
>0skip as many children.

Reimplemented from coco::cached_backward_evaluator_base< hessBackwardEvaluatorType, expression_node, bool, expression_const_walker >.

Definition at line 1446 of file hess_evaluator.h.

int coco::hessBackwardEvaluator::update ( const bool &  __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:
<0stop visiting children of this node,
0continue with the graph walk downwards the next child,
>0skip as many children.

Reimplemented from coco::cached_backward_evaluator_base< hessBackwardEvaluatorType, expression_node, bool, expression_const_walker >.

Definition at line 1436 of file hess_evaluator.h.

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< hessBackwardEvaluatorType, expression_node, bool,expression_const_walker >.

Definition at line 891 of file evaluator.h.

int coco::cached_backward_evaluator_base< hessBackwardEvaluatorType , 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< hessBackwardEvaluatorType, expression_node, bool,expression_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< hessBackwardEvaluatorType, expression_node, bool,expression_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:48:46 2010 for COCONUT API by  doxygen 1.5.8