Models


Classes

class  coco::annotation
 Annotations for Models. More...
class  coco::expression_node
 The base class for a node in the expression DAGs. More...
class  coco::expression_print_visitor
class  coco::graphorder_visitor
 This visitor class is used for computing a graph order. More...
class  coco::model
 The model class (an attributed DAG of expression nodes, lowest class in the model hierarchy). More...
class  coco::model_iddata
 The model id-data class (the topmost in the model class hierarchy). More...
class  coco::model_gid
 Model Group Data Class (middle class in the model hierarchy). More...

Typedefs

typedef model::walker coco::expression_walker
 Walker to the expression DAG.
typedef model::const_walker coco::expression_const_walker
 Const walker to the expression DAG.

Functions

void coco::graphorder (const model &DAG, std::vector< unsigned int > &order)
 Compute a graph order.

Variables

const char * coco::expr_names []

Operator types of standard expressions

These definitions define the standard operator types for the expression_node class. In the operator descriptions $ y_i $ is used for the value of the $i$th child of the node, while $ x_i = c_i y_i $ stands for the value of the $i$th child of the node multiplied by the $i$th entry of the coeffs array.

#define EXPRINFO_GHOST   0
#define EXPRINFO_CONSTANT   -1
#define EXPRINFO_VARIABLE   -2
#define EXPRINFO_SUM   -3
#define EXPRINFO_MEAN   -4
#define EXPRINFO_PROD   -5
#define EXPRINFO_MAX   -6
#define EXPRINFO_MIN   -7
#define EXPRINFO_MONOME   -8
#define EXPRINFO_SCPROD   -9
#define EXPRINFO_NORM   -10
#define EXPRINFO_INVERT   -11
#define EXPRINFO_SQUARE   -12
#define EXPRINFO_SQROOT   -13
#define EXPRINFO_ABS   -14
#define EXPRINFO_INTPOWER   -15
#define EXPRINFO_EXP   -16
#define EXPRINFO_LOG   -17
#define EXPRINFO_SIN   -18
#define EXPRINFO_COS   -19
#define EXPRINFO_GAUSS   -20
#define EXPRINFO_POLY   -21
#define EXPRINFO_POW   -22
#define EXPRINFO_DIV   -23
#define EXPRINFO_ATAN2   -24
#define EXPRINFO_LIN   -25
#define EXPRINFO_QUAD   -26
#define EXPRINFO_RE   -27
#define EXPRINFO_IM   -28
#define EXPRINFO_ARG   -29
#define EXPRINFO_CPLXCONJ   -30
#define EXPRINFO_LOOKUP   -31
#define EXPRINFO_PWLIN   -32
#define EXPRINFO_SPLINE   -33
#define EXPRINFO_PWCONSTLC   -34
#define EXPRINFO_PWCONSTRC   -35
#define EXPRINFO_IN   -36
#define EXPRINFO_IF   -37
#define EXPRINFO_AND   -38
#define EXPRINFO_OR   -39
#define EXPRINFO_NOT   -40
#define EXPRINFO_IMPLIES   -41
#define EXPRINFO_COUNT   -42
#define EXPRINFO_ALLDIFF   -43
#define EXPRINFO_HISTOGRAM   -44
#define EXPRINFO_LEVEL   -45
#define EXPRINFO_NEIGHBOR   -46
#define EXPRINFO_NOGOOD   -47
#define EXPRINFO_EXPECTATION   -48
#define EXPRINFO_INTEGRAL   -49
#define EXPRINFO_DET   -50
#define EXPRINFO_COND   -51
#define EXPRINFO_PSD   -52
#define EXPRINFO_MPROD   -53
#define EXPRINFO_FEM   -54
#define EXPRINFO_CMPROD   -55
#define EXPRINFO_CGFEM   -56
#define EXPRINFO_UNDEFINED   -57
#define EXPRINFO_NUMOFPREDEF   -(EXPRINFO_UNDEFINED)

Detailed Description

The classes in this section define the internal representation of models (optimization problems) in the COCONUT environment.

Define Documentation

#define EXPRINFO_ABS   -14

The absolute value node is $ |x_{0}+q| $, where $q$ is stored in params.nd().

