Go to the documentation of this file.
12 #ifndef COUENNE_EXPRQUAD_H
13 #define COUENNE_EXPRQUAD_H
49 typedef std::vector <std::pair <exprVar *, CouNumber> >
sparseQcol;
50 typedef std::vector <std::pair <exprVar *, sparseQcol> >
sparseQ;
70 mutable std::vector <std::pair <
CouNumber,
72 std::vector <std::pair <
exprVar *,
76 std::map <exprVar *, std::pair <CouNumber, CouNumber> >
bounds_;
85 std::vector <std::pair <exprVar *, CouNumber> > &
lcoeff,
86 std::vector <quadElem> &qcoeff,
105 virtual void print (std::ostream & = std::cout,
bool =
false)
const;
128 return ((lin > lin2) ? lin : lin2);
282 int &indInfLo,
int &indInfUp);
298 for (sparseQ::iterator row =
matrix_.begin (); row !=
matrix_.end (); ++row) {
300 int xind = row -> first ->
Index ();
303 for (sparseQcol::iterator col = row -> second.begin (); col != row -> second.end (); ++col) {
305 CouNumber term = x * (*(col -> first)) () * col -> second;
306 ret += (col -> first ->
Index () == xind) ? term : 2. * term;
status of lower/upper bound of a variable, to be checked/modified in bound tightening
void quadCuts(expression *w, OsiCuts &cs, const CouenneCutGenerator *cg)
method exprQuad::quadCuts
virtual void generateCuts(expression *w, OsiCuts &cs, const CouenneCutGenerator *cg, t_chg_bounds *=NULL, int=-1, CouNumber=-COUENNE_INFINITY, CouNumber=COUENNE_INFINITY)
Generate cuts for the quadratic expression, which are supporting hyperplanes of the concave upper env...
virtual void replace(exprVar *x, exprVar *w)
replace variable x with new (aux) w
virtual void closestFeasible(expression *varind, expression *vardep, CouNumber &left, CouNumber &right) const
compute $y^{lv}$ and $y^{uv}$ for Violation Transfer algorithm
virtual bool isCuttable(CouenneProblem *problem, int index) const
can this expression be further linearized or are we on its concave ("bad") side
exprQuad(CouNumber c0, std::vector< std::pair< exprVar *, CouNumber > > &lcoeff, std::vector< quadElem > &qcoeff, expression **al=NULL, int n=0)
Constructor.
virtual int compare(exprQuad &)
Compare two exprQuad.
virtual void realign(const CouenneProblem *p)
replace variable x with new (aux) w
expr_type
code returned by the method expression::code()
virtual expression * simplify()
Simplify expression.
virtual CouNumber selectBranch(const CouenneObject *obj, const OsiBranchingInformation *info, expression *&var, double *&brpts, double *&brDist, int &way)
Set up branching object by evaluating many branching points for each expression's arguments.
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 void fillDepSet(std::set< DepNode *, compNode > *dep, DepGraph *g)
Fill dependence set of the expression associated with this auxiliary variable.
virtual expression * clone(Domain *d=NULL) const
cloning method
Cut Generator for linear convexifications.
virtual bool isInteger()
is this expression integer?
virtual enum expr_type code()
Code for comparisons.
virtual void print(std::ostream &=std::cout, bool=false) const
Print expression to an iostream.
general include file for different compilers
CouNumber c0_
constant term
virtual bool impliedBound(int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign=expression::AUX_EQ)
implied bound processing
virtual CouNumber operator()()
function for the evaluation of the expression
dig_type
type of digging when filling the dependence list
std::vector< std::pair< CouNumber, std::vector< std::pair< exprVar *, CouNumber > > > > eigen_
eigenvalues and eigenvectors
virtual int Linearity()
Get a measure of "how linear" the expression is.
OsiObject for auxiliary variables $w=f(x)$.
std::vector< std::pair< exprVar *, CouNumber > > sparseQcol
matrix
lincoeff lcoeff_
coefficients and indices of the linear term
void computeQuadFiniteBound(CouNumber &qMin, CouNumber &qMax, CouNumber *l, CouNumber *u, int &indInfLo, int &indInfUp)
return lower and upper bound of quadratic expression
int nqterms_
number of non-zeroes in Q
virtual int rank()
Used in rank-based branching variable choice.
CouNumber computeQBound(int sign)
method to compute the bound based on sign: -1 for lower, +1 for upper
double CouNumber
main number type in Couenne
virtual void getBounds(CouNumber &, CouNumber &)
Get lower and upper bound of an expression (if any)
class Group, with constant, linear and nonlinear terms:
auxSign
"sign" of the constraint defining an auxiliary.
lincoeff & lcoeff() const
return linear term coefficients
exprQuad(const exprQuad &src, Domain *d=NULL)
Copy constructor.
virtual bool alphaConvexify(const CouenneProblem *)
Compute data for -convexification of a quadratic form (fills in dCoeff_ and dIndex_ for the convex un...
Class for MINLP problems with symbolic information.
std::map< exprVar *, std::pair< CouNumber, CouNumber > > bounds_
current bounds (checked before re-computing eigenvalues/vectors)
virtual int Linearity()
Get a measure of "how linear" the expression is:
std::vector< std::pair< exprVar *, sparseQcol > > sparseQ
virtual void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
virtual int Index() const
Return index of variable (only valid for exprVar and exprAux)
CouNumber gradientNorm(const double *x)
return l-2 norm of gradient at given point
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...
virtual expression * differentiate(int index)
Compute derivative of this expression with respect to variable whose index is passed as argument.
virtual CouNumber operator()()
Function for the evaluation of the expression.
class exprQuad, with constant, linear and quadratic terms