Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CouenneExprLog.hpp
Go to the documentation of this file.
1 /* $Id: CouenneExprLog.hpp 615 2011-06-08 20:36:24Z pbelotti $
2  *
3  * Name: exprLog.hpp
4  * Author: Pietro Belotti
5  * Purpose: definition of logarithm
6  *
7  * (C) Carnegie-Mellon University, 2006-10.
8  * This file is licensed under the Eclipse Public License (EPL)
9  */
10 
11 #ifndef COUENNE_EXPRLOG_HPP
12 #define COUENNE_EXPRLOG_HPP
13 
14 #include "CouenneExprInv.hpp"
15 #include "CouenneExpression.hpp"
16 
17 namespace Couenne {
18 
20 
21 class exprLog: public exprUnary {
22 
23  public:
24 
27  exprUnary (al) {} // non-leaf expression, with argument list
28 
30  expression *clone (Domain *d = NULL) const
31  {return new exprLog (argument_ -> clone (d));}
32 
34  inline unary_function F () {return log;}
35 
37  std::string printOp () const
38  {return "log";}
39 
41  CouNumber gradientNorm (const double *x);
42 
44  expression *differentiate (int index);
45 
47  void getBounds (expression *&, expression *&);
48 
50  void getBounds (CouNumber &lb, CouNumber &ub);
51 
53  void generateCuts (expression *w, //const OsiSolverInterface &si,
54  OsiCuts &cs, const CouenneCutGenerator *cg,
55  t_chg_bounds * = NULL, int = -1,
58 
60  virtual enum expr_type code ()
61  {return COU_EXPRLOG;}
62 
65 
68  virtual CouNumber selectBranch (const CouenneObject *obj,
69  const OsiBranchingInformation *info,
70  expression * &var,
71  double * &brpts,
72  double * &brDist, // distance of current LP
73  // point to new convexifications
74  int &way);
75 
77  virtual bool isBijective() const {return true;}
78 
80  virtual CouNumber inverse(expression *vardep) const
81  {
82  return exp((*vardep)());
83  }
84 
87  virtual bool isCuttable (CouenneProblem *problem, int index) const;
88 };
89 
90 }
91 
92 #endif
Cut Generator for linear convexifications.
CouNumber gradientNorm(const double *x)
return l-2 norm of gradient at given point
OsiObject for auxiliary variables $w=f(x)$.
virtual enum expr_type code()
code for comparisons
CouExpr & log(CouExpr &e)
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's arguments ...
expression * differentiate(int index)
differentiation
exprLog(expression *al)
Constructors, destructor.
expression * argument_
single argument taken by this expression
expression class for unary functions (sin, log, etc.)
virtual CouNumber inverse(expression *vardep) const
inverse of this operator
void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
CouExpr & exp(CouExpr &e)
auxSign
"sign" of the constraint defining an auxiliary.
CouNumber(* unary_function)(CouNumber)
unary function, used in all exprUnary
Class for MINLP problems with symbolic information.
expression * clone(Domain *d=NULL) const
cloning method
virtual bool isCuttable(CouenneProblem *problem, int index) const
can this expression be further linearized or are we on its concave ("bad") side
double CouNumber
main number type in Couenne
#define COUENNE_INFINITY
class logarithm,
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
unary_function F()
the operator's function
std::string printOp() const
print operator
expr_type
code returned by the method expression::code()
Expression base class.
virtual bool isBijective() const
return true if feasible
bool impliedBound(int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign=expression::AUX_EQ)
implied bound processing
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...