Definition at line 145 of file expression.h.

#define EXPRINFO_ALLDIFF   -43

This node returns $1$ if all children are pairwise different. Here different means $ |x_{i}-x_{j}| > \delta $ with $\delta$ in params.nd().

Definition at line 288 of file expression.h.

#define EXPRINFO_AND   -38

The value is $1$ if all $x_{i}\in \xI_{i}$ where the $\xI_{i}$ are stored in params.i(), and $0$ otherwise.

Definition at line 265 of file expression.h.

#define EXPRINFO_ARG   -29

This node returns the argument of a complex number.

Definition at line 215 of file expression.h.

#define EXPRINFO_ATAN2   -24

The atan2 node has no parameters, and its definition is $ \operatorname{atan2}(x_{0},x_{1})=\operatorname{atan}(x_{0}/x_{1}) $.

Definition at line 190 of file expression.h.

#define EXPRINFO_CGFEM   -56

This node computes information relevant for FEM computations with constant $A$.

Definition at line 351 of file expression.h.

#define EXPRINFO_CMPROD   -55

This node computes a matrix vector product with constant $A$.

Definition at line 347 of file expression.h.

#define EXPRINFO_COND   -51

This node computes the condition of a matrix.

Definition at line 333 of file expression.h.

#define EXPRINFO_CONSTANT   -1

This node represents a constant, whose value is contained in params.nd().

Definition at line 81 of file expression.h.

#define EXPRINFO_COS   -19

The cosine node is $ \cos(x_{0}+q) $, where $q$ is stored in params.nd().

Definition at line 165 of file expression.h.

#define EXPRINFO_COUNT   -42

The count node returns for how many $i$ we have $x_{i}\in\xI_{i}$, where * the intervals $\xI_{i}$ are stored in params.i().

Definition at line 283 of file expression.h.

#define EXPRINFO_CPLXCONJ   -30

This node returns the complex conjugate of a complex number.

Definition at line 220 of file expression.h.

#define EXPRINFO_DET   -50

This node computes the determinant of a matrix.

Definition at line 330 of file expression.h.

#define EXPRINFO_DIV   -23

The general division node is $ a*y_{0}/y_{1} $ and $a$ is stored in params.nd().

Definition at line 185 of file expression.h.

#define EXPRINFO_EXP   -16

The exponential node is $ e^{x_{0}+q} $, where $q$ is stored in params.nd().

Definition at line 153 of file expression.h.

#define EXPRINFO_EXPECTATION   -48

This node computes the expectation value of a function depending on stochastic nodes.

Definition at line 318 of file expression.h.

#define EXPRINFO_FEM   -54

This node computes information relevant for FEM computations.

Definition at line 342 of file expression.h.

#define EXPRINFO_GAUSS   -20

The gaussian function node is $ e^{-(x_{0}-q_{0})^{2}/q_{1}^{2}} $, where the two dimensional vector $q$ is stored in params.d().

Definition at line 170 of file expression.h.

#define EXPRINFO_GHOST   0

This is a virtual expression needed for the dag_delta class. Ghost nodes are exceptions to the rule that node numbers have to be unique throughout all models in a model group. The node number of a ghost node is the same as the node number of the node, of which it is a ghost.

Definition at line 76 of file expression.h.

#define EXPRINFO_HISTOGRAM   -44

The histogram node counts how many children $x_{i}$ are in which interval $\xI_{2k}$. The numbers $n_{k}$ are collected, and if for all $k$ the value $n_{k}\in\xI_{2k+1}$, the result is $1$. Otherwise, it is $0$.

Definition at line 294 of file expression.h.

#define EXPRINFO_IF   -37

We get the interval $\xI$ from params.ni() and define the result $n$ of the node as $ n = \begin{cases} x_{1} & \text{if $x_{0}\in\xI$} \\ x_{2} & \text{otherwise}. \end{cases} $

Definition at line 261 of file expression.h.

#define EXPRINFO_IM   -28

This node returns the imaginary part of a complex number.

Definition at line 212 of file expression.h.

#define EXPRINFO_IMPLIES   -41

