11 #include "CoinHelperFunctions.hpp"
19 using namespace Couenne;
21 #define SQ_COUENNE_EPS COUENNE_EPS * COUENNE_EPS
26 const OsiBranchingInformation *
info,
33 brpts = (
double *) realloc (brpts,
sizeof (
double));
34 brDist = (
double *) realloc (brDist, 2*
sizeof (
double));
56 ind = var ->
Index (),
57 wi = obj -> Reference () ->
Index ();
59 assert ((ind >= 0) && (wi >= 0));
62 y0 = info -> solution_ [wi],
63 x0 = info -> solution_ [ind],
64 l = info -> lower_ [ind],
65 u = info -> upper_ [ind];
85 return (brDist [0] = brDist [1] = sqrt (x0*x0 + dy*dy));
109 brpts = (
double *) realloc (brpts,
sizeof (
double));
110 *brpts = 0.5 * (x0 +
exp (y0));
113 return CoinMin (brDist [0] = x0 -
exp (y0),
114 brDist [1] =
log (x0) - y0);
119 brpts = (
double *) realloc (brpts,
sizeof (
double));
123 *brpts = obj -> midInterval (
exp (y0), l, u, info);
126 brDist [0] = x0 - *brpts;
127 return (brDist [1] =
projectSeg (x0, y0, *brpts,
log (*brpts), u,
log (u), +1));
133 *brpts = CoinMax (10*x0, obj -> midInterval (x0, l, u, info));
136 brDist [1] =
log (*brpts) - y0;
138 return (brDist [0] =
projectSeg (x0, y0, l,
log (l), *brpts,
log (*brpts), +1));
146 *brpts = obj -> getBrPoint (&ft, x0, l, u, info);
157 return CoinMin (brDist [0] =
projectSeg (x0, y0, l,
log (l), *brpts,
log (*brpts), +1),
void fint fint fint real fint real real real real real real real real real fint real fint fint fint real fint fint fint fint * info
OsiObject for auxiliary variables $w=f(x)$.
CouExpr & log(CouExpr &e)
CouNumber powNewton(CouNumber xc, CouNumber yc, unary_function f, unary_function fp, unary_function fpp)
find proper tangent point to add deepest tangent cut
CouNumber oppInvSqr(register CouNumber x)
derivative of inv (x)
virtual CouNumber selectBranch(const CouenneObject *obj, const OsiBranchingInformation *info, expression *&var, double *&brpts, double *&brDist, int &way)
set up branching object by evaluating many branching points for each expression's arguments ...
expression * argument_
single argument taken by this expression
CouNumber inv(register CouNumber arg)
the operator itself
CouExpr & exp(CouExpr &e)
virtual int Index() const
Return index of variable (only valid for exprVar and exprAux)
CouNumber projectSeg(CouNumber x0, CouNumber y0, CouNumber x1, CouNumber y1, CouNumber x2, CouNumber y2, int sign, CouNumber *xp=NULL, CouNumber *yp=NULL)
Compute projection of point (x0, y0) on the segment defined by two points (x1,y1), (x2, y2) – sign provided by parameter sign.
double CouNumber
main number type in Couenne