SCIP Doxygen Documentation
Loading...
Searching...
No Matches

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

◆ EXPRHDLR_DESC

◆ EXPRHDLR_PRECEDENCE

◆ EXPRHDLR_HASHKEY

Function Documentation

◆ computeCutsAbs()

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 alpha, assert(), SCIP_Interval::inf, NULL, REALABS, SCIP_Bool, SCIP_OKAY, SCIP_Real, SCIPisEQ(), SCIPisInfinity(), SCIPisNegative(), SCIPisPositive(), and SCIP_Interval::sup.

Referenced by SCIP_DECL_EXPRINITESTIMATES().

◆ SCIP_DECL_EXPRSIMPLIFY()

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 assert(), NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIPcaptureExpr(), SCIPcreateExprValue(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetValueExprValue(), and SCIPisExprValue().

◆ SCIP_DECL_EXPRCOPYHDLR()

SCIP_DECL_EXPRCOPYHDLR ( copyhdlrAbs )
static

Definition at line 171 of file expr_abs.c.

References SCIP_CALL, SCIP_OKAY, and SCIPincludeExprhdlrAbs().

◆ SCIP_DECL_EXPRPARSE()

SCIP_DECL_EXPRPARSE ( parseAbs )
static

◆ SCIP_DECL_EXPREVAL()

SCIP_DECL_EXPREVAL ( evalAbs )
static

expression point evaluation callback

Definition at line 203 of file expr_abs.c.

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

◆ SCIP_DECL_EXPRBWDIFF()

SCIP_DECL_EXPRBWDIFF ( bwdiffAbs )
static

expression derivative evaluation callback

Definition at line 217 of file expr_abs.c.

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

◆ SCIP_DECL_EXPRINTEVAL()

SCIP_DECL_EXPRINTEVAL ( intevalAbs )
static

◆ SCIP_DECL_EXPRESTIMATE()

SCIP_DECL_EXPRESTIMATE ( estimateAbs )
static

expression estimator callback

! [SnippetExprEstimateAbs]

! [SnippetExprEstimateAbs]

Definition at line 255 of file expr_abs.c.

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

◆ SCIP_DECL_EXPRINITESTIMATES()

SCIP_DECL_EXPRINITESTIMATES ( initEstimatesAbs )
static

expression estimate initialization callback

Definition at line 350 of file expr_abs.c.

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

◆ SCIP_DECL_EXPRREVERSEPROP()

SCIP_DECL_EXPRREVERSEPROP ( reversepropAbs )
static

expression reverse propagation callback

! [SnippetExprReversepropAbs]

! [SnippetExprReversepropAbs]

Definition at line 364 of file expr_abs.c.

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

◆ SCIP_DECL_EXPRHASH()

SCIP_DECL_EXPRHASH ( hashAbs )
static

expression hash callback

Definition at line 397 of file expr_abs.c.

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

◆ SCIP_DECL_EXPRCURVATURE()

SCIP_DECL_EXPRCURVATURE ( curvatureAbs )
static

◆ SCIP_DECL_EXPRMONOTONICITY()

SCIP_DECL_EXPRMONOTONICITY ( monotonicityAbs )
static

expression monotonicity detection callback

! [SnippetExprMonotonicityAbs]

! [SnippetExprMonotonicityAbs]

Definition at line 453 of file expr_abs.c.

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

◆ SCIP_DECL_EXPRINTEGRALITY()

SCIP_DECL_EXPRINTEGRALITY ( integralityAbs )
static

expression integrality detection callback

Definition at line 483 of file expr_abs.c.

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