Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CouenneExprFloor.hpp
Go to the documentation of this file.
1 /* $Id: CouenneExprFloor.hpp 720 2011-06-27 13:31:26Z pbelotti $
2  *
3  * Name: exprFloor.hpp
4  * Author: Pietro Belotti
5  * Purpose: definition of floor
6  *
7  * (C) Pietro Belotti, 2011.
8  * This file is licensed under the Eclipse Public License (EPL)
9  */
10 
11 #ifndef COUENNE_EXPRFLOOR_HPP
12 #define COUENNE_EXPRFLOOR_HPP
13 
14 #include "CouenneExpression.hpp"
15 
16 namespace Couenne {
17 
19 
20 class exprFloor: public exprUnary {
21 
22  public:
23 
26  exprUnary (arg) {}
27 
29  expression *clone (Domain *d = NULL) const
30  {return new exprFloor (argument_ -> clone (d));}
31 
33  inline unary_function F ()
34  {return floor;}
35 
37  std::string printOp () const
38  {return "floor";}
39 
41  inline CouNumber gradientNorm (const double *x) {
42  return (argument_ -> Index () < 0) ?
43  0. : fabs (x [argument_ -> Index ()]);
44  }
45 
47  expression *differentiate (int index);
48 
50  void getBounds (expression *&, expression *&);
51 
53  void getBounds (CouNumber &lb, CouNumber &ub);
54 
56  void generateCuts (expression *w, //const OsiSolverInterface &si,
57  OsiCuts &cs, const CouenneCutGenerator *cg,
58  t_chg_bounds * = NULL, int = -1,
61 
63  virtual enum expr_type code ()
64  {return COU_EXPRFLOOR;}
65 
67  bool impliedBound (int index, CouNumber *l, CouNumber *u, t_chg_bounds *chg, enum auxSign = expression::AUX_EQ) {
68 
69  bool impl = true;
70  return impl;
71  }
72 
75  virtual CouNumber selectBranch (const CouenneObject *obj,
76  const OsiBranchingInformation *info,
77  expression * &var,
78  double * &brpts,
79  double * &brDist, // distance of current LP
80  // point to new convexifications
81  int &way)
82  {return 0.;}
83 
85  virtual void closestFeasible (expression *varind, expression *vardep,
86  CouNumber& left, CouNumber& right) const;
87 
90  virtual bool isCuttable (CouenneProblem *problem, int index) const
91  {return false;}
92 
94  //virtual enum convexity convexity () const;
95 };
96 
97 }
98 
99 #endif
Cut Generator for linear convexifications.
bool impliedBound(int index, CouNumber *l, CouNumber *u, t_chg_bounds *chg, enum auxSign=expression::AUX_EQ)
implied bound processing
std::string printOp() const
print operator
virtual enum expr_type code()
code for comparisons
OsiObject for auxiliary variables $w=f(x)$.
status of lower/upper bound of a variable, to be checked/modified in bound tightening ...
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&#39;s arguments...
virtual void closestFeasible(expression *varind, expression *vardep, CouNumber &left, CouNumber &right) const
closest feasible points in function in both directions
expression * argument_
single argument taken by this expression
void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
expression class for unary functions (sin, log, etc.)
virtual bool isCuttable(CouenneProblem *problem, int index) const
can this expression be further linearized or are we on its concave (&quot;bad&quot;) side?
expression * clone(Domain *d=NULL) const
cloning method
virtual int Index() const
Return index of variable (only valid for exprVar and exprAux)
auxSign
&quot;sign&quot; of the constraint defining an auxiliary.
CouNumber(* unary_function)(CouNumber)
unary function, used in all exprUnary
Class for MINLP problems with symbolic information.
CouNumber gradientNorm(const double *x)
return l-2 norm of gradient at given point
expression * differentiate(int index)
obtain derivative of expression
double CouNumber
main number type in Couenne
unary_function F()
the operator itself (e.g. sin, log...)
#define COUENNE_INFINITY
expr_type
code returned by the method expression::code()
Expression base class.
void generateCuts(expression *w, OsiCuts &cs, const CouenneCutGenerator *cg, t_chg_bounds *=NULL, int=-1, CouNumber=-COUENNE_INFINITY, CouNumber=COUENNE_INFINITY)
generate equality between *this and *w
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...
exprFloor(expression *arg)
constructor, destructor