handler for -x*log(x) expressions
Definition in file expr_entropy.c.
#include "scip/expr_entropy.h"
#include "scip/expr_value.h"
#include "scip/expr.h"
#include <string.h>
Go to the source code of this file.
Macros | |
#define | EXPRHDLR_NAME "entropy" |
#define | EXPRHDLR_DESC "entropy expression (-x*log(x))" |
#define | EXPRHDLR_PRECEDENCE 81000 |
#define | EXPRHDLR_HASHKEY SCIPcalcFibHash(7477.0) |
#define EXPRHDLR_NAME "entropy" |
Definition at line 44 of file expr_entropy.c.
Definition at line 45 of file expr_entropy.c.
#define EXPRHDLR_PRECEDENCE 81000 |
Definition at line 46 of file expr_entropy.c.
#define EXPRHDLR_HASHKEY SCIPcalcFibHash(7477.0) |
Definition at line 47 of file expr_entropy.c.
|
static |
helper function for reverseProp() which returns an x* in [xmin,xmax] s.t. the distance -x*log(x) and a given target value is minimized; the function assumes that -x*log(x) is monotone on [xmin,xmax];
scip | SCIP data structure |
xmin | smallest possible x |
xmax | largest possible x |
increasing | -x*log(x) is increasing or decreasing on [xmin,xmax] |
targetval | target value |
Definition at line 61 of file expr_entropy.c.
References assert(), i, SCIP_Bool, SCIP_INVALID, SCIP_Real, SCIPisEQ(), SCIPisGE(), SCIPisLE(), SCIPisLT(), and x.
Referenced by reverseProp().
|
static |
helper function for reverse propagation; needed for proper unittest
scip | SCIP data structure |
exprinterval | bounds on the expression |
childinterval | bounds on the interval of the child |
interval | resulting interval |
Definition at line 112 of file expr_entropy.c.
References assert(), FALSE, MAX, MIN, NULL, reversePropBinarySearch(), SCIP_INTERVAL_INFINITY, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPepsilon(), SCIPintervalEntropy(), SCIPintervalGetInf(), SCIPintervalGetSup(), SCIPintervalIntersect(), SCIPintervalIsEmpty(), SCIPintervalIsSubsetEQ(), SCIPintervalSet(), SCIPintervalSetBounds(), SCIPintervalSetEmpty(), SCIPisGT(), and TRUE.
Referenced by SCIP_DECL_EXPRREVERSEPROP().
|
static |
expression handler copy callback
Definition at line 233 of file expr_entropy.c.
References SCIP_CALL, SCIP_OKAY, and SCIPincludeExprhdlrEntropy().
|
static |
simplifies an entropy expression
Definition at line 242 of file expr_entropy.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcaptureExpr(), SCIPcreateExprValue(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetValueExprValue(), and SCIPisExprValue().
|
static |
expression data copy callback
Definition at line 287 of file expr_entropy.c.
References assert(), NULL, SCIP_OKAY, and SCIPexprGetData().
|
static |
expression data free callback
Definition at line 299 of file expr_entropy.c.
References assert(), NULL, SCIP_OKAY, and SCIPexprSetData().
|
static |
expression parse callback
Definition at line 309 of file expr_entropy.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateExprEntropy(), SCIPparseExpr(), SCIPreleaseExpr(), and TRUE.
|
static |
expression (point-) evaluation callback
Definition at line 334 of file expr_entropy.c.
References assert(), NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetEvalValue(), and SCIPexprGetNChildren().
|
static |
expression derivative evaluation callback
Definition at line 365 of file expr_entropy.c.
References assert(), NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetEvalValue(), SCIPexprGetNChildren(), and SCIPisExprValue().
|
static |
expression interval evaluation callback
Definition at line 392 of file expr_entropy.c.
References assert(), NULL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetNChildren(), SCIPintervalEntropy(), SCIPintervalIsEmpty(), and SCIPintervalSetEmpty().
|
static |
expression estimator callback
Definition at line 412 of file expr_entropy.c.
References assert(), EXPRHDLR_NAME, FALSE, NULL, REALABS, SCIP_OKAY, SCIP_Real, SCIPepsilon(), SCIPexprGetHdlr(), SCIPexprhdlrGetName(), SCIPisEQ(), SCIPisInfinity(), SCIPisPositive(), SCIPisZero(), and TRUE.
|
static |
initial estimates callback
Definition at line 486 of file expr_entropy.c.
References assert(), EXPRHDLR_NAME, FALSE, i, MAX, NULL, SCIP_Bool, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPepsilon(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetName(), SCIPisEQ(), SCIPisGE(), SCIPisInfinity(), SCIPisLE(), and TRUE.
|
static |
expression reverse propagation callback
Definition at line 551 of file expr_entropy.c.
References assert(), SCIP_Interval::inf, NULL, reverseProp(), SCIP_CALL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIPexprGetNChildren(), and SCIPintervalIsEmpty().
|
static |
entropy hash callback
Definition at line 572 of file expr_entropy.c.
References assert(), EXPRHDLR_HASHKEY, NULL, SCIP_OKAY, and SCIPexprGetNChildren().
|
static |
expression curvature detection callback
Definition at line 587 of file expr_entropy.c.
References assert(), FALSE, NULL, SCIP_EXPRCURV_CONCAVE, SCIP_OKAY, SCIPexprGetNChildren(), and TRUE.
|
static |
expression monotonicity detection callback
Definition at line 609 of file expr_entropy.c.
References assert(), SCIP_Interval::inf, NULL, result, SCIP_CALL, SCIP_MONOTONE_DEC, SCIP_MONOTONE_INC, SCIP_MONOTONE_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPevalExprActivity(), SCIPexprGetActivity(), SCIPexprGetChildren(), and SCIP_Interval::sup.