Couenne 0.5.8
Loading...
Searching...
No Matches
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
19namespace Couenne {
20
22
23class 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
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
#define COUENNE_INFINITY
Cut Generator for linear convexifications.
OsiObject for auxiliary variables $w=f(x)$.
Class for MINLP problems with symbolic information.
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...
expression * clone(Domain *d=NULL) const
cloning method
virtual void getBounds(CouNumber &lb, CouNumber &ub)
Get value of lower and upper bound of an expression (if any)
enum expr_type code()
code for comparisons
bool isInteger()
is this expression integer?
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
exprAbs(expression *al)
Constructor.
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
virtual void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
unary_function F()
The operator's function.
CouNumber gradientNorm(const double *x)
return l_2 norm of gradient at given point
virtual void closestFeasible(expression *varind, expression *vardep, CouNumber &left, CouNumber &right) const
closest feasible points in function in both directions
std::string printOp() const
output
virtual bool isCuttable(CouenneProblem *problem, int index) const
can this expression be further linearized or are we on its concave ("bad") side
bool impliedBound(int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign=expression::AUX_EQ)
implied bound processing
expression * differentiate(int index)
differentiation
expression class for unary functions (sin, log, etc.)
expression * argument_
single argument taken by this expression
Expression base class.
virtual int Index() const
Return index of variable (only valid for exprVar and exprAux)
auxSign
"sign" of the constraint defining an auxiliary.
status of lower/upper bound of a variable, to be checked/modified in bound tightening
general include file for different compilers
double CouNumber
main number type in Couenne
CouNumber(* unary_function)(CouNumber)
unary function, used in all exprUnary
expr_type
code returned by the method expression::code()