# CouenneExprAbs.hpp

Go to the documentation of this file.

    00001 /* $Id: CouenneExprAbs.hpp 615 2011-06-08 20:36:24Z pbelotti $
    00002  *
    00003  * Name:    exprAbs.hpp
    00004  * Author:  Pietro Belotti
    00005  * Purpose: definition of the absolute value of a function
    00006  *
    00007  * (C) Carnegie-Mellon University, 2006-10.
    00008  * This file is licensed under the Eclipse Public License (EPL)
    00009  */
    00010
    00011 #ifndef COUENNE_EXPRABS_HPP
    00012 #define COUENNE_EXPRABS_HPP
    00013
    00014 #include <math.h>
    00015
    00016 #include "CouenneExprUnary.hpp"
    00017 #include "CouenneExprConst.hpp"
    00018
    00019 namespace Couenne {
    00020
    00022
    00023 class exprAbs: public exprUnary {
    00024
    00025  public:
    00026
    00028   exprAbs  (expression *al):
    00029     exprUnary (al) {} //< non-leaf expression, with argument list
    00030
    00032   inline unary_function F () {return fabs;}
    00033
    00035   expression *clone (Domain *d = NULL) const
    00036     {return new exprAbs (argument_ -> clone (d));}
    00037
    00039   std::string printOp () const
    00040     {return "abs";}
    00041
    00043   inline CouNumber gradientNorm (const double *x)
    00044   {return ((argument_ -> Index () < 0) ? 0. : 1.);}
    00045
    00047   expression *differentiate (int index);
    00048
    00050   virtual void getBounds (expression *&, expression *&);
    00051
    00053   virtual void getBounds (CouNumber &lb, CouNumber &ub);
    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
    00063   enum expr_type code () {return COU_EXPRABS;}
    00064
    00066   inline bool isInteger ()
    00067   {return argument_ -> isInteger ();}
    00068
    00070   bool impliedBound (int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign = expression::AUX_EQ);
    00071
    00074   virtual CouNumber selectBranch (const CouenneObject *obj,
    00075                                   const OsiBranchingInformation *info,
    00076                                   expression * &var,
    00077                                   double * &brpts,
    00078                                   double * &brDist, // distance of current LP
    00079                                                     // point to new convexifications
    00080                                   int &way);
    00081
    00083   virtual void closestFeasible (expression *varind, expression *vardep,
    00084                                 CouNumber& left, CouNumber& right) const;
    00085
    00088   virtual bool isCuttable (CouenneProblem *problem, int index) const;
    00089
    00091   //virtual enum convexity convexity () const;
    00092 };
    00093
    00094 }
    00095
    00096 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines