# CouenneExprOpp.hpp

Go to the documentation of this file.

    00001 /* $Id: CouenneExprOpp.hpp 615 2011-06-08 20:36:24Z pbelotti $
    00002  *
    00003  * Name:    exprOpp.hpp
    00004  * Author:  Pietro Belotti
    00005  * Purpose: definition of the opposite -f(x) 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_EXPROPP_HPP
    00012 #define COUENNE_EXPROPP_HPP
    00013
    00014 #include "CouennePrecisions.hpp"
    00015 #include "CouenneExprUnary.hpp"
    00016
    00017 namespace Couenne {
    00018
    00020
    00021 inline CouNumber opp (register CouNumber arg)
    00022 {return - arg;}
    00023
    00024
    00026
    00027 class exprOpp: public exprUnary {
    00028
    00029  public:
    00030
    00032   exprOpp (expression *al):
    00033     exprUnary (al) {} //< non-leaf expression, with argument list
    00034
    00036   expression *clone (Domain *d = NULL) const
    00037     {return new exprOpp (argument_ -> clone (d));}
    00038
    00040   inline unary_function F ()
    00041     {return opp;}
    00042
    00044   void print (std::ostream &out,
    00045               bool descend) const;
    00046
    00048   inline CouNumber gradientNorm (const double *x)
    00049   {return (argument_ -> Index () < 0) ? 0. : 1.;}
    00050
    00052   expression *differentiate (int index);
    00053
    00055   virtual expression *simplify ();
    00056
    00058   inline int Linearity ()
    00059     {return argument_ -> Linearity ();}
    00060
    00062   void getBounds (expression *&, expression *&);
    00063
    00065   void getBounds (CouNumber &, CouNumber&);
    00066
    00068   virtual void generateCuts (expression *, //const OsiSolverInterface &,
    00069                              OsiCuts &, const CouenneCutGenerator *,
    00070                              t_chg_bounds * = NULL, int = -1,
    00071                              CouNumber = -COUENNE_INFINITY,
    00072                              CouNumber =  COUENNE_INFINITY);
    00073
    00075   virtual enum expr_type code ()
    00076     {return COU_EXPROPP;}
    00077
    00079   bool isInteger ()
    00080     {return argument_ -> isInteger ();}
    00081
    00083   bool impliedBound (int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign = expression::AUX_EQ);
    00084
    00086   exprAux *standardize (CouenneProblem *, bool addAux = true);
    00087 };
    00088
    00089 }
    00090
    00091 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines