Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

absolute expression handler

Author
Stefan Vigerske
Benjamin Mueller

Definition in file expr_abs.c.

#include <string.h>
#include "scip/expr_value.h"
#include "scip/expr_abs.h"
#include "scip/expr.h"

Go to the source code of this file.

Macros

#define EXPRHDLR_NAME   "abs"
 
#define EXPRHDLR_DESC   "absolute value expression"
 
#define EXPRHDLR_PRECEDENCE   70000
 
#define EXPRHDLR_HASHKEY   SCIPcalcFibHash(7187.0)
 

Functions

static SCIP_RETCODE computeCutsAbs (SCIP *scip, SCIP_INTERVAL bounds, SCIP_Bool overestimate, SCIP_Real **coefs, SCIP_Real *constant, int *nreturned)
 
static SCIP_DECL_EXPRSIMPLIFY (simplifyAbs)
 
static SCIP_DECL_EXPRCOPYHDLR (copyhdlrAbs)
 
static SCIP_DECL_EXPRPARSE (parseAbs)
 
static SCIP_DECL_EXPREVAL (evalAbs)
 
static SCIP_DECL_EXPRBWDIFF (bwdiffAbs)
 
static SCIP_DECL_EXPRINTEVAL (intevalAbs)
 
static SCIP_DECL_EXPRESTIMATE (estimateAbs)
 
static SCIP_DECL_EXPRINITESTIMATES (initEstimatesAbs)
 
static SCIP_DECL_EXPRREVERSEPROP (reversepropAbs)
 
static SCIP_DECL_EXPRHASH (hashAbs)
 
static SCIP_DECL_EXPRCURVATURE (curvatureAbs)
 
static SCIP_DECL_EXPRMONOTONICITY (monotonicityAbs)
 
static SCIP_DECL_EXPRINTEGRALITY (integralityAbs)
 
SCIP_RETCODE SCIPincludeExprhdlrAbs (SCIP *scip)
 
