14 # define M_E 2.7182818284590452354
32 using namespace Couenne;
95 return (addAux ? (p -> addAuxiliary (
this)) :
new exprAux (
this, p -> domain ()));
99 return (addAux ? (p -> addAuxiliary (ret)) :
new exprAux (ret, p -> domain ()));
122 int w_ind = aux ->
Index ();
123 int x_ind = xe ->
Index ();
132 enum auxSign aSign = cg -> Problem () -> Var (w_ind) -> sign ();
146 cg -> createCut (cs, u*lk - l*uk + avg * avg_k_1 * (1-k), aSign,
147 w_ind, u - l + 1, x_ind, lk-uk - k * avg_k_1);
156 if (cL || cR) cg -> createCut (cs, 0., aSign, w_ind, 1.);
164 if (cL || cR) cg -> createCut (cs, 1., aSign, w_ind, 1.);
177 if ( (isInt || isInvInt)
194 if ((l<0.) && (u>0.)) {
203 if (cg -> isFirst ()) {
204 w = (l>0.) ? 1. : (u<0.) ? -1. : 0.;
211 if (cg -> isFirst ()) {
212 x = (l>0) ? l : (u<0) ? u : 0;
223 if (l>=0.)
addPowEnvelope (cg, cs, w_ind, x_ind,
x, w, k, l, u, sign,
issignpower_);
224 else if (u > q * l) {
225 addPowEnvelope (cg, cs, w_ind, x_ind,
x, w, k, q*l, u, sign,
issignpower_);
226 cg -> addSegment (cs, w_ind, x_ind, l,
safe_pow (l,k,
issignpower_), q*l,
safe_pow (q*l,k,
issignpower_), sign);
227 }
else cg -> addSegment (cs, w_ind, x_ind, l,
safe_pow (l,k,
issignpower_), u,
safe_pow (u, k,
issignpower_), sign);
232 if (u<=0.)
addPowEnvelope (cg, cs, w_ind, x_ind,
x, w, k, l, u, -sign,
issignpower_);
233 else if (l < q * u) {
234 addPowEnvelope (cg, cs, w_ind, x_ind,
x, w, k, l, q*u, -sign,
issignpower_);
235 cg -> addSegment (cs, w_ind, x_ind, q*u,
safe_pow (q*u,k,
issignpower_), u,
safe_pow (u,k,
issignpower_), -sign);
237 cg -> addSegment (cs, w_ind, x_ind, l,
safe_pow (l,k,
issignpower_), u,
safe_pow (u,k,
issignpower_), -sign);
300 cg -> addSegment (cs, w_ind, x_ind, l,
safe_pow (l, k,
issignpower_), u,
safe_pow (u, k,
issignpower_), 1);
311 cg -> addSegment (cs, w_ind, x_ind, l,
safe_pow (l, k,
issignpower_), u,
safe_pow (u, k,
issignpower_), -sign);
315 if (cg -> isFirst()) {
316 x = (k<0) ? ((u<0) ? u : (l>0) ? l : 0) : 0;
322 if (u > powThres) u = CoinMax (
x,l) + powStep;
323 if (l < - powThres) l = CoinMin (
x,u) - powStep;
333 addPowEnvelope (cg, cs, w_ind, x_ind,
x, w, k, l, u, sign,
issignpower_);
Cut Generator for linear convexifications.
static Bigint *ULong * xe
CouExpr & log(CouExpr &e)
status of lower/upper bound of a variable, to be checked/modified in bound tightening ...
const char & lower() const
virtual exprAux * standardize(CouenneProblem *, bool addAux=true)
generate auxiliary variable
const char & upper() const
virtual exprAux * standardize(CouenneProblem *p, bool addAux=true)
reduce expression in standard form, creating additional aux variables (and constraints) ...
void addPowEnvelope(const CouenneCutGenerator *, OsiCuts &, int, int, CouNumber, CouNumber, CouNumber, CouNumber, CouNumber, int, bool=false)
add upper/lower envelope to power in convex/concave areas
#define COUENNE_EPS_SIMPL
virtual enum nodeType Type() const
Node type.
virtual int Index() const
Return index of variable (only valid for exprVar and exprAux)
auxSign
"sign" of the constraint defining an auxiliary.
virtual void getBounds(expression *&, expression *&)
Get lower and upper bound of an expression (if any)
Class for MINLP problems with symbolic information.
expression clone (points to another expression)
bool issignpower_
do we mean a signed power function: sign(arg0) * |arg0|^arg1 (assumes that arg1 is constant) ...
static std::map< int, CouNumber > Qmap
Maps an integer k with the root of .
expression ** arglist_
argument list is an array of pointers to other expressions
double CouNumber
main number type in Couenne
class that stores result of previous calls to rootQ into a map for faster access
virtual void generateCuts(expression *w, OsiCuts &cs, const CouenneCutGenerator *cg, t_chg_bounds *=NULL, int=-1, CouNumber=-COUENNE_INFINITY, CouNumber=COUENNE_INFINITY)
generate equality between *this and *w
CouNumber safe_pow(CouNumber base, CouNumber exponent, bool signpower=false)
compute power and check for integer-and-odd inverse exponent
class for the exponential,
void fint fint fint real fint real real real real real real real real * w
virtual CouNumber Value() const
value (empty)
void fint fint fint real fint real * x
class for multiplications,