00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef COUENNE_EXPROPP_HPP
00012 #define COUENNE_EXPROPP_HPP
00013
00014 #include "CouennePrecisions.hpp"
00015 #include "exprUnary.hpp"
00016
00017
00019
00020 inline CouNumber opp (register CouNumber arg)
00021 {return - arg;}
00022
00023
00025
00026 class exprOpp: public exprUnary {
00027
00028 public:
00029
00031 exprOpp (expression *al):
00032 exprUnary (al) {}
00033
00035 expression *clone (Domain *d = NULL) const
00036 {return new exprOpp (argument_ -> clone (d));}
00037
00039 inline unary_function F ()
00040 {return opp;}
00041
00043 void print (std::ostream &out,
00044 bool descend) const;
00045
00047 inline CouNumber gradientNorm (const double *x)
00048 {return (argument_ -> Index () < 0) ? 0. : 1.;}
00049
00051 expression *differentiate (int index);
00052
00054 virtual expression *simplify ();
00055
00057 inline int Linearity ()
00058 {return argument_ -> Linearity ();}
00059
00061 void getBounds (expression *&, expression *&);
00062
00064 void getBounds (CouNumber &, CouNumber&);
00065
00067 virtual void generateCuts (expression *,
00068 OsiCuts &, const CouenneCutGenerator *,
00069 t_chg_bounds * = NULL, int = -1,
00070 CouNumber = -COUENNE_INFINITY,
00071 CouNumber = COUENNE_INFINITY);
00072
00074 virtual enum expr_type code ()
00075 {return COU_EXPROPP;}
00076
00078 bool isInteger ()
00079 {return argument_ -> isInteger ();}
00080
00082 bool impliedBound (int, CouNumber *, CouNumber *, t_chg_bounds *);
00083
00085 exprAux *standardize (CouenneProblem *, bool addAux = true);
00086 };
00087
00088 #endif