CouenneExprSignPow.hpp

Go to the documentation of this file.
00001 /* $Id: CouenneExprSignPow.hpp 698 2011-06-20 13:36:43Z pbelotti $
00002  *
00003  * Name:    CouenneExprSignPow.hpp
00004  * Author:  Pietro Belotti
00005  * Purpose: Defines signed powers, i.e., functions of the form x|x|^k with k in R
00006  *
00007  * (C) Pietro Belotti 2011
00008  * This file is licensed under the Eclipse Public License (EPL)
00009  */
00010 
00011 #ifndef COUENNE_EXPRSIGNPOW_HPP
00012 #define COUENNE_EXPRSIGNPOW_HPP
00013 
00014 #include <math.h>
00015 
00016 #include "CouenneExprPow.hpp"
00017 
00018 namespace Couenne {
00019 
00020   class funtriplet;
00021 
00024 
00025   class exprSignPow: public exprSignPow {
00026 
00027   public:
00028 
00030     exprSignPow (expression **al, int n = 2): 
00031       exprPow (al, n) {} //< non-leaf expression, with argument list
00032 
00034     exprSignPow (expression *arg0, expression *arg1):
00035       exprPow (arg0, arg1) {}
00036 
00038     expression *clone (Domain *d = NULL) const
00039     {return new exprSignPow (clonearglist (d), nargs_);}
00040 
00042     CouNumber operator () ();
00043 
00045     void getBounds (expression *&, expression *&);
00046 
00048     void getBounds (CouNumber &lb, CouNumber &ub);
00049 
00052     exprAux *standardize (CouenneProblem *p, bool addAux = true);
00053 
00055     void generateCuts (expression *w, //const OsiSolverInterface &si, 
00056                        OsiCuts &cs, const CouenneCutGenerator *cg, 
00057                        t_chg_bounds * = NULL, int = -1, 
00058                        CouNumber = -COUENNE_INFINITY, 
00059                        CouNumber =  COUENNE_INFINITY);
00060 
00062     virtual enum expr_type code () 
00063     {return COU_EXPRSIGNPOW;}
00064 
00066     bool impliedBound (int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign = expression::AUX_EQ);
00067 
00070     virtual CouNumber selectBranch (const CouenneObject *obj, 
00071                                     const OsiBranchingInformation *info,
00072                                     expression * &var, 
00073                                     double * &brpts, 
00074                                     double * &brDist, // distance of current LP
00075                                     // point to new convexifications
00076                                     int &way);
00077 
00080     virtual bool isCuttable (CouenneProblem *problem, int index) const;
00081   };
00082 
00083 
00085   inline CouNumber exprSignPow::operator () () {
00086     //  return (currValue_ = safe_pow (base, exponent));
00087     return (safe_pow ((**arglist_) (), (*(arglist_ [1])) ()));
00088   }
00089 }
00090 
00091 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 17 Sep 2013 for Couenne by  doxygen 1.6.1