Couenne  0.5.8
CouenneExprOpp.hpp
Go to the documentation of this file.
1 /* $Id: CouenneExprOpp.hpp 615 2011-06-08 20:36:24Z pbelotti $
2  *
3  * Name: exprOpp.hpp
4  * Author: Pietro Belotti
5  * Purpose: definition of the opposite -f(x) of a function
6  *
7  * (C) Carnegie-Mellon University, 2006-10.
8  * This file is licensed under the Eclipse Public License (EPL)
9  */
10 
11 #ifndef COUENNE_EXPROPP_HPP
12 #define COUENNE_EXPROPP_HPP
13 
14 #include "CouennePrecisions.hpp"
15 #include "CouenneExprUnary.hpp"
16 
17 namespace Couenne {
18 
20 
21 inline CouNumber opp (register CouNumber arg)
22 {return - arg;}
23 
24 
26 
27 class exprOpp: public exprUnary {
28 
29  public:
30 
33  exprUnary (al) {} //< non-leaf expression, with argument list
34 
36  expression *clone (Domain *d = NULL) const
37  {return new exprOpp (argument_ -> clone (d));}
38 
40  inline unary_function F ()
41  {return opp;}
42 
44  void print (std::ostream &out,
45  bool descend) const;
46 
48  inline CouNumber gradientNorm (const double *x)
49  {return (argument_ -> Index () < 0) ? 0. : 1.;}
50 
52  expression *differentiate (int index);
53 
55  virtual expression *simplify ();
56 
58  inline int Linearity ()
59  {return argument_ -> Linearity ();}
60 
62  void getBounds (expression *&, expression *&);
63 
65  void getBounds (CouNumber &, CouNumber&);
66 
68  virtual void generateCuts (expression *, //const OsiSolverInterface &,
69  OsiCuts &, const CouenneCutGenerator *,
70  t_chg_bounds * = NULL, int = -1,
73 
75  virtual enum expr_type code ()
76  {return COU_EXPROPP;}
77 
79  bool isInteger ()
80  {return argument_ -> isInteger ();}
81 
84 
86  exprAux *standardize (CouenneProblem *, bool addAux = true);
87 };
88 
89 }
90 
91 #endif
Couenne::t_chg_bounds
status of lower/upper bound of a variable, to be checked/modified in bound tightening
Definition: CouenneTypes.hpp:66
Couenne::unary_function
CouNumber(* unary_function)(CouNumber)
unary function, used in all exprUnary
Definition: CouenneTypes.hpp:103
Couenne::opp
CouNumber opp(register CouNumber arg)
operator opp: returns the opposite of a number
Definition: CouenneExprOpp.hpp:21
Couenne::exprUnary::argument_
expression * argument_
single argument taken by this expression
Definition: CouenneExprUnary.hpp:38
Couenne::COU_EXPROPP
@ COU_EXPROPP
Definition: CouenneTypes.hpp:51
Couenne::expr_type
expr_type
code returned by the method expression::code()
Definition: CouenneTypes.hpp:40
CouennePrecisions.hpp
Couenne::exprOpp::Linearity
int Linearity()
get a measure of "how linear" the expression is (see CouenneTypes.h)
Definition: CouenneExprOpp.hpp:58
Couenne::exprOpp::gradientNorm
CouNumber gradientNorm(const double *x)
return l-2 norm of gradient at given point
Definition: CouenneExprOpp.hpp:48
COUENNE_INFINITY
#define COUENNE_INFINITY
Definition: CouennePrecisions.hpp:32
Couenne::exprUnary
expression class for unary functions (sin, log, etc.)
Definition: CouenneExprUnary.hpp:33
Couenne::expression::AUX_EQ
@ AUX_EQ
Definition: CouenneExpression.hpp:55
Couenne::exprOpp
class opposite,
Definition: CouenneExprOpp.hpp:27
Couenne::CouenneCutGenerator
Cut Generator for linear convexifications.
Definition: CouenneCutGenerator.hpp:49
Couenne::exprOpp::F
unary_function F()
the operator's function
Definition: CouenneExprOpp.hpp:40
Couenne::exprOpp::clone
expression * clone(Domain *d=NULL) const
cloning method
Definition: CouenneExprOpp.hpp:36
Couenne
general include file for different compilers
Definition: CouenneAggrProbing.hpp:24
Index
int Index
Couenne::CouNumber
double CouNumber
main number type in Couenne
Definition: CouenneTypes.hpp:100
OsiCuts
CouenneExprUnary.hpp
Couenne::exprOpp::print
void print(std::ostream &out, bool descend) const
Output.
Couenne::expression::auxSign
auxSign
"sign" of the constraint defining an auxiliary.
Definition: CouenneExpression.hpp:55
Couenne::exprOpp::differentiate
expression * differentiate(int index)
differentiation
Couenne::exprOpp::impliedBound
bool impliedBound(int, CouNumber *, CouNumber *, t_chg_bounds *, enum auxSign=expression::AUX_EQ)
implied bound processing
Couenne::exprOpp::getBounds
void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
Couenne::exprOpp::standardize
exprAux * standardize(CouenneProblem *, bool addAux=true)
standardization (to deal with complex arguments)
Couenne::exprOpp::simplify
virtual expression * simplify()
simplification
Couenne::exprOpp::exprOpp
exprOpp(expression *al)
Constructors, destructor.
Definition: CouenneExprOpp.hpp:32
Couenne::CouenneProblem
Class for MINLP problems with symbolic information.
Definition: CouenneProblem.hpp:169
Couenne::exprOpp::code
virtual enum expr_type code()
code for comparisons
Definition: CouenneExprOpp.hpp:75
Couenne::exprOpp::generateCuts
virtual void generateCuts(expression *, OsiCuts &, const CouenneCutGenerator *, t_chg_bounds *=NULL, int=-1, CouNumber=-COUENNE_INFINITY, CouNumber=COUENNE_INFINITY)
special version for linear constraints
Couenne::exprAux
Auxiliary variable.
Definition: CouenneExprAux.hpp:32
Couenne::expression
Expression base class.
Definition: CouenneExpression.hpp:48
Couenne::Domain
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...
Definition: CouenneDomain.hpp:104
Couenne::exprOpp::isInteger
bool isInteger()
is this expression integer?
Definition: CouenneExprOpp.hpp:79