The value is $1$ if the following is true: $ x_{0}\in \xI_{0} \implies x_{1}\in \xI_{1} $, where the $\xI_{i}$ are stored in params.i(). Otherwise, the value is $0$.

Definition at line 279 of file expression.h.

#define EXPRINFO_IN   -36

The point defined by $x=(x_{i})$ is tested against the box $\xI$ stored in params.i(). If $x\in\iint(\xI)$ the value is $1$, if $x\in\dd\xI$, the return value is $0$, and if $x\notin\xI$ the node's value is $-1$.

Definition at line 250 of file expression.h.

#define EXPRINFO_INTEGRAL   -49

This node computes the definite integral of a function depending on free nodes over the box stored in params.i().

Definition at line 322 of file expression.h.

#define EXPRINFO_INTPOWER   -15

The integer power node is $ x_{0}^{n} $, where the integer $n$ is in params.nn().

Definition at line 149 of file expression.h.

#define EXPRINFO_INVERT   -11

Inversion is defined as $ a/y_{0} $ with $a$ in params.nd().

Definition at line 133 of file expression.h.

#define EXPRINFO_LEVEL   -45

The matrix $A$ in params.mi() contains a set of boxes $A_{i:}$ contained within another. The result is the smallest row index $j$ such that the vector $x=(x_{i})$ is contained in $A_{j:}$.

Definition at line 300 of file expression.h.

#define EXPRINFO_LIN   -25

This node is a linear combination of all variables. In params.nn() the row number in the matrix of linear constraints is stored.

Definition at line 197 of file expression.h.

#define EXPRINFO_LOG   -17

The logarithm node is $ \log(x_{0}+q) $, where $q$ is stored in params.nd().

Definition at line 157 of file expression.h.

#define EXPRINFO_LOOKUP   -31

This node computes a function with a table lookup procedure. The table is stored in params.m().

Definition at line 226 of file expression.h.

#define EXPRINFO_MAX   -6

The maximum node is defined as $ \max(c, x_{i}\quad i=0,\dots,n) $ with $c$ in params.nd().

Definition at line 109 of file expression.h.

#define EXPRINFO_MEAN   -4

This is a sum node where it is guaranteed that all coefficients are positive, and their sum is $1$. So this is a convex linear combination without constant term: $ \sum_{i=0}^{n} x_{i}. $

Definition at line 101 of file expression.h.

#define EXPRINFO_MIN   -7

The minimum node is defined as $ \min(c, x_{i}\quad i=0,\dots,n) $ with $c$ in params.nd().

Definition at line 113 of file expression.h.

#define EXPRINFO_MONOME   -8

The general monomial node is defined as $ \prod_{i=0}^{n-1} x_{i}^{n_{i}} $, where the $n_{i}$ are contained in the vector params.n().

Definition at line 118 of file expression.h.

#define EXPRINFO_MPROD   -53

This node computes a matrix-vector product.

Definition at line 339 of file expression.h.

#define EXPRINFO_NEIGHBOR   -46

This returns $1$ if $x_{0}$ and $x_{1}$ are neighbors, i.e., if $(x_{0},x_{1})$ is in the list of allowed value pairs $(v_{2k},v_{2k+1})$ where the vector $v$ is stored in params.n(). The $x_{i}$ and $v_{i}$ are integers.

Definition at line 308 of file expression.h.

#define EXPRINFO_NOGOOD   -47

This returns $1$ if $x=v$ with $v$ in params.n(). Both $x=(x_{i})$ and $v$ are integer vectors.

Definition at line 312 of file expression.h.

#define EXPRINFO_NORM   -10

The norm node has the form $ \|x\|_{k} $, where $k$ is stored in params.nd(), and $x$ is the vector built from the values of all children.

Definition at line 127 of file expression.h.

#define EXPRINFO_NOT   -40

The value is $0$ if $x_{0}\in\xI$ and $1$ otherwise. Here $\xI$ is in params.ni().

Definition at line 273 of file expression.h.

#define EXPRINFO_NUMOFPREDEF   -(EXPRINFO_UNDEFINED)

This is the number of standard operator types.

Definition at line 359 of file expression.h.

#define EXPRINFO_OR   -39

