11 #include "CoinHelperFunctions.hpp"
19 using namespace Couenne;
24 const OsiBranchingInformation *
info,
48 brDist = (
double *) realloc (brDist, 2 *
sizeof (
double));
49 brpts = (
double *) realloc (brpts,
sizeof (
double));
52 ind = var ->
Index (),
53 wi = obj -> Reference () ->
Index ();
55 assert ((ind >= 0) && (wi >= 0));
58 x0 = info -> solution_ [ind],
59 l = info -> lower_ [ind],
60 u = info -> upper_ [ind];
76 return sqrt (brDist [0] = brDist [1] = sqrt (x0*x0 + y0*y0));
99 *brpts = 0.5 * (x0 +
log (y0));
102 return CoinMin (brDist [0] =
log (y0) - x0,
103 brDist [1] = y0 -
exp (x0));
110 *brpts = obj -> midInterval (x0, l, u, info);
113 return CoinMin (brDist [0] = y0 -
exp (x0),
119 *brpts = obj -> midInterval (
log (y0), l, u, info);
122 return CoinMin (brDist [0] =
projectSeg (x0, y0, l,
exp (l), *brpts,
exp (*brpts), -1),
123 brDist [1] =
log (y0) - x0);
130 *brpts = obj -> getBrPoint (&ft, x0, l, u, info);
135 return CoinMin (brDist [0] =
projectSeg (x0, y0, l,
exp (l), *brpts,
exp (*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
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
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