Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
Cut Generator for linear convexifications.
CouNumber gradientNorm(const double *x)
return l_2 norm of gradient at given point
bool impliedBound(int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign=expression::AUX_EQ)
implied bound processing
OsiObject for auxiliary variables $w=f(x)$.
status of lower/upper bound of a variable, to be checked/modified in bound tightening ...
enum expr_type code()
code for comparisons
expression * argument_
single argument taken by this expression
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
virtual void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
expression * clone(Domain *d=NULL) const
cloning method
virtual void closestFeasible(expression *varind, expression *vardep, CouNumber &left, CouNumber &right) const
closest feasible points in function in both directions
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
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 ...
Class for MINLP problems with symbolic information.
bool isInteger()
is this expression integer?
std::string printOp() const
output
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
double CouNumber
main number type in Couenne
#define COUENNE_INFINITY
expr_type
code returned by the method expression::code()
unary_function F()
The operator&#39;s function.
Expression base class.
expression * differentiate(int index)
differentiation
exprAbs(expression *al)
Constructor.
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...