coco::expression_node Class Reference
[Models]

The base class for a node in the expression DAGs. More...

#include <expression.h>

Collaboration diagram for coco::expression_node:

Collaboration graph
[legend]

List of all members.

Classes

class  children_compare
class  parents_compare
class  parents_compare_eq

Public Member Functions

 expression_node ()
 expression_node (int et, int nn)
 expression_node (const expression_node &__x)
virtual ~expression_node ()
expression_nodeoperator= (const expression_node &__x)
bool operator< (const expression_node &__x) const
void merge (const expression_node &__s)
void set_bounds (rhs_t __i)
void set_bounds (double __d=0.)
void set_bounds (int __i)
void set_bounds (double lo, double up)
void add_is_var (unsigned int idx)
void rm_is_var (unsigned int idx)
bool is (unsigned int __tp) const
const variable_indicatorvar_indicator () const
virtual double f_evaluate (int argnum, int idx, const std::vector< double > &x, const variable_indicator &v_i, double fold, double fupd, std::vector< double > *cache_data) const
virtual interval i_evaluate (int argnum, int idx, const std::vector< interval > &x, const variable_indicator &v_i, interval fold, interval fupd, std::vector< interval > *cache_data) const
virtual interval cp_evaluate (int argnum, int idx, const std::vector< interval > &node_range, const variable_indicator &v_i, interval fold, interval fupd, std::vector< interval > *cache_data) const

Public Attributes

unsigned int node_num
 node number for indexing
int operator_type
unsigned int n_parents
 number of parents
unsigned int n_children
 number of children
std::vector< double > coeffs
 coefficients of the sub_expressions
basic_alltype params
 additional expression info
rhs_t f_bounds
 bounds on this node
unsigned short is_var
 this node represents is_var variables
std::vector< unsigned int > var_idx
 the variable indices corresponding to this node
semantics sem
variable_indicator v_i
 this node depends on which variables?
evaluator_vev

Friends

std::ostream & operator<< (std::ostream &o, const expression_node &__x)


Detailed Description

This class is the base class for all nodes in the expression DAGs used to specify the optimization problems to be solved.

Definition at line 1112 of file expression.h.


Constructor & Destructor Documentation

coco::expression_node::expression_node (  )  [inline]

The Standard Constructor

Definition at line 1159 of file expression.h.

coco::expression_node::expression_node ( int  et,
int  nn 
) [inline]

Constructor, which builds a node of operator type et having node number nn.

Definition at line 1166 of file expression.h.

coco::expression_node::expression_node ( const expression_node __x  )  [inline]

Standard Copy Constructor

Definition at line 1173 of file expression.h.

virtual coco::expression_node::~expression_node (  )  [inline, virtual]

Standard Destructor

Definition at line 1181 of file expression.h.


Member Function Documentation

void coco::expression_node::add_is_var ( unsigned int  idx  )  [inline]

The add_is_var method is used to add the variable number idx to the list of variables, which are represented by this node.

Definition at line 1260 of file expression.h.

virtual interval coco::expression_node::cp_evaluate ( int  argnum,
int  idx,
const std::vector< interval > &  node_range,
const variable_indicator v_i,
interval  fold,
interval  fupd,
std::vector< interval > *  cache_data 
) const [inline, virtual]

This is an extra evaluation routine, which needs to be overloaded by a user defined node (with operator_type > 0).

Definition at line 1303 of file expression.h.

virtual double coco::expression_node::f_evaluate ( int  argnum,
int  idx,
const std::vector< double > &  x,
const variable_indicator v_i,
double  fold,
double  fupd,
std::vector< double > *  cache_data 
) const [inline, virtual]

This is an extra evaluation routine, which needs to be overloaded by a user defined node (with operator_type > 0).

Definition at line 1295 of file expression.h.

virtual interval coco::expression_node::i_evaluate ( int  argnum,
int  idx,
const std::vector< interval > &  x,
const variable_indicator v_i,
interval  fold,
interval  fupd,
std::vector< interval > *  cache_data 
) const [inline, virtual]

This is an extra evaluation routine, which needs to be overloaded by a user defined node (with operator_type > 0).

Definition at line 1299 of file expression.h.

bool coco::expression_node::is ( unsigned int  __tp  )  const

The method is is used to determine, whether the expression represented by this node has a certain type specified by __tp. For __tp one of the ex_.. values or a logical combination of them can be used.

Definition at line 38 of file expression.cc.

void coco::expression_node::merge ( const expression_node __s  )  [inline]

This method merges the node __s with this node. It is used mainly in the simplifier.

Definition at line 1220 of file expression.h.

bool coco::expression_node::operator< ( const expression_node __x  )  const [inline]

This is the order operator for expression nodes.

This function compares two nodes' node numbers.

Definition at line 214 of file expression.hpp.

expression_node& coco::expression_node::operator= ( const expression_node __x  )  [inline]

Standard Assignment Operator

Definition at line 1189 of file expression.h.

void coco::expression_node::rm_is_var ( unsigned int  idx  )  [inline]

The add_is_var method is used to remove the variable number idx from the list of variables, which are represented by this node.

Definition at line 1268 of file expression.h.

void coco::expression_node::set_bounds ( double  lo,
double  up 
) [inline]

This method sets the node's bounds to the restriction ``in [lo, up]''.

Definition at line 1253 of file expression.h.

void coco::expression_node::set_bounds ( int  __i  )  [inline]

This method sets the node's bounds to the restriction ``in __i''.

Definition at line 1246 of file expression.h.

void coco::expression_node::set_bounds ( double  __d = 0.  )  [inline]

This method sets the node's bounds to the equality restriction ``== __d''.

Definition at line 1240 of file expression.h.

void coco::expression_node::set_bounds ( rhs_t  __i  )  [inline]

This method sets the node's restriction to the rhs_t __i.

Definition at line 1233 of file expression.h.

const variable_indicator& coco::expression_node::var_indicator (  )  const [inline]

This method returns the variable indicator of this node.

Definition at line 1290 of file expression.h.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const expression_node __x 
) [friend]

Definition at line 207 of file expression.cc.


Member Data Documentation

std::vector<double> coco::expression_node::coeffs

Definition at line 1130 of file expression.h.

optional evaluators used instead of tree walks NULL means no evaluators, map if some or all are defined. This is for recursive_cached_walk.

Definition at line 1145 of file expression.h.

Definition at line 1134 of file expression.h.

Definition at line 1136 of file expression.h.

Definition at line 1126 of file expression.h.

Definition at line 1126 of file expression.h.

Definition at line 1115 of file expression.h.

this is a number describing the operation. negative numbers describe standard operations as defined above. the positive numbers describe other operations like elementary functions (exp, pow, sin,...) or more complicated functions like linear or general quadratic terms, user-defined functions, piecewise linear approximations,...

Definition at line 1117 of file expression.h.

Definition at line 1132 of file expression.h.

additional semantics information like integer (y/n), stochastic (y/n), karush-john (y/n) convexity,...

Definition at line 1139 of file expression.h.

Definition at line 1143 of file expression.h.

std::vector<unsigned int> coco::expression_node::var_idx

Definition at line 1137 of file expression.h.


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

Generated on Tue Feb 9 14:48:31 2010 for COCONUT API by  doxygen 1.5.8