CouenneExprEvenPow.hpp

Go to the documentation of this file.
00001 /* $Id: CouenneExprEvenPow.hpp 698 2011-06-20 13:36:43Z pbelotti $
00002  *
00003  * Name:    CouenneExprEvenPow.hpp
00004  * Author:  Pietro Belotti
00005  * Purpose: definition of powers with even exponent
00006  *
00007  * (C) Pietro Belotti 2011
00008  * This file is licensed under the Eclipse Public License (EPL)
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) {} //< non-leaf expression, with argument list
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, //const OsiSolverInterface &si, 
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, // distance of current LP
00081                                     // point to new convexifications
00082                                     int &way);
00083 
00086     virtual bool isCuttable (CouenneProblem *problem, int index) const;
00087   };
00088 
00090   inline CouNumber exprEvenPow::operator () () {
00091     //  return (currValue_ = safe_pow (base, exponent));
00092     return (safe_pow ((**arglist_) (), (*(arglist_ [1])) ()));
00093   }
00094 }
00095 
00096 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 19 Dec 2013 for Couenne by  doxygen 1.6.1