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"
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 49 of file expr_pow.c.
Referenced by SCIP_DECL_EXPRESTIMATE(), SCIP_DECL_EXPRINTEVAL(), SCIP_DECL_EXPRREVERSEPROP(), and SCIPincludeExprhdlrPow().
◆ POWEXPRHDLR_DESC
#define POWEXPRHDLR_DESC "power expression" |
Definition at line 50 of file expr_pow.c.
Referenced by SCIPincludeExprhdlrPow().
◆ POWEXPRHDLR_PRECEDENCE
#define POWEXPRHDLR_PRECEDENCE 55000 |
Definition at line 51 of file expr_pow.c.
Referenced by SCIPincludeExprhdlrPow().
◆ POWEXPRHDLR_HASHKEY
#define POWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.0) |
Definition at line 52 of file expr_pow.c.
Referenced by SCIP_DECL_EXPRHASH().
◆ SIGNPOWEXPRHDLR_NAME
#define SIGNPOWEXPRHDLR_NAME "signpower" |
Definition at line 54 of file expr_pow.c.
Referenced by SCIP_DECL_EXPRESTIMATE(), SCIP_DECL_EXPRINITESTIMATES(), SCIPcreateExprSignpower(), SCIPincludeExprhdlrSignpower(), and SCIPisExprSignpower().
◆ SIGNPOWEXPRHDLR_DESC
#define SIGNPOWEXPRHDLR_DESC "signed power expression" |
Definition at line 55 of file expr_pow.c.
Referenced by SCIPincludeExprhdlrSignpower().
◆ SIGNPOWEXPRHDLR_PRECEDENCE
#define SIGNPOWEXPRHDLR_PRECEDENCE 56000 |
Definition at line 56 of file expr_pow.c.
Referenced by SCIPincludeExprhdlrSignpower().
◆ SIGNPOWEXPRHDLR_HASHKEY
#define SIGNPOWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.1) |
Definition at line 57 of file expr_pow.c.
Referenced by SCIP_DECL_EXPRHASH().
◆ 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 59 of file expr_pow.c.
Referenced by addTangentRefpoints().
◆ 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.
Referenced by computeSecant(), posintpower(), SCIP_DECL_EXPRESTIMATE(), SCIP_DECL_EXPREVAL(), and SCIP_DECL_EXPRSIMPLIFY().
◆ 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.
Referenced by computeSignpowerRoot().
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 114 of file expr_pow.c.
References computeHyperbolaRoot(), 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 182 of file expr_pow.c.
References createData(), NULL, SCIP_ERROR, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPerrorMessage, and SCIPisZero().
Referenced by buildPowEstimator(), and computeSignpowerRoot().
◆ 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 228 of file expr_pow.c.
References computeTangent(), NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, and SCIPallocBlockMemory.
Referenced by computeHyperbolaRoot(), 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 254 of file expr_pow.c.
References computeSecant(), EPSISINT, FALSE, NULL, REALABS, SCIP_Real, SCIPisFinite, SCIPisNegative(), and TRUE.
Referenced by createData(), estimateHyperbolaMixed(), estimateHyperbolaPositive(), estimateParabola(), estimateRoot(), and estimateSignedpower().
◆ 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 303 of file expr_pow.c.
References EPSISINT, estimateParabola(), FALSE, NULL, REALABS, SCIP_Real, SCIPisEQ(), SCIPisFeasEQ(), SCIPisFinite, SCIPisInfinity(), SIGN, and TRUE.
Referenced by computeTangent(), estimateHyperbolaMixed(), estimateHyperbolaPositive(), estimateParabola(), estimateRoot(), and estimateSignedpower().
◆ 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 483 of file expr_pow.c.
References computeSecant(), computeTangent(), EPSISINT, estimateSignedpower(), FALSE, NULL, and TRUE.
Referenced by buildPowEstimator(), computeSecant(), 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 549 of file expr_pow.c.
References computeSecant(), computeTangent(), estimateHyperbolaPositive(), FALSE, NULL, SCIP_Real, SCIPisPositive(), and TRUE.
Referenced by buildPowEstimator(), estimateParabola(), 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 697 of file expr_pow.c.
References computeSecant(), computeTangent(), EPSISINT, estimateHyperbolaMixed(), FALSE, NULL, SCIPisInfinity(), SCIPisZero(), and TRUE.
Referenced by buildPowEstimator(), and estimateSignedpower().
◆ 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 910 of file expr_pow.c.
References computeSecant(), computeTangent(), EPSISINT, estimateRoot(), FALSE, NULL, SCIPisInfinity(), SCIPisZero(), and TRUE.
Referenced by buildPowEstimator(), and estimateHyperbolaPositive().
◆ estimateRoot()
|
static |
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 1015 of file expr_pow.c.
References buildPowEstimator(), computeSecant(), computeTangent(), FALSE, NULL, SCIPisZero(), and TRUE.
Referenced by buildPowEstimator(), and estimateHyperbolaMixed().
◆ 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 1075 of file expr_pow.c.
References addTangentRefpoints(), computeHyperbolaRoot(), computeSignpowerRoot(), EPSISINT, estimateHyperbolaMixed(), estimateHyperbolaPositive(), estimateParabola(), estimateRoot(), estimateSignedpower(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIPaddSquareLinearization(), SCIPaddSquareSecant(), SCIPisInfinity(), and TRUE.
Referenced by estimateRoot(), 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 1208 of file expr_pow.c.
References addSignpowerRefpoints(), INITLPMAXPOWVAL, MAX, NULL, REALABS, SCIP_Real, and SCIPisInfinity().
Referenced by buildPowEstimator(), 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 1246 of file expr_pow.c.
References chooseRefpointsPow(), computeSignpowerRoot(), NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, and SCIPisInfinity().
Referenced by addTangentRefpoints(), 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 1301 of file expr_pow.c.
References addSignpowerRefpoints(), addTangentRefpoints(), EPSISINT, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_DECL_EXPRCOMPARE(), SCIP_OKAY, SCIP_Real, SCIPisInfinity(), and TRUE.
Referenced by addSignpowerRefpoints(), and 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 1388 of file expr_pow.c.
References SCIP_DECL_EXPRSIMPLIFY(), SCIP_Real, SCIPcompareExpr(), SCIPexprGetChildren(), and SCIPgetExponentExprPow().
Referenced by chooseRefpointsPow().
◆ SCIP_DECL_EXPRSIMPLIFY() [1/2]
|
static |
simplifies a pow expression
Evaluates the power function when its child is a value expression
Definition at line 1411 of file expr_pow.c.
References EPSISINT, NULL, SCIP_CALL, SCIP_DECL_EXPRCOPYHDLR(), SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPappendExprChild(), SCIPcaptureExpr(), SCIPcreateExprAbs(), SCIPcreateExprExp(), SCIPcreateExprPow(), SCIPcreateExprProduct(), SCIPcreateExprSum(), SCIPcreateExprValue(), SCIPdebugPrintf, SCIPepsilon(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPfreeBufferArray, SCIPgetCoefsExprSum(), SCIPgetConstantExprSum(), SCIPgetExponentExprPow(), SCIPgetValueExprValue(), SCIPgetVarExprVar(), SCIPisExprExp(), SCIPisExprPower(), SCIPisExprProduct(), SCIPisExprSum(), SCIPisExprValue(), SCIPisExprVar(), SCIPreleaseExpr(), and SCIPvarIsBinary().
Referenced by SCIP_DECL_EXPRCOMPARE(), and SCIP_DECL_EXPRINTEGRALITY().
◆ SCIP_DECL_EXPRCOPYHDLR() [1/2]
|
static |
expression handler copy callback
Definition at line 1779 of file expr_pow.c.
References SCIP_CALL, SCIP_DECL_EXPRFREEHDLR(), SCIP_OKAY, and SCIPincludeExprhdlrPow().
Referenced by SCIP_DECL_EXPRSIMPLIFY().
◆ SCIP_DECL_EXPRFREEHDLR()
|
static |
expression handler free callback
Definition at line 1788 of file expr_pow.c.
References NULL, SCIP_DECL_EXPRCOPYDATA(), SCIP_OKAY, and SCIPfreeBlockMemory.
Referenced by SCIP_DECL_EXPRCOPYHDLR().
◆ SCIP_DECL_EXPRCOPYDATA()
|
static |
expression data copy callback
Definition at line 1800 of file expr_pow.c.
References createData(), NULL, SCIP_CALL, SCIP_DECL_EXPRFREEDATA(), SCIP_OKAY, and SCIPexprGetData().
Referenced by SCIP_DECL_EXPRFREEHDLR().
◆ SCIP_DECL_EXPRFREEDATA()
|
static |
expression data free callback
Definition at line 1819 of file expr_pow.c.
References NULL, SCIP_DECL_EXPRPRINT(), SCIP_OKAY, SCIPexprGetData(), SCIPexprSetData(), and SCIPfreeBlockMemory.
Referenced by SCIP_DECL_EXPRCOPYDATA().
◆ SCIP_DECL_EXPRPRINT() [1/2]
|
static |
expression print callback
! [SnippetExprPrintPow]
! [SnippetExprPrintPow]
Definition at line 1837 of file expr_pow.c.
References NULL, SCIP_DECL_EXPREVAL(), SCIP_EXPRITER_ENTEREXPR, SCIP_EXPRITER_LEAVEEXPR, SCIP_EXPRITER_VISITEDCHILD, SCIP_EXPRITER_VISITINGCHILD, SCIP_OKAY, SCIP_Real, SCIPgetExponentExprPow(), and SCIPinfoMessage().
Referenced by SCIP_DECL_EXPRCOPYHDLR(), and SCIP_DECL_EXPRFREEDATA().
◆ SCIP_DECL_EXPREVAL() [1/2]
|
static |
expression point evaluation callback
Definition at line 1881 of file expr_pow.c.
References NULL, SCIP_DECL_EXPRFWDIFF(), SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetEvalValue(), SCIPexprGetNChildren(), SCIPgetExponentExprPow(), and SCIPisFinite.
Referenced by SCIP_DECL_EXPRPARSE(), and SCIP_DECL_EXPRPRINT().
◆ 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 1911 of file expr_pow.c.
References NULL, SCIP_DECL_EXPRBWFWDIFF(), SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetDot(), SCIPexprGetEvalValue(), SCIPgetExponentExprPow(), and SCIPisExprValue().
Referenced by SCIP_DECL_EXPREVAL().
◆ 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 1944 of file expr_pow.c.
References NULL, SCIP_DECL_EXPRBWDIFF(), SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetDot(), SCIPexprGetEvalValue(), SCIPgetExponentExprPow(), and SCIPisExprValue().
Referenced by SCIP_DECL_EXPRFWDIFF().
◆ SCIP_DECL_EXPRBWDIFF() [1/2]
|
static |
expression derivative evaluation callback
Definition at line 1973 of file expr_pow.c.
References NULL, SCIP_DECL_EXPRINTEVAL(), SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetEvalValue(), SCIPgetExponentExprPow(), and SCIPisExprValue().
Referenced by SCIP_DECL_EXPRBWFWDIFF(), and SCIP_DECL_EXPREVAL().
◆ SCIP_DECL_EXPRINTEVAL() [1/2]
|
static |
expression interval evaluation callback
Definition at line 2004 of file expr_pow.c.
References SCIP_Interval::inf, NULL, POWEXPRHDLR_NAME, SCIP_CALL, SCIP_DECL_EXPRESTIMATE(), 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.
Referenced by SCIP_DECL_EXPRBWDIFF().
◆ SCIP_DECL_EXPRESTIMATE() [1/2]
|
static |
expression estimator callback
Definition at line 2076 of file expr_pow.c.
References buildPowEstimator(), EPSISINT, FALSE, MAX, NULL, POWEXPRHDLR_NAME, REALABS, SCIP_Bool, SCIP_CALL, SCIP_DECL_EXPRREVERSEPROP(), SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetName(), SCIPexprIsIntegral(), SCIPgetExponentExprPow(), SCIPisFeasZero(), SCIPisInfinity(), and TRUE.
Referenced by SCIP_DECL_EXPRINTEVAL().
◆ SCIP_DECL_EXPRREVERSEPROP() [1/2]
|
static |
expression reverse propagaton callback
Definition at line 2152 of file expr_pow.c.
References EPSISINT, SCIP_Interval::inf, NULL, POWEXPRHDLR_NAME, SCIP_CALL, SCIP_DECL_EXPRINITESTIMATES(), 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.
Referenced by SCIP_DECL_EXPRESTIMATE(), and SCIP_DECL_EXPRINITESTIMATES().
◆ SCIP_DECL_EXPRINITESTIMATES() [1/2]
|
static |
initial estimates callback for a power expression
Definition at line 2246 of file expr_pow.c.
References buildPowEstimator(), chooseRefpointsPow(), EPSISINT, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_DECL_EXPRHASH(), SCIP_EXPR_MAXINITESTIMATES, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprIsIntegral(), SCIPisEQ(), SCIPisFeasZero(), SCIPisGE(), SCIPisLE(), and TRUE.
Referenced by SCIP_DECL_EXPRESTIMATE(), and SCIP_DECL_EXPRREVERSEPROP().
◆ SCIP_DECL_EXPRHASH() [1/2]
|
static |
expression hash callback
Definition at line 2332 of file expr_pow.c.
References NULL, POWEXPRHDLR_HASHKEY, SCIP_DECL_EXPRCURVATURE(), SCIP_OKAY, and SCIPexprGetNChildren().
Referenced by SCIP_DECL_EXPRINITESTIMATES(), and SCIP_DECL_EXPRREVERSEPROP().
◆ SCIP_DECL_EXPRCURVATURE() [1/2]
|
static |
expression curvature detection callback
Definition at line 2349 of file expr_pow.c.
References NULL, SCIP_CALL, SCIP_DECL_EXPRMONOTONICITY(), SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPevalExprActivity(), SCIPexprcurvPowerInv(), SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetNChildren(), and SCIPgetExponentExprPow().
Referenced by SCIP_DECL_EXPRHASH().
◆ SCIP_DECL_EXPRMONOTONICITY() [1/2]
|
static |
expression monotonicity detection callback
Definition at line 2378 of file expr_pow.c.
References EPSISINT, NULL, SCIP_Bool, SCIP_CALL, SCIP_DECL_EXPRINTEGRALITY(), SCIP_MONOTONE_DEC, SCIP_MONOTONE_INC, SCIP_MONOTONE_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPevalExprActivity(), SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetExponentExprPow(), SCIPintervalGetInf(), and SCIPintervalGetSup().
Referenced by SCIP_DECL_EXPRCURVATURE().
◆ SCIP_DECL_EXPRINTEGRALITY()
|
static |
expression integrality detection callback
Definition at line 2441 of file expr_pow.c.
References EPSISINT, FALSE, NULL, SCIP_Bool, SCIP_DECL_EXPRSIMPLIFY(), SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPexprIsIntegral(), and SCIPgetExponentExprPow().
Referenced by SCIP_DECL_EXPRMONOTONICITY().
◆ SCIP_DECL_EXPRSIMPLIFY() [2/2]
|
static |
simplifies a signpower expression
Definition at line 2474 of file expr_pow.c.
References EPSISINT, NULL, REALABS, SCIP_CALL, SCIP_DECL_EXPRCOPYHDLR(), 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 2650 of file expr_pow.c.
References SCIP_CALL, SCIP_DECL_EXPRPRINT(), SCIP_OKAY, and SCIPincludeExprhdlrSignpower().
◆ SCIP_DECL_EXPRPRINT() [2/2]
|
static |
expression print callback
Definition at line 2659 of file expr_pow.c.
References NULL, SCIP_DECL_EXPRPARSE(), 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 2693 of file expr_pow.c.
References NULL, SCIP_CALL, SCIP_DECL_EXPREVAL(), SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPcreateExprSignpower(), SCIPerrorMessage, SCIPisInfinity(), SCIPparseExpr(), SCIPparseReal(), SCIPreleaseExpr(), and TRUE.
Referenced by SCIP_DECL_EXPRPRINT().
◆ SCIP_DECL_EXPREVAL() [2/2]
|
static |
expression point evaluation callback
Definition at line 2743 of file expr_pow.c.
References NULL, REALABS, SCIP_DECL_EXPRBWDIFF(), 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 2768 of file expr_pow.c.
References NULL, REALABS, SCIP_DECL_EXPRINTEVAL(), 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 2795 of file expr_pow.c.
References NULL, SCIP_DECL_EXPRESTIMATE(), 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 2816 of file expr_pow.c.
References computeSignpowerRoot(), estimateParabola(), estimateSignedpower(), FALSE, MAX, NULL, REALABS, SCIP_CALL, SCIP_DECL_EXPRINITESTIMATES(), 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 2909 of file expr_pow.c.
References addSignpowerRefpoints(), addTangentRefpoints(), computeSignpowerRoot(), estimateParabola(), estimateSignedpower(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_DECL_EXPRREVERSEPROP(), 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 3001 of file expr_pow.c.
References SCIP_Interval::inf, NULL, SCIP_DECL_EXPRHASH(), 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 3045 of file expr_pow.c.
References NULL, SCIP_DECL_EXPRCURVATURE(), SCIP_OKAY, SCIPexprGetNChildren(), and SIGNPOWEXPRHDLR_HASHKEY.
◆ SCIP_DECL_EXPRCURVATURE() [2/2]
|
static |
expression curvature detection callback
Definition at line 3062 of file expr_pow.c.
References FALSE, SCIP_Interval::inf, NULL, SCIP_CALL, SCIP_DECL_EXPRMONOTONICITY(), 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 3100 of file expr_pow.c.
References NULL, SCIP_MONOTONE_INC, SCIP_OKAY, and SCIPincludeExprhdlrPow().
◆ 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 3235 of file expr_pow.c.
References FALSE, NULL, REALABS, SCIP_Real, SCIPaddSquareSecant(), SCIPfloor(), SCIPisInfinity(), and SCIPisIntegral().
Referenced by addBilinearTermToCut(), addRltTerm(), buildPowEstimator(), and SCIPisExprSignpower().
◆ 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 3303 of file expr_pow.c.
References FALSE, NULL, REALABS, SCIP_Real, SCIPgetExponentExprPow(), SCIPisInfinity(), and SCIPisLE().
Referenced by addBilinearTermToCut(), addRltTerm(), buildPowEstimator(), and SCIPaddSquareLinearization().
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().