Couenne::exprGroup Class Reference

class Group, with constant, linear and nonlinear terms: $ a_0 + \sum_{i=1}^n a_i x_i $ More...

#include <CouenneExprGroup.hpp>

Inheritance diagram for Couenne::exprGroup:
Inheritance graph
[legend]
Collaboration diagram for Couenne::exprGroup:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::vector< std::pair
< exprVar *, CouNumber > > 
lincoeff

Public Member Functions

 exprGroup (CouNumber, lincoeff &, expression **=NULL, int=0)
 Constructor.
 exprGroup (const exprGroup &src, Domain *d=NULL)
 Copy constructor.
virtual ~exprGroup ()
 Destructor -- needed to clear bounds.
virtual expressionclone (Domain *d=NULL) const
 Cloning method.
CouNumber getc0 ()
 return constant term
lincoefflcoeff () const
 return linear term coefficients
virtual void print (std::ostream &=std::cout, bool=false) const
 Print expression to iostream.
virtual CouNumber operator() ()
 function for the evaluation of the expression
virtual CouNumber gradientNorm (const double *x)
 return l-2 norm of gradient at given point
virtual int DepList (std::set< int > &deplist, enum dig_type type=ORIG_ONLY)
 fill in the set with all indices of variables appearing in the expression
virtual expressiondifferentiate (int index)
 differentiation
virtual expressionsimplify ()
 simplification
virtual int Linearity ()
 get a measure of "how linear" the expression is:
virtual void getBounds (expression *&, expression *&)
 Get lower and upper bound of an expression (if any).
virtual void getBounds (CouNumber &, CouNumber &)
 Get lower and upper bound of an expression (if any).
virtual void generateCuts (expression *, OsiCuts &, const CouenneCutGenerator *, t_chg_bounds *=NULL, int=-1, CouNumber=-COUENNE_INFINITY, CouNumber=COUENNE_INFINITY)
 special version for linear constraints
virtual int compare (exprGroup &)
 only compare with people of the same kind
virtual enum expr_type code ()
 code for comparisons
virtual bool isInteger ()
 is this expression integer?
virtual int rank ()
 used in rank-based branching variable choice
virtual void fillDepSet (std::set< DepNode *, compNode > *, DepGraph *)
 update dependence set with index of this variable
virtual void replace (exprVar *x, exprVar *w)
 replace variable x with new (aux) w
virtual void realign (const CouenneProblem *p)
 redirect variables to proper variable vector

Static Public Member Functions

static expressiongenExprGroup (CouNumber, lincoeff &, expression **=NULL, int=0)
 Generalized (static) constructor: check parameters and return a constant, a single variable, or a real exprGroup.

Protected Attributes

lincoeff lcoeff_
 coefficients and indices of the linear term
CouNumber c0_
 constant term

Detailed Description

class Group, with constant, linear and nonlinear terms: $ a_0 + \sum_{i=1}^n a_i x_i $

Definition at line 25 of file CouenneExprGroup.hpp.


Member Typedef Documentation

typedef std::vector<std::pair <exprVar *, CouNumber> > Couenne::exprGroup::lincoeff

Definition at line 29 of file CouenneExprGroup.hpp.


Constructor & Destructor Documentation

Couenne::exprGroup::exprGroup ( CouNumber  ,
lincoeff ,
expression **  = NULL,
int  = 0 
)

Constructor.

exprGroup::exprGroup ( const exprGroup src,
Domain d = NULL 
)

Copy constructor.

copy constructor

Definition at line 90 of file exprGroup.cpp.

exprGroup::~exprGroup (  )  [virtual]

Destructor -- needed to clear bounds.

Destructor -- check if there are exprBounds and delete them.

Definition at line 103 of file exprGroup.cpp.


Member Function Documentation

static expression* Couenne::exprGroup::genExprGroup ( CouNumber  ,
lincoeff ,
expression **  = NULL,
int  = 0 
) [static]

Generalized (static) constructor: check parameters and return a constant, a single variable, or a real exprGroup.

virtual expression* Couenne::exprGroup::clone ( Domain d = NULL  )  const [inline, virtual]

Cloning method.

Reimplemented from Couenne::exprSum.

Reimplemented in Couenne::exprQuad.

Definition at line 58 of file CouenneExprGroup.hpp.

CouNumber Couenne::exprGroup::getc0 (  )  [inline]

return constant term

Definition at line 62 of file CouenneExprGroup.hpp.

lincoeff& Couenne::exprGroup::lcoeff (  )  const [inline]

return linear term coefficients

Definition at line 63 of file CouenneExprGroup.hpp.

void exprGroup::print ( std::ostream &  out = std::cout,
bool  descend = false 
) const [virtual]

Print expression to iostream.

I/O.

Reimplemented from Couenne::exprOp.

Reimplemented in Couenne::exprQuad.

Definition at line 115 of file exprGroup.cpp.

