Couenne  0.5.7
CouenneExprAbs.hpp
Go to the documentation of this file.
1 /* $Id: CouenneExprAbs.hpp 615 2011-06-08 20:36:24Z pbelotti $
2  *
3  * Name: exprAbs.hpp
4  * Author: Pietro Belotti
5  * Purpose: definition of the absolute value of a function
6  *
7  * (C) Carnegie-Mellon University, 2006-10.
8  * This file is licensed under the Eclipse Public License (EPL)
9  */
10 
11 #ifndef COUENNE_EXPRABS_HPP
12 #define COUENNE_EXPRABS_HPP
13 
14 #include <math.h>
15 
16 #include "CouenneExprUnary.hpp"
17 #include "CouenneExprConst.hpp"
18 
19 namespace Couenne {
20 
22 
23 class exprAbs: public exprUnary {
24 
25  public:
26 
29  exprUnary (al) {} //< non-leaf expression, with argument list
30 
32  inline unary_function F () {return fabs;}
33 
35  expression *clone (Domain *d = NULL) const
36  {return new exprAbs (argument_ -> clone (d));}
37 
39  std::string printOp () const
40  {return "abs";}
41 
43  inline CouNumber gradientNorm (const double *x)
44  {return ((argument_ -> Index () < 0) ? 0. : 1.);}
45 
47  expression *differentiate (int index);
48 
50  virtual void getBounds (expression *&, expression *&);
51 
53  virtual 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  enum expr_type code () {return COU_EXPRABS;}
64 
66  inline bool isInteger ()
67  {return argument_ -> isInteger ();}
68 
71 
74  virtual CouNumber selectBranch (const CouenneObject *obj,
75  const OsiBranchingInformation *info,
76  expression * &var,
77  double * &brpts,
78  double * &brDist, // distance of current LP
79  // point to new convexifications
80  int &way);
81 
83  virtual void closestFeasible (expression *varind, expression *vardep,
84  CouNumber& left, CouNumber& right) const;
85 
88  virtual bool isCuttable (CouenneProblem *problem, int index) const;
89 
91  //virtual enum convexity convexity () const;
92 };
93 
94 }
95 
96 #endif
exprAbs(expression *al)
Constructor.
bool isInteger()
is this expression integer?
#define COUENNE_INFINITY
expr_type
code returned by the method expression::code()
CouNumber(* unary_function)(CouNumber)
unary function, used in all exprUnary
expression * differentiate(int index)
differentiation
Cut Generator for linear convexifications.
auxSign
"sign" of the constraint defining an auxiliary.
double CouNumber
main number type in Couenne
expression class for unary functions (sin, log, etc.)
virtual void closestFeasible(expression *varind, expression *vardep, CouNumber &left, CouNumber &right) const
closest feasible points in function in both directions
virtual void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
std::string printOp() const
output
expression * clone(Domain *d=NULL) const
cloning method
Class for MINLP problems with symbolic information.
unary_function F()
The operator's function.
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...
int Index
expression * argument_
single argument taken by this expression
CouNumber gradientNorm(const double *x)
return l_2 norm of gradient at given point
OsiObject for auxiliary variables $w=f(x)$.
Expression base class.
bool impliedBound(int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign=expression::AUX_EQ)
implied bound processing
virtual bool isCuttable(CouenneProblem *problem, int index) const
can this expression be further linearized or are we on its concave ("bad") side
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
enum expr_type code()
code for comparisons
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
status of lower/upper bound of a variable, to be checked/modified in bound tightening
general include file for different compilers