CouenneExprEvenPow.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef COUENNE_EXPREVENPOW_HPP
00012 #define COUENNE_EXPREVENPOW_HPP
00013
00014 #include <math.h>
00015
00016 #include "CouenneExprOp.hpp"
00017 #include "CouenneExprMul.hpp"
00018 #include "CouenneExprClone.hpp"
00019 #include "CouenneExprConst.hpp"
00020
00021 namespace Couenne {
00022
00025
00026 class exprEvenPow: public exprPow {
00027
00028 public:
00029
00031 exprEvenPow (expression **al, int n = 2):
00032 exprPow (al, n) {}
00033
00035 exprEvenPow (expression *arg0, expression *arg1):
00036 exprPow (arg0, arg1) {}
00037
00039 expression *clone (Domain *d = NULL) const
00040 {return new exprEvenPow (clonearglist (d), nargs_);}
00041
00043 CouNumber operator () ();
00044
00046 void getBounds (expression *&, expression *&);
00047
00049 void getBounds (CouNumber &lb, CouNumber &ub);
00050
00053 exprAux *standardize (CouenneProblem *p, bool addAux = true);
00054
00056 void generateCuts (expression *w,
00057 OsiCuts &cs, const CouenneCutGenerator *cg,
00058 t_chg_bounds * = NULL, int = -1,
00059 CouNumber = -COUENNE_INFINITY,
00060 CouNumber = COUENNE_INFINITY);
00061
00064 expression *getFixVar ()
00065 {return arglist_ [0];}
00066
00068 virtual enum expr_type code ()
00069 {return COU_EXPREVENPOW;}
00070
00072 bool impliedBound (int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign = expression::AUX_EQ);
00073
00076 virtual CouNumber selectBranch (const CouenneObject *obj,
00077 const OsiBranchingInformation *info,
00078 expression * &var,
00079 double * &brpts,
00080 double * &brDist,
00081
00082 int &way);
00083
00086 virtual bool isCuttable (CouenneProblem *problem, int index) const;
00087 };
00088
00090 inline CouNumber exprEvenPow::operator () () {
00091
00092 return (safe_pow ((**arglist_) (), (*(arglist_ [1])) ()));
00093 }
00094 }
00095
00096 #endif