00001
00002
00003
00004
00005
00006
00007
00008
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) {}
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,
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,
00078
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
00091 };
00092
00093 #endif