The value is $0$ if all $x_{i}\notin\xI_{i}$ where the $\xI_{i}$ are stored in params.i(), and $1$ otherwise.

Definition at line 269 of file expression.h.

#define EXPRINFO_POLY   -21

The polynomial node is $ \sum_{i=0}^{n} \alpha_{i}x_{0}^{i} $, where the coefficients $\alpha_{i}$ are stored in params.d().

Definition at line 175 of file expression.h.

#define EXPRINFO_POW   -22

The general power node is $ (x_{0}+p)^{x_{1}} $ with $p$ in params.nd().

Definition at line 181 of file expression.h.

#define EXPRINFO_PROD   -5

The product node has the form $ c\prod_{i=0}^{n} y_{i} $, where $c$ is in params.nd().

Definition at line 105 of file expression.h.

#define EXPRINFO_PSD   -52

This node checks whether a matrix is positive semidefinite.

Definition at line 336 of file expression.h.

#define EXPRINFO_PWCONSTLC   -34

This node computes a piecewise constant left-continuous function from a table. The table is stored in params.m().

Definition at line 238 of file expression.h.

#define EXPRINFO_PWCONSTRC   -35

This node computes a piecewise constant right-continuous function from a table. The table is stored in params.m().

Definition at line 242 of file expression.h.

#define EXPRINFO_PWLIN   -32

This node computes a piecewise linear function from a table. The table is stored in params.m().

Definition at line 230 of file expression.h.

#define EXPRINFO_QUAD   -26

This node is a quadratic form in all variables. The params.m() stores the enhanced matrix $(A|b)$ for the function $ x^{T} A x + b^{T} x $. $A$ is assumed symmetric and sparse.

Definition at line 203 of file expression.h.

#define EXPRINFO_RE   -27

This node returns the real part of a complex number.

Definition at line 209 of file expression.h.

#define EXPRINFO_SCPROD   -9

The scalar product is defined as $ \sum_{i=0}^{k-1} x_{2i}x_{2i+1} $ without parameters.

Definition at line 122 of file expression.h.

#define EXPRINFO_SIN   -18

The sine node is $ \sin(x_{0}+q) $, where $q$ is stored in params.nd().

Definition at line 161 of file expression.h.

#define EXPRINFO_SPLINE   -33

This node computes a cubic spline from a table. The table is stored in params.m().

Definition at line 234 of file expression.h.

#define EXPRINFO_SQROOT   -13

The square root node is $ \sqrt{x_{0}+q} $, where $q$ is stored in params.nd().

Definition at line 141 of file expression.h.

#define EXPRINFO_SQUARE   -12

The square node is $ (x_{0}+q)^{2} $ where $q$ is stored in params.nd().

Definition at line 137 of file expression.h.

#define EXPRINFO_SUM   -3

This is a general linear combination of the form $ \sum_{i=1}^{n} x_{i} + c $ where $ c $ is stored in params.nd(). Here $ x_i $ as in all operator types stands for $ k_i y_i $, where $ y_i $ is the result of the $i$th child and $k_i$ stands for coeff[i].

Definition at line 96 of file expression.h.

#define EXPRINFO_UNDEFINED   -57

This is the artifical number for undefined nodes.

Definition at line 356 of file expression.h.

#define EXPRINFO_VARIABLE   -2

The variable number of this node is contained in params.nn().

Definition at line 84 of file expression.h.


Typedef Documentation

typedef model::const_walker coco::expression_const_walker

This type defines a const walker (generalized const pointer) to the expression DAG.

Definition at line 1054 of file model.h.

typedef model::walker coco::expression_walker

This type defines a walker (generalized pointer) to the expression DAG.

Definition at line 1049 of file model.h.


Function Documentation

void coco::graphorder ( const model &  DAG,
std::vector< unsigned int > &  order 
)

This function computes a node order in order, which is compatible with the DAG structure defined by DAG.

Definition at line 94 of file graphorder.cc.


Variable Documentation

const char * coco::expr_names

This array of strings keeps the names of the various operator types in the .dag format.

Definition at line 36 of file exprnames.cc.


Generated on Tue Feb 9 14:47:16 2010 for COCONUT API by  doxygen 1.5.8