Detailed Description
power expression handler
Definition in file expr_pow.c.
#include <string.h>
#include "scip/expr_pow.h"
#include "scip/pub_expr.h"
#include "scip/expr_value.h"
#include "scip/expr_product.h"
#include "scip/expr_sum.h"
#include "scip/expr_exp.h"
#include "scip/expr_abs.h"
#include "symmetry/struct_symmetry.h"
Go to the source code of this file.
Macros | |
#define | POWEXPRHDLR_NAME "pow" |
#define | POWEXPRHDLR_DESC "power expression" |
#define | POWEXPRHDLR_PRECEDENCE 55000 |
#define | POWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.0) |
#define | SIGNPOWEXPRHDLR_NAME "signpower" |
#define | SIGNPOWEXPRHDLR_DESC "signed power expression" |
#define | SIGNPOWEXPRHDLR_PRECEDENCE 56000 |
#define | SIGNPOWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.1) |
#define | INITLPMAXPOWVAL 1e+06 |
#define | SIGN(x) ((x) >= 0.0 ? 1.0 : -1.0) |
#define | SIGNPOW_ROOTS_KNOWN 10 |
Variables | |
static SCIP_Real | signpow_roots [SIGNPOW_ROOTS_KNOWN+1] |
Macro Definition Documentation
◆ POWEXPRHDLR_NAME
#define POWEXPRHDLR_NAME "pow" |
Definition at line 50 of file expr_pow.c.
◆ POWEXPRHDLR_DESC
#define POWEXPRHDLR_DESC "power expression" |
Definition at line 51 of file expr_pow.c.
◆ POWEXPRHDLR_PRECEDENCE
#define POWEXPRHDLR_PRECEDENCE 55000 |
Definition at line 52 of file expr_pow.c.
◆ POWEXPRHDLR_HASHKEY
#define POWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.0) |
Definition at line 53 of file expr_pow.c.
◆ SIGNPOWEXPRHDLR_NAME
#define SIGNPOWEXPRHDLR_NAME "signpower" |
Definition at line 55 of file expr_pow.c.
◆ SIGNPOWEXPRHDLR_DESC
#define SIGNPOWEXPRHDLR_DESC "signed power expression" |
Definition at line 56 of file expr_pow.c.
◆ SIGNPOWEXPRHDLR_PRECEDENCE
#define SIGNPOWEXPRHDLR_PRECEDENCE 56000 |
Definition at line 57 of file expr_pow.c.
◆ SIGNPOWEXPRHDLR_HASHKEY
#define SIGNPOWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.1) |
Definition at line 58 of file expr_pow.c.
◆ INITLPMAXPOWVAL
#define INITLPMAXPOWVAL 1e+06 |
maximal allowed absolute value of power expression at bound, used for adjusting bounds in the convex case in initestimates
Definition at line 61 of file expr_pow.c.
◆ SIGN
sign of a value (-1 or +1)
0.0 has sign +1 here (shouldn't matter, though)
Definition at line 71 of file expr_pow.c.
◆ SIGNPOW_ROOTS_KNOWN
#define SIGNPOW_ROOTS_KNOWN 10 |
up to which (integer) exponents precomputed roots have been stored
Definition at line 73 of file expr_pow.c.
Function Documentation
◆ computeSignpowerRoot()
|
static |
computes positive root of the polynomial (n-1) y^n + n y^(n-1) - 1 for n > 1
- Parameters
-
scip SCIP data structure root buffer where to store computed root exponent exponent n
Definition at line 117 of file expr_pow.c.
References NULL, SCIP_ERROR, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPerrorMessage, SCIPfloor(), SCIPisEQ(), SCIPisIntegral(), SCIPisZero(), signpow_roots, and SIGNPOW_ROOTS_KNOWN.
Referenced by addSignpowerRefpoints(), buildPowEstimator(), SCIP_DECL_EXPRESTIMATE(), and SCIP_DECL_EXPRINITESTIMATES().
◆ computeHyperbolaRoot()
|
static |
computes negative root of the polynomial (n-1) y^n - n y^(n-1) + 1 for n < -1
- Parameters
-
scip SCIP data structure root buffer where to store computed root exponent exponent n
Definition at line 185 of file expr_pow.c.
References NULL, SCIP_ERROR, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPerrorMessage, and SCIPisZero().
Referenced by buildPowEstimator().
◆ createData()
|
static |
creates expression data
- Parameters
-
scip SCIP data structure exprdata pointer where to store expression data exponent exponent of the power expression
Definition at line 231 of file expr_pow.c.
References NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, and SCIPallocBlockMemory.
Referenced by SCIP_DECL_EXPRCOPYDATA(), SCIPcreateExprPow(), and SCIPcreateExprSignpower().
◆ computeTangent()
|
static |
computes a tangent at a reference point by linearization
for a normal power, linearization in xref is xref^exponent + exponent * xref^(exponent-1) (x - xref) = (1-exponent) * xref^exponent + exponent * xref^(exponent-1) * x
for a signpower, linearization is the same if xref is positive for xref negative it is -(-xref)^exponent + exponent * (-xref)^(exponent-1) (x-xref) = (1-exponent) * (-xref)^(exponent-1) * xref + exponent * (-xref)^(exponent-1) * x
- Parameters
-
scip SCIP data structure signpower are we signpower or normal power exponent exponent xref reference point where to linearize constant buffer to store constant term of secant slope buffer to store slope of secant success buffer to store whether secant could be computed
Definition at line 257 of file expr_pow.c.
References EPSISINT, FALSE, NULL, REALABS, SCIP_Real, SCIPisFinite, SCIPisNegative(), and TRUE.
Referenced by estimateHyperbolaMixed(), estimateHyperbolaPositive(), estimateParabola(), estimateSignedpower(), and SCIPestimateRoot().
◆ computeSecant()
|
static |
computes a secant between lower and upper bound
secant is xlb^exponent + (xub^exponent - xlb^exponent) / (xub - xlb) * (x - xlb) = xlb^exponent - slope * xlb + slope * x with slope = (xub^exponent - xlb^exponent) / (xub - xlb) same if signpower
- Parameters
-
scip SCIP data structure signpower are we signpower or normal power exponent exponent xlb lower bound on x xub upper bound on x constant buffer to store constant term of secant slope buffer to store slope of secant success buffer to store whether secant could be computed
Definition at line 306 of file expr_pow.c.
References EPSISINT, FALSE, NULL, REALABS, SCIP_Real, SCIPisEQ(), SCIPisFeasEQ(), SCIPisFinite, SCIPisInfinity(), SIGN, and TRUE.
Referenced by estimateHyperbolaMixed(), estimateHyperbolaPositive(), estimateParabola(), estimateSignedpower(), and SCIPestimateRoot().
◆ estimateParabola()
|
static |
Separation for parabola
- even positive powers: x^2, x^4, x^6 with x arbitrary, or
- positive powers > 1: x^1.5, x^2.5 with x >= 0
100 +--------------------------------------------------------------------+ |* + + + *| 90 |** x**2 ********| | * * | 80 |-+* *+-| | ** ** | 70 |-+ * * +-| | ** ** | 60 |-+ * * +-| | ** ** | 50 |-+ * * +-| | ** ** | 40 |-+ * * +-| | ** ** | 30 |-+ ** ** +-| | ** ** | 20 |-+ ** ** +-| | *** *** | 10 |-+ *** *** +-| | + ***** + ***** + | 0 +--------------------------------------------------------------------+ -10 -5 0 5 10
- Parameters
-
scip SCIP data structure exponent exponent overestimate should the power be overestimated? xlb lower bound on x xub upper bound on x xref reference point (where to linearize) constant buffer to store constant term of estimator slope buffer to store slope of estimator islocal buffer to store whether estimator only locally valid, that is, it depends on given bounds success buffer to store whether estimator could be computed
Definition at line 486 of file expr_pow.c.
References computeSecant(), computeTangent(), EPSISINT, FALSE, NULL, and TRUE.
Referenced by buildPowEstimator(), SCIP_DECL_EXPRESTIMATE(), and SCIP_DECL_EXPRINITESTIMATES().
◆ estimateSignedpower()
|
static |
Separation for signpower
- odd positive powers, x^3, x^5, x^7
- sign(x)|x|^n for n > 1
- lower bound on x is negative (otherwise one should use separation for parabola)
100 +--------------------------------------------------------------------+ | + + + **| | x*abs(x) ******* | | ** | | ** | 50 |-+ *** +-| | *** | | *** | | ***** | | ***** | 0 |-+ **************** +-| | ***** | | ***** | | *** | | *** | -50 |-+ *** +-| | ** | | ** | | ** | |** + + + | -100 +--------------------------------------------------------------------+ -10 -5 0 5 10
- Parameters
-
scip SCIP data structure exponent exponent root positive root of the polynomial (n-1) y^n + n y^(n-1) - 1, if xubglobal > 0 overestimate should the power be overestimated? xlb lower bound on x, assumed to be non-positive xub upper bound on x xref reference point (where to linearize) xlbglobal global lower bound on x xubglobal global upper bound on x constant buffer to store constant term of estimator slope buffer to store slope of estimator islocal buffer to store whether estimator only locally valid, that is, it depends on given bounds branchcand buffer to indicate whether estimator would improve by branching on it success buffer to store whether estimator could be computed
Definition at line 552 of file expr_pow.c.
References computeSecant(), computeTangent(), FALSE, NULL, SCIP_Real, SCIPisPositive(), and TRUE.
Referenced by buildPowEstimator(), SCIP_DECL_EXPRESTIMATE(), and SCIP_DECL_EXPRINITESTIMATES().
◆ estimateHyperbolaPositive()
|
static |
Separation for positive hyperbola
- x^-2, x^-4 with x arbitrary
- x^-0.5, x^-1, x^-1.5, x^-3, x^-5 with x >= 0
5 +----------------------------------------------------------------------+ | + * +* + | | * * x**(-2) ******* | 4 |-+ * * +-| | * * | | * * | | * * | 3 |-+ * * +-| | * * | | * * | 2 |-+ * * +-| | * * | | * * | 1 |-+ * * +-| | * * | | ** ** | | ********** ********** | 0 |******************* *******************| | | | + + + | -1 +----------------------------------------------------------------------+ -10 -5 0 5 10
- Parameters
-
scip SCIP data structure exponent exponent root negative root of the polynomial (n-1) y^n - n y^(n-1) + 1, if x has mixed sign (w.r.t. global bounds?) and underestimating overestimate should the power be overestimated? xlb lower bound on x xub upper bound on x xref reference point (where to linearize) xlbglobal global lower bound on x xubglobal global upper bound on x constant buffer to store constant term of estimator slope buffer to store slope of estimator islocal buffer to store whether estimator only locally valid, that is, it depends on given bounds branchcand buffer to indicate whether estimator would improve by branching on it success buffer to store whether estimator could be computed
Definition at line 700 of file expr_pow.c.
References computeSecant(), computeTangent(), EPSISINT, estimateHyperbolaPositive(), FALSE, MIN, NULL, SCIPisInfinity(), SCIPisZero(), and TRUE.
Referenced by buildPowEstimator(), and estimateHyperbolaPositive().
◆ estimateHyperbolaMixed()
|
static |
Separation for mixed-sign hyperbola
- x^-1, x^-3, x^-5 without x >= 0 (either x arbitrary or x negative)
+----------------------------------------------------------------------+ | + * + | 4 |-+ * x**(-1) *******-| | * | | * | | * | 2 |-+ * +-| | * | | ** | | ********* | 0 |********************* *********************| | ********* | | ** | | * | -2 |-+ * +-| | * | | * | | * | -4 |-+ * +-| | + *+ + | +----------------------------------------------------------------------+ -10 -5 0 5 10
- Parameters
-
scip SCIP data structure exponent exponent overestimate should the power be overestimated? xlb lower bound on x xub upper bound on x xref reference point (where to linearize) xlbglobal global lower bound on x xubglobal global upper bound on x constant buffer to store constant term of estimator slope buffer to store slope of estimator islocal buffer to store whether estimator only locally valid, that is, it depends on given bounds branchcand buffer to indicate whether estimator would improve by branching on it success buffer to store whether estimator could be computed
Definition at line 913 of file expr_pow.c.
References computeSecant(), computeTangent(), EPSISINT, FALSE, NULL, SCIPisInfinity(), SCIPisZero(), and TRUE.
Referenced by buildPowEstimator().
◆ buildPowEstimator()
|
static |
builds an estimator for a power function
- Parameters
-
scip SCIP data structure exprdata expression data overestimate is this an overestimator? childlb local lower bound on the child childub local upper bound on the child childglb global lower bound on the child childgub global upper bound on the child childintegral whether child is integral refpoint reference point exponent esponent coef pointer to store the coefficient of the estimator constant pointer to store the constant of the estimator success pointer to store whether the estimator was built successfully islocal pointer to store whether the estimator is valid w.r.t. local bounds only branchcand pointer to indicate whether to consider child for branching (initialized to TRUE)
Definition at line 991 of file expr_pow.c.
References computeHyperbolaRoot(), computeSignpowerRoot(), EPSISINT, estimateHyperbolaMixed(), estimateHyperbolaPositive(), estimateParabola(), estimateSignedpower(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIPaddSquareLinearization(), SCIPaddSquareSecant(), SCIPestimateRoot(), SCIPisInfinity(), and TRUE.
Referenced by SCIP_DECL_EXPRESTIMATE(), and SCIP_DECL_EXPRINITESTIMATES().
◆ addTangentRefpoints()
|
static |
fills an array of reference points for estimating on the convex side
- Parameters
-
scip SCIP data structure exponent exponent of the power expression lb lower bound on the child variable ub upper bound on the child variable refpoints array to store the reference points
Definition at line 1124 of file expr_pow.c.
References INITLPMAXPOWVAL, MAX, MIN, NULL, REALABS, SCIP_Real, and SCIPisInfinity().
Referenced by chooseRefpointsPow(), and SCIP_DECL_EXPRINITESTIMATES().
◆ addSignpowerRefpoints()
|
static |
fills an array of reference points for sign(x)*abs(x)^n or x^n (n odd), where x has mixed signs
The reference points are: the lower and upper bounds (one for secant and one for tangent); and for the second tangent, the point on the convex part of the function between the point deciding between tangent and secant, and the corresponding bound
- Parameters
-
scip SCIP data structure exprdata expression data lb lower bound on the child variable ub upper bound on the child variable exponent exponent underestimate are the refpoints for an underestimator refpoints array to store the reference points
Definition at line 1162 of file expr_pow.c.
References computeSignpowerRoot(), NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, and SCIPisInfinity().
Referenced by chooseRefpointsPow(), and SCIP_DECL_EXPRINITESTIMATES().
◆ chooseRefpointsPow()
|
static |
choose reference points for adding initestimates cuts for a power expression
- Parameters
-
scip SCIP data structure exprdata expression data lb lower bound on the child variable ub upper bound on the child variable refpointsunder array to store reference points for underestimators refpointsover array to store reference points for overestimators underestimate whether refpoints for underestimation are needed overestimate whether refpoints for overestimation are needed
Definition at line 1217 of file expr_pow.c.
References addSignpowerRefpoints(), addTangentRefpoints(), EPSISINT, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPisInfinity(), and TRUE.
Referenced by SCIP_DECL_EXPRINITESTIMATES().
◆ SCIP_DECL_EXPRCOMPARE()
|
static |
compares two power expressions
the order of two power (normal or signed) is base_1^expo_1 < base_2^expo_2 if and only if base_1 < base2 or, base_1 = base_2 and expo_1 < expo_2
! [SnippetExprComparePow]
! [SnippetExprComparePow]
Definition at line 1305 of file expr_pow.c.
References SCIP_Real, SCIPcompareExpr(), SCIPexprGetChildren(), and SCIPgetExponentExprPow().
◆ SCIP_DECL_EXPRSIMPLIFY() [1/2]
|
static |
simplifies a pow expression
Evaluates the power function when its child is a value expression
Definition at line 1328 of file expr_pow.c.
References EPSISINT, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPappendExprChild(), SCIPcaptureExpr(), SCIPcreateExprAbs(), SCIPcreateExprExp(), SCIPcreateExprPow(), SCIPcreateExprProduct(), SCIPcreateExprSum(), SCIPcreateExprValue(), SCIPdebugPrintf, SCIPepsilon(), SCIPexprGetChildren(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetData(), SCIPfreeBufferArray, SCIPgetCoefsExprSum(), SCIPgetConstantExprSum(), SCIPgetExponentExprPow(), SCIPgetValueExprValue(), SCIPgetVarExprVar(), SCIPisExprAbs(), SCIPisExprExp(), SCIPisExprPower(), SCIPisExprProduct(), SCIPisExprSum(), SCIPisExprValue(), SCIPisExprVar(), SCIPpowerExprSum(), SCIPreleaseExpr(), SCIPvarIsBinary(), and TRUE.
◆ SCIP_DECL_EXPRGETSYMDATA()
|
static |
expression callback to get information for symmetry detection
Definition at line 1764 of file expr_pow.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, and SCIPexprGetData().
◆ SCIP_DECL_EXPRCOPYHDLR() [1/2]
|
static |
expression handler copy callback
Definition at line 1787 of file expr_pow.c.
References SCIP_CALL, SCIP_OKAY, and SCIPincludeExprhdlrPow().
◆ SCIP_DECL_EXPRFREEHDLR()
|
static |
expression handler free callback
Definition at line 1796 of file expr_pow.c.
References NULL, SCIP_OKAY, and SCIPfreeBlockMemory.
◆ SCIP_DECL_EXPRCOPYDATA()
|
static |
expression data copy callback
Definition at line 1808 of file expr_pow.c.
References createData(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprGetData().
◆ SCIP_DECL_EXPRFREEDATA()
|
static |
expression data free callback
Definition at line 1827 of file expr_pow.c.
References NULL, SCIP_OKAY, SCIPexprGetData(), SCIPexprSetData(), and SCIPfreeBlockMemory.
◆ SCIP_DECL_EXPRPRINT() [1/2]
|
static |
expression print callback
! [SnippetExprPrintPow]
! [SnippetExprPrintPow]
Definition at line 1845 of file expr_pow.c.
References NULL, SCIP_EXPRITER_ENTEREXPR, SCIP_EXPRITER_LEAVEEXPR, SCIP_EXPRITER_VISITEDCHILD, SCIP_EXPRITER_VISITINGCHILD, SCIP_OKAY, SCIP_Real, SCIPgetExponentExprPow(), and SCIPinfoMessage().
◆ SCIP_DECL_EXPREVAL() [1/2]
|
static |
expression point evaluation callback
Definition at line 1889 of file expr_pow.c.
References NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetEvalValue(), SCIPexprGetNChildren(), SCIPgetExponentExprPow(), and SCIPisFinite.
◆ SCIP_DECL_EXPRFWDIFF()
|
static |
derivative evaluation callback
computes <gradient, children.dot> if expr is child^p, then computes p child^(p-1) dot(child)
Definition at line 1919 of file expr_pow.c.
References NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetDot(), SCIPexprGetEvalValue(), SCIPgetExponentExprPow(), and SCIPisExprValue().
◆ SCIP_DECL_EXPRBWFWDIFF()
|
static |
expression backward forward derivative evaluation callback
computes partial/partial child ( <gradient, children.dot> ) if expr is child^n, then computes n * (n - 1) child^(n-2) dot(child)
Definition at line 1952 of file expr_pow.c.
References NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetDot(), SCIPexprGetEvalValue(), SCIPgetExponentExprPow(), and SCIPisExprValue().
◆ SCIP_DECL_EXPRBWDIFF() [1/2]
|
static |
expression derivative evaluation callback
Definition at line 1981 of file expr_pow.c.
References NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetEvalValue(), SCIPgetExponentExprPow(), and SCIPisExprValue().
◆ SCIP_DECL_EXPRINTEVAL() [1/2]
|
static |
expression interval evaluation callback
Definition at line 2012 of file expr_pow.c.
References SCIP_Interval::inf, NULL, POWEXPRHDLR_NAME, SCIP_CALL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIP_Real, SCIP_VERBLEVEL_NONE, SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetData(), SCIPgetExponentExprPow(), SCIPgetVerbLevel(), SCIPinfoMessage(), SCIPintervalIsEmpty(), SCIPintervalPowerScalar(), SCIPintervalSetEmpty(), SCIPprintExpr(), SCIP_Interval::sup, and TRUE.
◆ SCIP_DECL_EXPRESTIMATE() [1/2]
|
static |
expression estimator callback
Definition at line 2084 of file expr_pow.c.
References buildPowEstimator(), EPSISINT, FALSE, MAX, NULL, POWEXPRHDLR_NAME, REALABS, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetName(), SCIPexprIsIntegral(), SCIPgetExponentExprPow(), SCIPisFeasZero(), SCIPisInfinity(), and TRUE.
◆ SCIP_DECL_EXPRREVERSEPROP() [1/2]
|
static |
expression reverse propagaton callback
Definition at line 2160 of file expr_pow.c.
References EPSISINT, SCIP_Interval::inf, NULL, POWEXPRHDLR_NAME, SCIP_CALL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIP_Real, SCIP_VERBLEVEL_NONE, SCIPdebugMsg, SCIPdebugMsgPrint, SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetData(), SCIPgetExponentExprPow(), SCIPgetVerbLevel(), SCIPinfoMessage(), SCIPintervalIsEmpty(), SCIPintervalIsEntire(), SCIPintervalPowerScalarInverse(), SCIPintervalSetBounds(), SCIPprintExpr(), SCIP_Interval::sup, and TRUE.
◆ SCIP_DECL_EXPRINITESTIMATES() [1/2]
|
static |
initial estimates callback for a power expression
Definition at line 2254 of file expr_pow.c.
References buildPowEstimator(), chooseRefpointsPow(), EPSISINT, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPR_MAXINITESTIMATES, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprIsIntegral(), SCIPisEQ(), SCIPisFeasZero(), SCIPisGE(), SCIPisLE(), and TRUE.
◆ SCIP_DECL_EXPRHASH() [1/2]
|
static |
expression hash callback
Definition at line 2340 of file expr_pow.c.
References NULL, POWEXPRHDLR_HASHKEY, SCIP_OKAY, and SCIPexprGetNChildren().
◆ SCIP_DECL_EXPRCURVATURE() [1/2]
|
static |
expression curvature detection callback
Definition at line 2357 of file expr_pow.c.
References NULL, SCIP_CALL, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPevalExprActivity(), SCIPexprcurvPowerInv(), SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetNChildren(), and SCIPgetExponentExprPow().
◆ SCIP_DECL_EXPRMONOTONICITY() [1/2]
|
static |
expression monotonicity detection callback
Definition at line 2386 of file expr_pow.c.
References EPSISINT, NULL, SCIP_Bool, SCIP_CALL, SCIP_MONOTONE_DEC, SCIP_MONOTONE_INC, SCIP_MONOTONE_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPevalExprActivity(), SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetExponentExprPow(), SCIPintervalGetInf(), and SCIPintervalGetSup().
◆ SCIP_DECL_EXPRINTEGRALITY()
|
static |
expression integrality detection callback
Definition at line 2449 of file expr_pow.c.
References EPSISINT, FALSE, NULL, SCIP_Bool, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPexprIsIntegral(), and SCIPgetExponentExprPow().
◆ SCIP_DECL_EXPRSIMPLIFY() [2/2]
|
static |
simplifies a signpower expression
Definition at line 2482 of file expr_pow.c.
References EPSISINT, NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcaptureExpr(), SCIPcreateExprExp(), SCIPcreateExprPow(), SCIPcreateExprProduct(), SCIPcreateExprSignpower(), SCIPcreateExprSum(), SCIPcreateExprValue(), SCIPdebugPrintf, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetCoefsExprSum(), SCIPgetConstantExprSum(), SCIPgetExponentExprPow(), SCIPgetValueExprValue(), SCIPgetVarExprVar(), SCIPisExprExp(), SCIPisExprPower(), SCIPisExprSum(), SCIPisExprValue(), SCIPisExprVar(), SCIPreleaseExpr(), SCIPvarIsBinary(), and SIGN.
◆ SCIP_DECL_EXPRCOPYHDLR() [2/2]
|
static |
expression handler copy callback
Definition at line 2658 of file expr_pow.c.
References SCIP_CALL, SCIP_OKAY, and SCIPincludeExprhdlrSignpower().
◆ SCIP_DECL_EXPRPRINT() [2/2]
|
static |
expression print callback
Definition at line 2667 of file expr_pow.c.
References NULL, SCIP_EXPRITER_ENTEREXPR, SCIP_EXPRITER_LEAVEEXPR, SCIP_EXPRITER_VISITEDCHILD, SCIP_EXPRITER_VISITINGCHILD, SCIP_OKAY, SCIPgetExponentExprPow(), and SCIPinfoMessage().
◆ SCIP_DECL_EXPRPARSE()
|
static |
expression parse callback
! [SnippetExprParseSignpower]
! [SnippetExprParseSignpower]
Definition at line 2701 of file expr_pow.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPcreateExprSignpower(), SCIPerrorMessage, SCIPisInfinity(), SCIPparseExpr(), SCIPparseReal(), SCIPreleaseExpr(), and TRUE.
◆ SCIP_DECL_EXPREVAL() [2/2]
|
static |
expression point evaluation callback
Definition at line 2751 of file expr_pow.c.
References NULL, REALABS, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetEvalValue(), SCIPexprGetNChildren(), SCIPgetExponentExprPow(), SCIPisFinite, and SIGN.
◆ SCIP_DECL_EXPRBWDIFF() [2/2]
|
static |
expression derivative evaluation callback
Definition at line 2776 of file expr_pow.c.
References NULL, REALABS, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetEvalValue(), SCIPexprGetHdlr(), SCIPexprhdlrGetName(), and SCIPgetExponentExprPow().
◆ SCIP_DECL_EXPRINTEVAL() [2/2]
|
static |
expression interval evaluation callback
Definition at line 2803 of file expr_pow.c.
References NULL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetExponentExprPow(), SCIPintervalIsEmpty(), SCIPintervalSetEmpty(), and SCIPintervalSignPowerScalar().
◆ SCIP_DECL_EXPRESTIMATE() [2/2]
|
static |
expression estimator callback
Definition at line 2824 of file expr_pow.c.
References computeSignpowerRoot(), estimateParabola(), estimateSignedpower(), FALSE, MAX, NULL, REALABS, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPexprGetData(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetName(), SCIPgetExponentExprPow(), SCIPisInfinity(), SIGN, SIGNPOWEXPRHDLR_NAME, and TRUE.
◆ SCIP_DECL_EXPRINITESTIMATES() [2/2]
|
static |
initial estimates callback for a signpower expression
Definition at line 2917 of file expr_pow.c.
References addSignpowerRefpoints(), addTangentRefpoints(), computeSignpowerRoot(), estimateParabola(), estimateSignedpower(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPR_MAXINITESTIMATES, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPexprGetData(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetName(), SCIPisEQ(), SCIPisGE(), SCIPisInfinity(), SCIPisLE(), SIGNPOWEXPRHDLR_NAME, and TRUE.
◆ SCIP_DECL_EXPRREVERSEPROP() [2/2]
|
static |
expression reverse propagaton callback
Definition at line 3009 of file expr_pow.c.
References SCIP_Interval::inf, NULL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPdebugMsgPrint, SCIPexprGetNChildren(), SCIPgetExponentExprPow(), SCIPintervalIsEntire(), SCIPintervalReciprocal(), SCIPintervalSet(), SCIPintervalSignPowerScalar(), SCIPintervalUnify(), and SCIP_Interval::sup.
◆ SCIP_DECL_EXPRHASH() [2/2]
|
static |
expression hash callback
Definition at line 3053 of file expr_pow.c.
References NULL, SCIP_OKAY, SCIPexprGetNChildren(), and SIGNPOWEXPRHDLR_HASHKEY.
◆ SCIP_DECL_EXPRCURVATURE() [2/2]
|
static |
expression curvature detection callback
Definition at line 3070 of file expr_pow.c.
References FALSE, SCIP_Interval::inf, NULL, SCIP_CALL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIPevalExprActivity(), SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetNChildren(), and SCIP_Interval::sup.
◆ SCIP_DECL_EXPRMONOTONICITY() [2/2]
|
static |
expression monotonicity detection callback
Definition at line 3108 of file expr_pow.c.
References NULL, SCIP_MONOTONE_INC, and SCIP_OKAY.
◆ SCIPaddSquareLinearization()
void SCIPaddSquareLinearization | ( | SCIP * | scip, |
SCIP_Real | sqrcoef, | ||
SCIP_Real | refpoint, | ||
SCIP_Bool | isint, | ||
SCIP_Real * | lincoef, | ||
SCIP_Real * | linconstant, | ||
SCIP_Bool * | success | ||
) |
computes coefficients of linearization of a square term in a reference point
- Parameters
-
scip SCIP data structure sqrcoef coefficient of square term refpoint point where to linearize isint whether corresponding variable is a discrete variable, and thus linearization could be moved lincoef buffer to add coefficient of linearization linconstant buffer to add constant of linearization success buffer to set to FALSE if linearization has failed due to large numbers
Definition at line 3253 of file expr_pow.c.
References FALSE, NULL, REALABS, SCIP_Real, SCIPfloor(), SCIPisInfinity(), and SCIPisIntegral().
Referenced by addBilinearTermToCut(), addRltTerm(), and buildPowEstimator().
◆ SCIPaddSquareSecant()
void SCIPaddSquareSecant | ( | SCIP * | scip, |
SCIP_Real | sqrcoef, | ||
SCIP_Real | lb, | ||
SCIP_Real | ub, | ||
SCIP_Real * | lincoef, | ||
SCIP_Real * | linconstant, | ||
SCIP_Bool * | success | ||
) |
computes coefficients of secant of a square term
- Parameters
-
scip SCIP data structure sqrcoef coefficient of square term lb lower bound on variable ub upper bound on variable lincoef buffer to add coefficient of secant linconstant buffer to add constant of secant success buffer to set to FALSE if secant has failed due to large numbers or unboundedness
Definition at line 3321 of file expr_pow.c.
References FALSE, NULL, REALABS, SCIP_Real, SCIPisInfinity(), and SCIPisLE().
Referenced by addBilinearTermToCut(), addRltTerm(), and buildPowEstimator().
◆ SCIPestimateRoot()
void SCIPestimateRoot | ( | SCIP * | scip, |
SCIP_Real | exponent, | ||
SCIP_Bool | overestimate, | ||
SCIP_Real | xlb, | ||
SCIP_Real | xub, | ||
SCIP_Real | xref, | ||
SCIP_Real * | constant, | ||
SCIP_Real * | slope, | ||
SCIP_Bool * | islocal, | ||
SCIP_Bool * | success | ||
) |
Separation for roots with exponent in [0,1]
- x^0.5 with x >= 0
8 +----------------------------------------------------------------------+ | + + + + | 7 |-+ x**0.5 ********| | *********| | ******** | 6 |-+ ******** +-| | ****** | 5 |-+ ****** +-| | ****** | | ***** | 4 |-+ **** +-| | ***** | 3 |-+ **** +-| | *** | | *** | 2 |-+ ** +-| | ** | 1 |** +-| |* | |* + + + + | 0 +----------------------------------------------------------------------+ 0 10 20 30 40 50
- Parameters
-
scip SCIP data structure exponent exponent overestimate should the power be overestimated? xlb lower bound on x xub upper bound on x xref reference point (where to linearize) constant buffer to store constant term of estimator slope buffer to store slope of estimator islocal buffer to store whether estimator only locally valid, that is, it depends on given bounds success buffer to store whether estimator could be computed
Definition at line 3395 of file expr_pow.c.
References computeSecant(), computeTangent(), FALSE, NULL, SCIPisZero(), and TRUE.
Referenced by buildPowEstimator(), and estimateSpecialPower().
Variable Documentation
◆ signpow_roots
|
static |
The positive root of the polynomial (n-1) y^n + n y^(n-1) - 1 is needed in separation. Here we store these roots for small integer values of n.
Definition at line 79 of file expr_pow.c.
Referenced by computeSignpowerRoot().