Couenne  0.5.8
CouenneExprSignPow.hpp
Go to the documentation of this file.
1 /* $Id: CouenneExprSignPow.hpp 698 2011-06-20 13:36:43Z pbelotti $
2  *
3  * Name: CouenneExprSignPow.hpp
4  * Author: Pietro Belotti
5  * Purpose: Defines signed powers, i.e., functions of the form x|x|^k with k in R
6  *
7  * (C) Pietro Belotti 2011
8  * This file is licensed under the Eclipse Public License (EPL)
9  */
10 
11 #ifndef COUENNE_EXPRSIGNPOW_HPP
12 #define COUENNE_EXPRSIGNPOW_HPP
13 
14 #include <math.h>
15 
16 #include "CouenneExprPow.hpp"
17 
18 namespace Couenne {
19 
20  class funtriplet;
21 
24 
25  class exprSignPow: public exprSignPow {
26 
27  public:
28 
30  exprSignPow (expression **al, int n = 2):
31  exprPow (al, n) {} //< non-leaf expression, with argument list
32 
35  exprPow (arg0, arg1) {}
36 
38  expression *clone (Domain *d = NULL) const
39  {return new exprSignPow (clonearglist (d), nargs_);}
40 
43 
45  void getBounds (expression *&, expression *&);
46 
48  void getBounds (CouNumber &lb, CouNumber &ub);
49 
52  exprAux *standardize (CouenneProblem *p, bool addAux = true);
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 ()
63  {return COU_EXPRSIGNPOW;}
64 
66  bool impliedBound (int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign = expression::AUX_EQ);
67 
70  virtual CouNumber selectBranch (const CouenneObject *obj,
71  const OsiBranchingInformation *info,
72  expression * &var,
73  double * &brpts,
74  double * &brDist, // distance of current LP
75  // point to new convexifications
76  int &way);
77 
80  virtual bool isCuttable (CouenneProblem *problem, int index) const;
81  };
82 
83 
86  // return (currValue_ = safe_pow (base, exponent));
87  return (safe_pow ((**arglist_) (), (*(arglist_ [1])) ()));
88  }
89 }
90 
91 #endif
Couenne::t_chg_bounds
status of lower/upper bound of a variable, to be checked/modified in bound tightening
Definition: CouenneTypes.hpp:66
Couenne::exprSignPow::exprSignPow
exprSignPow(expression *arg0, expression *arg1)
Constructor with only two arguments.
Definition: CouenneExprSignPow.hpp:34
Couenne::expr_type
expr_type
code returned by the method expression::code()
Definition: CouenneTypes.hpp:40
COUENNE_INFINITY
#define COUENNE_INFINITY
Definition: CouennePrecisions.hpp:32
Couenne::exprPow
Power of an expression (binary operator), with constant.
Definition: CouenneExprPow.hpp:30
Couenne::expression::AUX_EQ
@ AUX_EQ
Definition: CouenneExpression.hpp:55
CouenneExprPow.hpp
Couenne::exprSignPow::generateCuts
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
Couenne::CouenneCutGenerator
Cut Generator for linear convexifications.
Definition: CouenneCutGenerator.hpp:49
Couenne
general include file for different compilers
Definition: CouenneAggrProbing.hpp:24
Couenne::exprSignPow::getBounds
void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
Couenne::CouenneObject
OsiObject for auxiliary variables $w=f(x)$.
Definition: CouenneObject.hpp:57
Couenne::exprSignPow::clone
expression * clone(Domain *d=NULL) const
cloning method
Definition: CouenneExprSignPow.hpp:38
Couenne::exprSignPow::selectBranch
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
Couenne::CouNumber
double CouNumber
main number type in Couenne
Definition: CouenneTypes.hpp:100
Couenne::COU_EXPRSIGNPOW
@ COU_EXPRSIGNPOW
Definition: CouenneTypes.hpp:46
OsiCuts
Couenne::exprSignPow::standardize
exprAux * standardize(CouenneProblem *p, bool addAux=true)
reduce expression in standard form, creating additional aux variables (and constraints)
Couenne::exprSignPow::exprSignPow
exprSignPow(expression **al, int n=2)
Constructor.
Definition: CouenneExprSignPow.hpp:30
OsiBranchingInformation
Couenne::exprSignPow::isCuttable
virtual bool isCuttable(CouenneProblem *problem, int index) const
can this expression be further linearized or are we on its concave ("bad") side
Couenne::safe_pow
CouNumber safe_pow(CouNumber base, CouNumber exponent, bool signpower=false)
compute power and check for integer-and-odd inverse exponent
Definition: CouenneExprPow.hpp:133
Couenne::exprSignPow::code
virtual enum expr_type code()
code for comparison
Definition: CouenneExprSignPow.hpp:62
Couenne::exprSignPow::impliedBound
bool impliedBound(int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign=expression::AUX_EQ)
implied bound processing
Couenne::CouenneProblem
Class for MINLP problems with symbolic information.
Definition: CouenneProblem.hpp:169
Couenne::exprAux
Auxiliary variable.
Definition: CouenneExprAux.hpp:32
Couenne::exprSignPow
Power of an expression (binary operator), with constant.
Definition: CouenneExprSignPow.hpp:25
Couenne::expression
Expression base class.
Definition: CouenneExpression.hpp:48
Couenne::Domain
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...
Definition: CouenneDomain.hpp:104
Couenne::exprSignPow::operator()
CouNumber operator()()
function for the evaluation of the expression
Definition: CouenneExprSignPow.hpp:85