# CouenneExprOddPow.hpp

Go to the documentation of this file.

    00001 /* $Id: CouenneExprOddPow.hpp 698 2011-06-20 13:36:43Z pbelotti $
    00002  *
    00003  * Name:    CouenneExprOddPow.hpp
    00004  * Author:  Pietro Belotti
    00005  * Purpose: definition of powers with odd exponent
    00006  *
    00007  * (C) Pietro Belotti 2011
    00008  * This file is licensed under the Eclipse Public License (EPL)
    00009  */
    00010
    00011 #ifndef COUENNE_EXPRODDPOW_HPP
    00012 #define COUENNE_EXPRODDPOW_HPP
    00013
    00014 #include <math.h>
    00015
    00016 #include "CouenneExprPow.hpp"
    00017
    00018 namespace Couenne {
    00019
    00021
    00022   class exprOddPow: public exprPow {
    00023
    00024   public:
    00025
    00027     exprOddPow (expression **al, int n = 2):
    00028       exprOp (al, n) {} //< non-leaf expression, with argument list
    00029
    00031     exprOddPow (expression *arg0, expression *arg1):
    00032       exprOp (arg0, arg1) {}
    00033
    00035     expression *clone (Domain *d = NULL) const
    00036     {return new exprOddPow (clonearglist (d), nargs_);}
    00037
    00039     std::string printOp () const
    00040     {return "^";}
    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_EXPRPOW;}
    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 exprOddPow::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