CouenneExprEvenPow.hpp
Go to the documentation of this file.
1 /* $Id: CouenneExprEvenPow.hpp 698 2011-06-20 13:36:43Z pbelotti $
2  *
3  * Name: CouenneExprEvenPow.hpp
4  * Author: Pietro Belotti
5  * Purpose: definition of powers with even exponent
6  *
7  * (C) Pietro Belotti 2011
8  * This file is licensed under the Eclipse Public License (EPL)
9  */
10 
11 #ifndef COUENNE_EXPREVENPOW_HPP
12 #define COUENNE_EXPREVENPOW_HPP
13 
14 #include <math.h>
15 
16 #include "CouenneExprOp.hpp"
17 #include "CouenneExprMul.hpp"
18 #include "CouenneExprClone.hpp"
19 #include "CouenneExprConst.hpp"
20 
21 namespace Couenne {
22 
25 
26  class exprEvenPow: public exprPow {
27 
28  public:
29 
31  exprEvenPow (expression **al, int n = 2):
32  exprPow (al, n) {} //< non-leaf expression, with argument list
33 
36  exprPow (arg0, arg1) {}
37 
39  expression *clone (Domain *d = NULL) const
40  {return new exprEvenPow (clonearglist (d), nargs_);}
41 
44 
46  void getBounds (expression *&, expression *&);
47 
49  void getBounds (CouNumber &lb, CouNumber &ub);
50 
53  exprAux *standardize (CouenneProblem *p, bool addAux = true);
54 
56  void generateCuts (expression *w, //const OsiSolverInterface &si,
57  OsiCuts &cs, const CouenneCutGenerator *cg,
58  t_chg_bounds * = NULL, int = -1,
61 
65  {return arglist_ [0];}
66 
68  virtual enum expr_type code ()
69  {return COU_EXPREVENPOW;}
70 
73 
76  virtual CouNumber selectBranch (const CouenneObject *obj,
77  const OsiBranchingInformation *info,
78  expression * &var,
79  double * &brpts,
80  double * &brDist, // distance of current LP
81  // point to new convexifications
82  int &way);
83 
86  virtual bool isCuttable (CouenneProblem *problem, int index) const;
87  };
88 
91  // return (currValue_ = safe_pow (base, exponent));
92  return (safe_pow ((**arglist_) (), (*(arglist_ [1])) ()));
93  }
94 }
95 
96 #endif
Cut Generator for linear convexifications.
CouNumber operator()()
function for the evaluation of the expression
void fint fint fint real fint real real real real real real real real real fint real fint fint fint real fint fint fint fint * info
OsiObject for auxiliary variables $w=f(x)$.
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
exprEvenPow(expression *arg0, expression *arg1)
Constructor with only two arguments.
status of lower/upper bound of a variable, to be checked/modified in bound tightening ...
exprEvenPow(expression **al, int n=2)
Constructor.
Power of an expression (binary operator), with constant.
Power of an expression (binary operator) with even exponent, with constant even.
expression * clone(Domain *d=NULL) const
cloning method
auxSign
&quot;sign&quot; of the constraint defining an auxiliary.
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 ...
expression ** clonearglist(Domain *d=NULL) const
clone argument list (for use with clone method)
Class for MINLP problems with symbolic information.
exprAux * standardize(CouenneProblem *p, bool addAux=true)
reduce expression in standard form, creating additional aux variables (and constraints) ...
virtual enum expr_type code()
code for comparison
expression ** arglist_
argument list is an array of pointers to other expressions
double CouNumber
main number type in Couenne
int nargs_
number of arguments (cardinality of arglist)
#define COUENNE_INFINITY
Auxiliary variable.
expr_type
code returned by the method expression::code()
bool impliedBound(int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign=expression::AUX_EQ)
implied bound processing
CouNumber safe_pow(CouNumber base, CouNumber exponent, bool signpower=false)
compute power and check for integer-and-odd inverse exponent
Expression base class.
virtual bool isCuttable(CouenneProblem *problem, int index) const
can this expression be further linearized or are we on its concave (&quot;bad&quot;) side
void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
void fint fint fint real fint real real real real real real real real * w
void fint * n
expression * getFixVar()
return an index to the variable&#39;s argument that is better fixed in a branching rule for solving a non...
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...