SCIP_RETCODE SCIPcreateExprAbs (SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
 
SCIP_Bool SCIPisExprAbs (SCIP *scip, SCIP_EXPR *expr)
 

Macro Definition Documentation

◆ EXPRHDLR_NAME

#define EXPRHDLR_NAME   "abs"

Definition at line 40 of file expr_abs.c.

◆ EXPRHDLR_DESC

#define EXPRHDLR_DESC   "absolute value expression"

Definition at line 41 of file expr_abs.c.

◆ EXPRHDLR_PRECEDENCE

#define EXPRHDLR_PRECEDENCE   70000

Definition at line 42 of file expr_abs.c.

◆ EXPRHDLR_HASHKEY

#define EXPRHDLR_HASHKEY   SCIPcalcFibHash(7187.0)

Definition at line 43 of file expr_abs.c.

Function Documentation

◆ computeCutsAbs()

static SCIP_RETCODE computeCutsAbs ( SCIP scip,
SCIP_INTERVAL  bounds,
SCIP_Bool  overestimate,
SCIP_Real **  coefs,
SCIP_Real constant,
int *  nreturned 
)
static

computes both tangent underestimates and secant

! [SnippetExprInitestimatesAbs]

! [SnippetExprInitestimatesAbs]

Parameters
scipSCIP data structure
boundsbounds of child
overestimatewhether the expression shall be overestimated or underestimated
coefsbuffer to store coefficients of computed estimators
constantbuffer to store constant of computed estimators
nreturnedbuffer to store number of estimators that have been computed

Definition at line 55 of file expr_abs.c.

References SCIP_Interval::inf, NULL, REALABS, SCIP_OKAY, SCIP_Real, SCIPisEQ(), SCIPisInfinity(), SCIPisNegative(), SCIPisPositive(), and SCIP_Interval::sup.

Referenced by SCIP_DECL_EXPRINITESTIMATES().

◆ SCIP_DECL_EXPRSIMPLIFY()

static SCIP_DECL_EXPRSIMPLIFY ( simplifyAbs  )
static

simplifies an abs expression

Evaluates the absolute value function when its child is a value expression.

TODO: abs(*) = * if * >= 0 or - * if * < 0

Definition at line 142 of file expr_abs.c.

References NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIPcaptureExpr(), SCIPcreateExprValue(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetValueExprValue(), and SCIPisExprValue().

◆ SCIP_DECL_EXPRCOPYHDLR()

static SCIP_DECL_EXPRCOPYHDLR ( copyhdlrAbs  )
static

Definition at line 171 of file expr_abs.c.

References SCIP_CALL, SCIP_OKAY, and SCIPincludeExprhdlrAbs().

◆ SCIP_DECL_EXPRPARSE()

static SCIP_DECL_EXPRPARSE ( parseAbs  )
static

Definition at line 179 of file expr_abs.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateExprAbs(), SCIPparseExpr(), SCIPreleaseExpr(), and TRUE.

◆ SCIP_DECL_EXPREVAL()

static SCIP_DECL_EXPREVAL ( evalAbs  )
static

expression point evaluation callback

Definition at line 203 of file expr_abs.c.

References NULL, REALABS, SCIP_INVALID, SCIP_OKAY, SCIPexprGetChildren(), SCIPexprGetEvalValue(), and SCIPexprGetNChildren().

◆ SCIP_DECL_EXPRBWDIFF()

static SCIP_DECL_EXPRBWDIFF ( bwdiffAbs  )
static

expression derivative evaluation callback

Definition at line 217 of file expr_abs.c.

References NULL, SCIP_INVALID, SCIP_OKAY, SCIPexprGetChildren(), SCIPexprGetEvalValue(), SCIPexprGetHdlr(), and SCIPexprhdlrGetName().

◆ SCIP_DECL_EXPRINTEVAL()

static SCIP_DECL_EXPRINTEVAL ( intevalAbs  )
static

◆ SCIP_DECL_EXPRESTIMATE()

static SCIP_DECL_EXPRESTIMATE ( estimateAbs  )
static

expression estimator callback

! [SnippetExprEstimateAbs]

! [SnippetExprEstimateAbs]

Definition at line 255 of file expr_abs.c.

References EXPRHDLR_NAME, FALSE, NULL, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetName(), SCIPisNegative(), SCIPisPositive(), SCIPisRelEQ(), and TRUE.

◆ SCIP_DECL_EXPRINITESTIMATES()

static SCIP_DECL_EXPRINITESTIMATES ( initEstimatesAbs  )
static

expression estimate initialization callback

Definition at line 350 of file expr_abs.c.

References computeCutsAbs(), EXPRHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPexprGetHdlr(), SCIPexprGetNChildren(), and SCIPexprhdlrGetName().

◆ SCIP_DECL_EXPRREVERSEPROP()

static SCIP_DECL_EXPRREVERSEPROP ( reversepropAbs  )
static

expression reverse propagation callback

! [SnippetExprReversepropAbs]

! [SnippetExprReversepropAbs]

Definition at line 364 of file expr_abs.c.

References SCIP_Interval::inf, NULL, SCIP_OKAY, SCIPexprGetNChildren(), SCIPintervalIntersect(), SCIPintervalSetBounds(), SCIPintervalUnify(), and SCIP_Interval::sup.

◆ SCIP_DECL_EXPRHASH()

static SCIP_DECL_EXPRHASH ( hashAbs  )
static

expression hash callback

Definition at line 397 of file expr_abs.c.

References EXPRHDLR_HASHKEY, NULL, SCIP_OKAY, and SCIPexprGetNChildren().

◆ SCIP_DECL_EXPRCURVATURE()

static SCIP_DECL_EXPRCURVATURE ( curvatureAbs  )
static

expression curvature detection callback

! [SnippetExprCurvatureAbs]

! [SnippetExprCurvatureAbs]

Definition at line 413 of file expr_abs.c.

References FALSE, NULL, SCIP_CALL, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPevalExprActivity(), SCIPexprcurvNegate(), SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPintervalGetInf(), SCIPintervalGetSup(), and TRUE.

◆ SCIP_DECL_EXPRMONOTONICITY()

static SCIP_DECL_EXPRMONOTONICITY ( monotonicityAbs  )
static

expression monotonicity detection callback

! [SnippetExprMonotonicityAbs]

! [SnippetExprMonotonicityAbs]

Definition at line 453 of file expr_abs.c.

References SCIP_Interval::inf, NULL, SCIP_CALL, SCIP_MONOTONE_DEC, SCIP_MONOTONE_INC, SCIP_MONOTONE_UNKNOWN, SCIP_OKAY, SCIPevalExprActivity(), SCIPexprGetActivity(), SCIPexprGetChildren(), and SCIP_Interval::sup.

◆ SCIP_DECL_EXPRINTEGRALITY()

static SCIP_DECL_EXPRINTEGRALITY ( integralityAbs  )
static

expression integrality detection callback

Definition at line 483 of file expr_abs.c.

References NULL, SCIP_OKAY, SCIPexprGetChildren(), SCIPexprGetNChildren(), and SCIPexprIsIntegral().