40#define EXPRHDLR_NAME "abs"
41#define EXPRHDLR_DESC "absolute value expression"
42#define EXPRHDLR_PRECEDENCE 70000
43#define EXPRHDLR_HASHKEY SCIPcalcFibHash(7187.0)
72 coefs[*nreturned][0] = -1.0;
73 constant[*nreturned] = 0.0;
77 coefs[*nreturned][0] = 1.0;
78 constant[*nreturned] = 0.0;
97 coefs[*nreturned][0] = -1.0;
98 constant[*nreturned] = 0.0;
104 coefs[*nreturned][0] = 1.0;
105 constant[*nreturned] = 0.0;
119 coefs[*nreturned][0] =
alpha;
161 *simplifiedexpr = expr;
268 SCIPdebugMsg(
scip,
"%sestimate |child| over locdom=[%g,%g] glbdom=[%g,%g]\n", overestimate ?
"over" :
"under",
269 localbounds[0].inf, localbounds[0].sup, globalbounds[0].inf, globalbounds[0].sup);
276 if( refpoint[0] <= 0.0 )
290 lb = localbounds[0].inf;
291 ub = localbounds[0].sup;
320 alpha = (ub + lb) / (ub - lb);
323 *constant = -lb -
alpha * lb;
341 SCIPdebugMsg(
scip,
"-> %g * <child> %+g, local=%u branchcand=%u\n", *coefs, *constant, *islocal, *branchcand);
373 assert(bounds.inf >= 0.0);
380 childbounds = childrenbounds[0];
406 *hashkey ^= childrenhashes[0];
438 if( childinf >= 0.0 )
439 childcurv[0] = exprcurvature;
440 else if( childsup <= 0.0 )
470 if( childbounds.
sup <= 0.0 )
472 else if( childbounds.
inf >= 0.0 )
533 void* ownercreatedata
#define SCIP_INTERVAL_INFINITY
private functions to work with algebraic expressions
static SCIP_RETCODE computeCutsAbs(SCIP *scip, SCIP_INTERVAL bounds, SCIP_Bool overestimate, SCIP_Real **coefs, SCIP_Real *constant, int *nreturned)
#define EXPRHDLR_PRECEDENCE
absolute expression handler
constant value expression handler
SCIP_Bool SCIPisExprAbs(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPcreateExprAbs(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprValue(SCIP *scip, SCIP_EXPR **expr, SCIP_Real value, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPincludeExprhdlrAbs(SCIP *scip)
const char * SCIPexprhdlrGetName(SCIP_EXPRHDLR *exprhdlr)
void SCIPexprhdlrSetIntegrality(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetCurvature(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetParse(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetIntEval(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetMonotonicity(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetReverseProp(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetHash(SCIP_EXPRHDLR *exprhdlr,)
SCIP_RETCODE SCIPincludeExprhdlr(SCIP *scip, SCIP_EXPRHDLR **exprhdlr, const char *name, const char *desc, unsigned int precedence, SCIP_DECL_EXPREVAL((*eval)), SCIP_EXPRHDLRDATA *data)
void SCIPexprhdlrSetSimplify(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetDiff(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRBWDIFF((*bwdiff)), SCIP_DECL_EXPRFWDIFF((*fwdiff)),)
void SCIPexprhdlrSetCopyFreeHdlr(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRCOPYHDLR((*copyhdlr)),)
SCIP_EXPRHDLR * SCIPfindExprhdlr(SCIP *scip, const char *name)
void SCIPexprhdlrSetEstimate(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRINITESTIMATES((*initestimates)),)
SCIP_RETCODE SCIPcreateExpr(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPRHDLR *exprhdlr, SCIP_EXPRDATA *exprdata, int nchildren, SCIP_EXPR **children, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
int SCIPexprGetNChildren(SCIP_EXPR *expr)
SCIP_Bool SCIPexprIsIntegral(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprValue(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPreleaseExpr(SCIP *scip, SCIP_EXPR **expr)
SCIP_RETCODE SCIPparseExpr(SCIP *scip, SCIP_EXPR **expr, const char *exprstr, const char **finalpos, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_Real SCIPgetValueExprValue(SCIP_EXPR *expr)
SCIP_Real SCIPexprGetEvalValue(SCIP_EXPR *expr)
SCIP_EXPR ** SCIPexprGetChildren(SCIP_EXPR *expr)
SCIP_INTERVAL SCIPexprGetActivity(SCIP_EXPR *expr)
void SCIPcaptureExpr(SCIP_EXPR *expr)
SCIP_RETCODE SCIPevalExprActivity(SCIP *scip, SCIP_EXPR *expr)
SCIP_EXPRCURV SCIPexprcurvNegate(SCIP_EXPRCURV curvature)
SCIP_EXPRHDLR * SCIPexprGetHdlr(SCIP_EXPR *expr)
SCIP_Real SCIPintervalGetInf(SCIP_INTERVAL interval)
void SCIPintervalUnify(SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalAbs(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
void SCIPintervalIntersect(SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
SCIP_Bool SCIPintervalIsEmpty(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
struct SCIP_Interval SCIP_INTERVAL
SCIP_Real SCIPintervalGetSup(SCIP_INTERVAL interval)
void SCIPintervalSetEmpty(SCIP_INTERVAL *resultant)
SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
assert(minobj< SCIPgetCutoffbound(scip))
struct SCIP_Expr SCIP_EXPR
#define SCIP_DECL_EXPR_OWNERCREATE(x)
#define SCIP_DECL_EXPRREVERSEPROP(x)
#define SCIP_DECL_EXPRINITESTIMATES(x)
#define SCIP_DECL_EXPRCURVATURE(x)
#define SCIP_DECL_EXPRPARSE(x)
#define SCIP_DECL_EXPRBWDIFF(x)
#define SCIP_DECL_EXPRINTEVAL(x)
#define SCIP_DECL_EXPRMONOTONICITY(x)
struct SCIP_Exprhdlr SCIP_EXPRHDLR
#define SCIP_DECL_EXPRSIMPLIFY(x)
#define SCIP_DECL_EXPREVAL(x)
#define SCIP_DECL_EXPRHASH(x)
#define SCIP_DECL_EXPRCOPYHDLR(x)
#define SCIP_DECL_EXPRINTEGRALITY(x)
#define SCIP_DECL_EXPRESTIMATE(x)
enum SCIP_Retcode SCIP_RETCODE