CouNumber Couenne::exprGroup::operator() (  )  [inline, virtual]

function for the evaluation of the expression

compute sum of linear and nonlinear terms

Reimplemented from Couenne::exprSum.

Reimplemented in Couenne::exprQuad.

Definition at line 127 of file CouenneExprGroup.hpp.

CouNumber exprGroup::gradientNorm ( const double *  x  )  [virtual]

return l-2 norm of gradient at given point

return l-2 norm of gradient at given point.

Not needed for now, as we only use it with nonlinear operators

Reimplemented from Couenne::expression.

Reimplemented in Couenne::exprQuad.

Definition at line 376 of file exprGroup.cpp.

int exprGroup::DepList ( std::set< int > &  deplist,
enum dig_type  type = ORIG_ONLY 
) [virtual]

fill in the set with all indices of variables appearing in the expression

Reimplemented from Couenne::exprOp.

Reimplemented in Couenne::exprQuad.

Definition at line 264 of file exprGroup.cpp.

expression * exprGroup::differentiate ( int  index  )  [virtual]

differentiation

Reimplemented from Couenne::exprSum.

Reimplemented in Couenne::exprQuad.

Definition at line 150 of file exprGroup.cpp.

expression * exprGroup::simplify (  )  [virtual]

simplification

Reimplemented from Couenne::exprSum.

Reimplemented in Couenne::exprQuad.

Definition at line 407 of file exprGroup.cpp.

int exprGroup::Linearity (  )  [virtual]

get a measure of "how linear" the expression is:

Reimplemented from Couenne::exprSum.

Reimplemented in Couenne::exprQuad.

Definition at line 179 of file exprGroup.cpp.

void exprGroup::getBounds ( expression *&  lb,
expression *&  ub 
) [virtual]

Get lower and upper bound of an expression (if any).

Reimplemented from Couenne::exprSum.

Reimplemented in Couenne::exprQuad.

Definition at line 25 of file conv-exprGroup.cpp.

void exprGroup::getBounds ( CouNumber lb,
CouNumber ub 
) [virtual]

Get lower and upper bound of an expression (if any).

Get values of lower and upper bound of an expression (if any).

Reimplemented from Couenne::exprSum.

Reimplemented in Couenne::exprQuad.

Definition at line 136 of file conv-exprGroup.cpp.

void exprGroup::generateCuts ( expression w,
OsiCuts &  cs,
const CouenneCutGenerator cg,
t_chg_bounds chg = NULL,
int  wind = -1,
CouNumber  lb = -COUENNE_INFINITY,
CouNumber  ub = COUENNE_INFINITY 
) [virtual]

special version for linear constraints

Reimplemented from Couenne::exprSum.

Reimplemented in Couenne::exprQuad.

Definition at line 196 of file conv-exprGroup.cpp.

int exprGroup::compare ( exprGroup e  )  [virtual]

only compare with people of the same kind

compare affine terms

Reimplemented from Couenne::exprOp.

Reimplemented in Couenne::exprQuad.

Definition at line 192 of file exprGroup.cpp.

virtual enum expr_type Couenne::exprGroup::code (  )  [inline, virtual]

code for comparisons

Reimplemented from Couenne::exprSum.

Reimplemented in Couenne::exprQuad.

Definition at line 106 of file CouenneExprGroup.hpp.

bool exprGroup::isInteger (  )  [virtual]

is this expression integer?

is this linear term integer?

Reimplemented from Couenne::exprOp.

Reimplemented in Couenne::exprQuad.

Definition at line 290 of file exprGroup.cpp.

int exprGroup::rank (  )  [virtual]

used in rank-based branching variable choice

Reimplemented from Couenne::exprOp.

Reimplemented in Couenne::exprQuad.

Definition at line 234 of file exprGroup.cpp.

void exprGroup::fillDepSet ( std::set< DepNode *, compNode > *  dep,
DepGraph g 
) [virtual]

update dependence set with index of this variable

Reimplemented from Couenne::exprOp.

Reimplemented in Couenne::exprQuad.

Definition at line 253 of file exprGroup.cpp.

void exprGroup::replace ( exprVar x,
exprVar w 
) [virtual]

replace variable x with new (aux) w

Reimplemented from Couenne::exprOp.

Reimplemented in Couenne::exprQuad.

Definition at line 325 of file exprGroup.cpp.

void exprGroup::realign ( const CouenneProblem p  )  [virtual]

redirect variables to proper variable vector

Redirect variables to proper variable vector.

Reimplemented from Couenne::exprOp.

Reimplemented in Couenne::exprQuad.

Definition at line 388 of file exprGroup.cpp.


Member Data Documentation

lincoeff Couenne::exprGroup::lcoeff_ [mutable, protected]

coefficients and indices of the linear term

Definition at line 33 of file CouenneExprGroup.hpp.

constant term

Definition at line 34 of file CouenneExprGroup.hpp.


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

Generated on 22 May 2012 by  doxygen 1.6.1