exprGroup Class Reference

class Group, with constant, linear and nonlinear terms More...

#include <exprGroup.hpp>

Inheritance diagram for exprGroup:

Inheritance graph
[legend]
Collaboration diagram for 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.
 ~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 *, const OsiSolverInterface &, 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

Definition at line 23 of file exprGroup.hpp.


Member Typedef Documentation

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

Definition at line 27 of file exprGroup.hpp.


Constructor & Destructor Documentation

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

Constructor.

Referenced by clone(), exprQuad::differentiate(), and getBounds().

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

Copy constructor.

Definition at line 86 of file exprGroup.cpp.

References expression::Index(), and lcoeff_.

exprGroup::~exprGroup (  ) 

Destructor -- needed to clear bounds.

Definition at line 99 of file exprGroup.cpp.

References code(), COU_EXPRLBOUND, COU_EXPRUBOUND, and lcoeff_.


Member Function Documentation

static expression* 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* exprGroup::clone ( Domain d = NULL  )  const [inline, virtual]

Cloning method.

Reimplemented from exprSum.

Reimplemented in exprQuad.

Definition at line 56 of file exprGroup.hpp.

References exprGroup().

CouNumber exprGroup::getc0 (  )  [inline]

return constant term

Definition at line 60 of file exprGroup.hpp.

References c0_.

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

return linear term coefficients

Definition at line 61 of file exprGroup.hpp.

References lcoeff_.

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

Print expression to iostream.

Reimplemented from exprOp.

Reimplemented in exprQuad.

Definition at line 110 of file exprGroup.cpp.

References c0_, CONST, COUENNE_EPS, lcoeff_, MAX_ARG_LINE, exprOp::nargs_, exprOp::print(), exprOp::Type(), and expression::Value().

Referenced by exprQuad::print().

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

function for the evaluation of the expression

Reimplemented from exprSum.

Reimplemented in exprQuad.

Definition at line 125 of file exprGroup.hpp.

References c0_, lcoeff_, and exprSum::operator()().

Referenced by exprQuad::operator()().

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

return l-2 norm of gradient at given point

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

Reimplemented from expression.

Reimplemented in exprQuad.

Definition at line 353 of file exprGroup.cpp.

References lcoeff_.

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 exprOp.

Reimplemented in exprQuad.

Definition at line 259 of file exprGroup.cpp.

References exprOp::DepList(), and lcoeff_.

Referenced by exprQuad::DepList().

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

differentiation

Reimplemented from exprSum.

Reimplemented in exprQuad.

Definition at line 145 of file exprGroup.cpp.

References exprOp::arglist_, COUENNE_EPS, expression::dependsOn(), exprSum::exprSum(), expression::Index(), lcoeff_, and exprOp::nargs_.

expression * exprGroup::simplify (  )  [virtual]

simplification

Reimplemented from exprSum.

Reimplemented in exprQuad.

Definition at line 384 of file exprGroup.cpp.

References exprOp::simplify().

int exprGroup::Linearity (  )  [virtual]

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

Reimplemented from exprSum.

Reimplemented in exprQuad.

Definition at line 174 of file exprGroup.cpp.

References c0_, CONSTANT, COUENNE_EPS, lcoeff_, LINEAR, exprSum::Linearity(), and ZERO.

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

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

Reimplemented from exprSum.

Reimplemented in exprQuad.

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

References c0_, exprGroup(), exprSum::getBounds(), expression::Index(), and lcoeff_.

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

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

Reimplemented from exprSum.

Reimplemented in exprQuad.

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

References c0_, COUENNE_INFINITY, exprSum::getBounds(), and lcoeff_.

void exprGroup::generateCuts ( expression ,
const OsiSolverInterface &  ,
OsiCuts &  ,
const CouenneCutGenerator ,
t_chg_bounds = NULL,
int  = -1,
CouNumber  = -COUENNE_INFINITY,
CouNumber  = COUENNE_INFINITY 
) [virtual]

special version for linear constraints

Reimplemented from exprSum.

Reimplemented in exprQuad.

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

References exprOp::arglist_, c0_, CONST, COUENNE_INFINITY, e, expression::Index(), lcoeff_, exprOp::nargs_, exprOp::Type(), expression::Value(), and w.

int exprGroup::compare ( exprGroup  )  [virtual]

only compare with people of the same kind

Definition at line 187 of file exprGroup.cpp.

References c0_, COUENNE_EPS, e, expression::Index(), and lcoeff_.

Referenced by exprQuad::compare().

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

code for comparisons

Reimplemented from exprSum.

Reimplemented in exprQuad.

Definition at line 104 of file exprGroup.hpp.

References COU_EXPRGROUP.

Referenced by ~exprGroup().

bool exprGroup::isInteger (  )  [virtual]

is this expression integer?

Reimplemented from exprOp.

Reimplemented in exprQuad.

Definition at line 272 of file exprGroup.cpp.

References c0_, COUENNE_EPS, exprOp::isInteger(), Domain::lb(), lcoeff_, and Domain::ub().

Referenced by exprQuad::isInteger().

int exprGroup::rank (  )  [virtual]

used in rank-based branching variable choice

Reimplemented from exprOp.

Reimplemented in exprQuad.

Definition at line 229 of file exprGroup.cpp.

References lcoeff_, r, and exprOp::rank().

Referenced by exprQuad::rank().

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

update dependence set with index of this variable

Reimplemented from exprOp.

Reimplemented in exprQuad.

Definition at line 248 of file exprGroup.cpp.

References exprOp::fillDepSet(), g, expression::Index(), and lcoeff_.

Referenced by exprQuad::fillDepSet().

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

replace variable x with new (aux) w

Reimplemented from exprOp.

Reimplemented in exprQuad.

Definition at line 307 of file exprGroup.cpp.

References expression::Index(), lcoeff_, exprOp::replace(), w, and x.

Referenced by exprQuad::replace().

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

redirect variables to proper variable vector

Reimplemented from exprOp.

Reimplemented in exprQuad.

Definition at line 365 of file exprGroup.cpp.

References AUX, expression::Index(), lcoeff_, expression::Original(), exprOp::Type(), and VAR.


Member Data Documentation

lincoeff exprGroup::lcoeff_ [mutable, protected]

coefficients and indices of the linear term

Definition at line 31 of file exprGroup.hpp.

Referenced by compare(), exprQuad::computeQBound(), exprQuad::computeQuadFiniteBound(), DepList(), exprQuad::differentiate(), differentiate(), exprGroup(), fillDepSet(), generateCuts(), getBounds(), gradientNorm(), exprQuad::impliedBound(), isInteger(), lcoeff(), exprQuad::Linearity(), Linearity(), operator()(), print(), exprQuad::quadCuts(), rank(), realign(), replace(), and ~exprGroup().

CouNumber exprGroup::c0_ [protected]

constant term

Definition at line 32 of file exprGroup.hpp.

Referenced by compare(), exprQuad::computeQBound(), generateCuts(), getBounds(), getc0(), exprQuad::impliedBound(), isInteger(), exprQuad::Linearity(), Linearity(), operator()(), print(), and exprQuad::quadCuts().


The documentation for this class was generated from the following files:
Generated on Mon Aug 3 03:07:21 2009 by  doxygen 1.4.7