/home/coin/SVN-release/OS-2.1.0/Couenne/src/expression/operators/exprAbs.hpp

Go to the documentation of this file.
00001 /* $Id: exprAbs.hpp 217 2009-07-08 17:02:07Z 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-09.
00008  * This file is licensed under the Common Public License (CPL)
00009  */
00010 
00011 #ifndef COUENNE_EXPRABS_HPP
00012 #define COUENNE_EXPRABS_HPP
00013 
00014 #include <math.h>
00015 
00016 #include "exprUnary.hpp"
00017 #include "exprConst.hpp"
00018 
00019 
00021 
00022 class exprAbs: public exprUnary {
00023 
00024  public:
00025 
00027   exprAbs  (expression *al): 
00028     exprUnary (al) {} //< non-leaf expression, with argument list
00029 
00031   inline unary_function F () {return fabs;}
00032 
00034   expression *clone (Domain *d = NULL) const
00035     {return new exprAbs (argument_ -> clone (d));}
00036 
00038   std::string printOp () const
00039     {return "abs";}
00040 
00042   inline CouNumber gradientNorm (const double *x)
00043   {return ((argument_ -> Index () < 0) ? 0. : 1.);}
00044 
00046   expression *differentiate (int index); 
00047 
00049   virtual void getBounds (expression *&, expression *&);
00050 
00052   virtual void getBounds (CouNumber &lb, CouNumber &ub);
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   enum expr_type code () {return COU_EXPRABS;}
00063 
00065   inline bool isInteger ()
00066   {return argument_ -> isInteger ();}
00067 
00069   bool impliedBound (int, CouNumber *, CouNumber *, t_chg_bounds *);
00070 
00073   virtual CouNumber selectBranch (const CouenneObject *obj, 
00074                                   const OsiBranchingInformation *info,
00075                                   expression * &var, 
00076                                   double * &brpts, 
00077                                   double * &brDist, // distance of current LP
00078                                                     // point to new convexifications
00079                                   int &way);
00080 
00082   virtual void closestFeasible (expression *varind, expression *vardep,
00083                                 CouNumber& left, CouNumber& right) const;
00084 
00087   virtual bool isCuttable (CouenneProblem *problem, int index) const;
00088 
00090   //virtual enum convexity convexity () const;
00091 };
00092 
00093 #endif

Generated on Tue Mar 30 03:04:37 2010 by  doxygen 1.4.7