Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CouenneExprExp.hpp
Go to the documentation of this file.
1 /* $Id: CouenneExprExp.hpp 615 2011-06-08 20:36:24Z pbelotti $
2  *
3  * Name: exprExp.hpp
4  * Author: Pietro Belotti
5  * Purpose: definition of the exponential 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_EXPREXP_HPP
12 #define COUENNE_EXPREXP_HPP
13 
14 #include <math.h>
15 
16 #include "CouenneExprUnary.hpp"
17 
18 namespace Couenne {
19 
21 
22 class exprExp: public exprUnary {
23 
24  public:
25 
28  exprUnary (al) {} //< non-leaf expression, with argument list
29 
31  expression *clone (Domain *d = NULL) const
32  {return new exprExp (argument_ -> clone (d));}
33 
35  inline unary_function F () {return exp;}
36 
38  std::string printOp () const
39  {return "exp";}
40 
42  inline CouNumber gradientNorm (const double *x)
43  {return (argument_ -> Index () < 0) ? 0. : exp (x [argument_ -> Index ()]);}
44 
46  expression *differentiate (int index);
47 
49  void getBounds (expression *&, expression *&);
50 
52  virtual void getBounds (CouNumber &lb, CouNumber&ub);
53 
55  void generateCuts (expression *w, //const OsiSolverInterface &si,
56  OsiCuts &cs, const CouenneCutGenerator *cg,
57  t_chg_bounds * = NULL, int = -1,
60 
62  virtual enum expr_type code () {return COU_EXPREXP;}
63 
66 
69  virtual CouNumber selectBranch (const CouenneObject *obj,
70  const OsiBranchingInformation *info,
71  expression * &var,
72  double * &brpts,
73  double * &brDist, // distance of current LP
74  // point to new convexifications
75  int &way);
76 
78  virtual bool isBijective() const {return true;}
79 
81  virtual CouNumber inverse(expression *vardep) const
82  {
83  return log((*vardep)());
84  }
85 
88  virtual bool isCuttable (CouenneProblem *problem, int index) const;
89 
91  //virtual enum convexity convexity ()
92  //{return CONVEX;}
93 };
94 
95 }
96 
97 #endif
Cut Generator for linear convexifications.
expression * clone(Domain *d=NULL) const
Cloning method.
OsiObject for auxiliary variables $w=f(x)$.
expression * differentiate(int index)
Differentiation.
virtual CouNumber inverse(expression *vardep) const
inverse of exponential
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...
CouExpr & log(CouExpr &e)
status of lower/upper bound of a variable, to be checked/modified in bound tightening ...
virtual bool isBijective() const
return true if bijective
virtual enum expr_type code()
Code for comparisons.
expression * argument_
single argument taken by this expression
expression class for unary functions (sin, log, etc.)
bool impliedBound(int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign=expression::AUX_EQ)
Implied bound processing.
virtual int Index() const
Return index of variable (only valid for exprVar and exprAux)
CouExpr & exp(CouExpr &e)
auxSign
&quot;sign&quot; of the constraint defining an auxiliary.
unary_function F()
The operator&#39;s function.
CouNumber(* unary_function)(CouNumber)
unary function, used in all exprUnary
exprExp(expression *al)
Constructor.
Class for MINLP problems with symbolic information.
std::string printOp() const
Print operator.
CouNumber gradientNorm(const double *x)
return l-2 norm of gradient at given point
void generateCuts(expression *w, OsiCuts &cs, const CouenneCutGenerator *cg, t_chg_bounds *=NULL, int=-1, CouNumber=-COUENNE_INFINITY, CouNumber=COUENNE_INFINITY)
Generate convexification cuts for this expression.
void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
double CouNumber
main number type in Couenne
#define COUENNE_INFINITY
expr_type
code returned by the method expression::code()
Expression base class.
class for the exponential,
virtual bool isCuttable(CouenneProblem *problem, int index) const
can this expression be further linearized or are we on its concave (&quot;bad&quot;) side
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...