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) |
#define | SIGNPOW_ROOTS_KNOWN 10 |
Variables | |
static SCIP_Real | signpow_roots [SIGNPOW_ROOTS_KNOWN+1] |
#define POWEXPRHDLR_NAME "pow" |
Definition at line 50 of file expr_pow.c.
Referenced by SCIP_DECL_EXPRESTIMATE(), SCIP_DECL_EXPRINTEVAL(), SCIP_DECL_EXPRREVERSEPROP(), and SCIPincludeExprhdlrPow().
#define POWEXPRHDLR_DESC "power expression" |
Definition at line 51 of file expr_pow.c.
Referenced by SCIPincludeExprhdlrPow().
#define POWEXPRHDLR_PRECEDENCE 55000 |
Definition at line 52 of file expr_pow.c.
Referenced by SCIPincludeExprhdlrPow().
#define POWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.0) |
Definition at line 53 of file expr_pow.c.
Referenced by SCIP_DECL_EXPRHASH().
#define SIGNPOWEXPRHDLR_NAME "signpower" |
Definition at line 55 of file expr_pow.c.
Referenced by SCIP_DECL_EXPRESTIMATE(), SCIP_DECL_EXPRINITESTIMATES(), SCIPcreateExprSignpower(), SCIPincludeExprhdlrSignpower(), and SCIPisExprSignpower().
#define SIGNPOWEXPRHDLR_DESC "signed power expression" |
Definition at line 56 of file expr_pow.c.
Referenced by SCIPincludeExprhdlrSignpower().
#define SIGNPOWEXPRHDLR_PRECEDENCE 56000 |
Definition at line 57 of file expr_pow.c.
Referenced by SCIPincludeExprhdlrSignpower().
#define SIGNPOWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.1) |
Definition at line 58 of file expr_pow.c.
Referenced by SCIP_DECL_EXPRHASH().
#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 60 of file expr_pow.c.
Referenced by addTangentRefpoints().
#define SIGN | ( | x | ) |
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(), SCIP_DECL_EXPRESTIMATE(), SCIP_DECL_EXPREVAL(), and SCIP_DECL_EXPRSIMPLIFY().
#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().
|
static |
computes positive root of the polynomial (n-1) y^n + n y^(n-1) - 1 for n > 1
scip | SCIP data structure |
root | buffer where to store computed root |
exponent | exponent n |
Definition at line 117 of file expr_pow.c.
References assert(), 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().
|
static |
computes negative root of the polynomial (n-1) y^n - n y^(n-1) + 1 for n < -1
scip | SCIP data structure |
root | buffer where to store computed root |
exponent | exponent n |
Definition at line 185 of file expr_pow.c.
References assert(), NULL, SCIP_ERROR, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPerrorMessage, and SCIPisZero().
Referenced by buildPowEstimator().
|
static |
creates expression data
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 assert(), NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, and SCIPallocBlockMemory.
Referenced by SCIP_DECL_EXPRCOPYDATA(), SCIPcreateExprPow(), and SCIPcreateExprSignpower().
|
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
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 assert(), EPSISINT, FALSE, NULL, REALABS, SCIP_Bool, SCIP_Real, SCIPisFinite, SCIPisNegative(), and TRUE.
Referenced by estimateHyperbolaMixed(), estimateHyperbolaPositive(), estimateParabola(), estimateSignedpower(), and SCIPestimateRoot().
|
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
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 assert(), EPSISINT, FALSE, NULL, REALABS, SCIP_Bool, SCIP_Real, SCIPisEQ(), SCIPisFeasEQ(), SCIPisFinite, SCIPisInfinity(), SIGN, and TRUE.
Referenced by estimateHyperbolaMixed(), estimateHyperbolaPositive(), estimateParabola(), estimateSignedpower(), and SCIPestimateRoot().
|
static |
Separation for parabola
100 +--------------------------------------------------------------------+ |* + + + *| 90 |** x**2 ********| | * * | 80 |-+* *+-| | ** ** | 70 |-+ * * +-| | ** ** | 60 |-+ * * +-| | ** ** | 50 |-+ * * +-| | ** ** | 40 |-+ * * +-| | ** ** | 30 |-+ ** ** +-| | ** ** | 20 |-+ ** ** +-| | *** *** | 10 |-+ *** *** +-| | + ***** + ***** + | 0 +--------------------------------------------------------------------+ -10 -5 0 5 10
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 assert(), computeSecant(), computeTangent(), EPSISINT, FALSE, NULL, SCIP_Bool, SCIP_Real, and TRUE.
Referenced by buildPowEstimator(), SCIP_DECL_EXPRESTIMATE(), and SCIP_DECL_EXPRINITESTIMATES().
|
static |
Separation for signpower
100 +--------------------------------------------------------------------+ | + + + **| | x*abs(x) ******* | | ** | | ** | 50 |-+ *** +-| | *** | | *** | | ***** | | ***** | 0 |-+ **************** +-| | ***** | | ***** | | *** | | *** | -50 |-+ *** +-| | ** | | ** | | ** | |** + + + | -100 +--------------------------------------------------------------------+ -10 -5 0 5 10
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 assert(), c, computeSecant(), computeTangent(), FALSE, NULL, SCIP_Bool, SCIP_Real, SCIPisPositive(), and TRUE.
Referenced by buildPowEstimator(), SCIP_DECL_EXPRESTIMATE(), and SCIP_DECL_EXPRINITESTIMATES().
|
static |
Separation for positive hyperbola
5 +----------------------------------------------------------------------+ | + * +* + | | * * x**(-2) ******* | 4 |-+ * * +-| | * * | | * * | | * * | 3 |-+ * * +-| | * * | | * * | 2 |-+ * * +-| | * * | | * * | 1 |-+ * * +-| | * * | | ** ** | | ********** ********** | 0 |******************* *******************| | | | + + + | -1 +----------------------------------------------------------------------+ -10 -5 0 5 10
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 assert(), computeSecant(), computeTangent(), EPSISINT, estimateHyperbolaPositive(), FALSE, MIN, NULL, SCIP_Bool, SCIP_Real, SCIPisInfinity(), SCIPisZero(), and TRUE.
Referenced by buildPowEstimator(), and estimateHyperbolaPositive().
|
static |
Separation for mixed-sign hyperbola
+----------------------------------------------------------------------+ | + * + | 4 |-+ * x**(-1) *******-| | * | | * | | * | 2 |-+ * +-| | * | | ** | | ********* | 0 |********************* *********************| | ********* | | ** | | * | -2 |-+ * +-| | * | | * | | * | -4 |-+ * +-| | + *+ + | +----------------------------------------------------------------------+ -10 -5 0 5 10
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 assert(), computeSecant(), computeTangent(), EPSISINT, FALSE, NULL, SCIP_Bool, SCIP_Real, SCIPisInfinity(), SCIPisZero(), and TRUE.
Referenced by buildPowEstimator().
|
static |
builds an estimator for a power function
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 assert(), computeHyperbolaRoot(), computeSignpowerRoot(), EPSISINT, estimateHyperbolaMixed(), estimateHyperbolaPositive(), estimateParabola(), estimateSignedpower(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPaddSquareLinearization(), SCIPaddSquareSecant(), SCIPestimateRoot(), SCIPisInfinity(), and TRUE.
Referenced by SCIP_DECL_EXPRESTIMATE(), and SCIP_DECL_EXPRINITESTIMATES().
|
static |
fills an array of reference points for estimating on the convex side
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 assert(), INITLPMAXPOWVAL, MAX, MIN, NULL, REALABS, SCIP_Real, and SCIPisInfinity().
Referenced by chooseRefpointsPow(), and SCIP_DECL_EXPRINITESTIMATES().
|
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
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 assert(), computeSignpowerRoot(), NULL, SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, and SCIPisInfinity().
Referenced by chooseRefpointsPow(), and SCIP_DECL_EXPRINITESTIMATES().
|
static |
choose reference points for adding initestimates cuts for a power expression
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(), assert(), EPSISINT, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPisInfinity(), and TRUE.
Referenced by SCIP_DECL_EXPRINITESTIMATES().
|
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().
|
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 assert(), EPSISINT, i, 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.
|
static |
expression callback to get information for symmetry detection
Definition at line 1764 of file expr_pow.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, and SCIPexprGetData().
|
static |
expression handler copy callback
Definition at line 1787 of file expr_pow.c.
References SCIP_CALL, SCIP_OKAY, and SCIPincludeExprhdlrPow().
|
static |
expression handler free callback
Definition at line 1796 of file expr_pow.c.
References assert(), NULL, SCIP_OKAY, and SCIPfreeBlockMemory.
|
static |
expression data copy callback
Definition at line 1808 of file expr_pow.c.
References assert(), createData(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprGetData().
|
static |
expression data free callback
Definition at line 1827 of file expr_pow.c.
References assert(), NULL, SCIP_OKAY, SCIPexprGetData(), SCIPexprSetData(), and SCIPfreeBlockMemory.
|
static |
expression print callback
! [SnippetExprPrintPow]
! [SnippetExprPrintPow]
Definition at line 1845 of file expr_pow.c.
References assert(), NULL, SCIP_EXPRITER_ENTEREXPR, SCIP_EXPRITER_LEAVEEXPR, SCIP_EXPRITER_VISITEDCHILD, SCIP_EXPRITER_VISITINGCHILD, SCIP_OKAY, SCIP_Real, SCIPgetExponentExprPow(), and SCIPinfoMessage().
|
static |
expression point evaluation callback
Definition at line 1889 of file expr_pow.c.
References assert(), NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetEvalValue(), SCIPexprGetNChildren(), SCIPgetExponentExprPow(), and SCIPisFinite.
|
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 assert(), NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetDot(), SCIPexprGetEvalValue(), SCIPgetExponentExprPow(), and SCIPisExprValue().
|
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 assert(), NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetDot(), SCIPexprGetEvalValue(), SCIPgetExponentExprPow(), and SCIPisExprValue().
|
static |
expression derivative evaluation callback
Definition at line 1981 of file expr_pow.c.
References assert(), NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetEvalValue(), SCIPgetExponentExprPow(), and SCIPisExprValue().
|
static |
expression interval evaluation callback
Definition at line 2012 of file expr_pow.c.
References assert(), 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.
|
static |
expression estimator callback
Definition at line 2084 of file expr_pow.c.
References assert(), 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.
|
static |
expression reverse propagaton callback
Definition at line 2160 of file expr_pow.c.
References assert(), 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.
|
static |
initial estimates callback for a power expression
Definition at line 2254 of file expr_pow.c.
References assert(), buildPowEstimator(), chooseRefpointsPow(), EPSISINT, FALSE, i, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPR_MAXINITESTIMATES, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprIsIntegral(), SCIPisEQ(), SCIPisFeasZero(), SCIPisGE(), SCIPisLE(), and TRUE.
|
static |
expression hash callback
Definition at line 2340 of file expr_pow.c.
References assert(), NULL, POWEXPRHDLR_HASHKEY, SCIP_OKAY, and SCIPexprGetNChildren().
|
static |
expression curvature detection callback
Definition at line 2357 of file expr_pow.c.
References assert(), NULL, SCIP_CALL, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPevalExprActivity(), SCIPexprcurvPowerInv(), SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetNChildren(), and SCIPgetExponentExprPow().
|
static |
expression monotonicity detection callback
Definition at line 2386 of file expr_pow.c.
References assert(), EPSISINT, NULL, result, 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().
|
static |
expression integrality detection callback
Definition at line 2449 of file expr_pow.c.
References assert(), EPSISINT, FALSE, NULL, SCIP_Bool, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPexprIsIntegral(), and SCIPgetExponentExprPow().
|
static |
simplifies a signpower expression
Definition at line 2482 of file expr_pow.c.
References assert(), 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.
|
static |
expression handler copy callback
Definition at line 2658 of file expr_pow.c.
References SCIP_CALL, SCIP_OKAY, and SCIPincludeExprhdlrSignpower().
|
static |
expression print callback
Definition at line 2667 of file expr_pow.c.
References assert(), NULL, SCIP_EXPRITER_ENTEREXPR, SCIP_EXPRITER_LEAVEEXPR, SCIP_EXPRITER_VISITEDCHILD, SCIP_EXPRITER_VISITINGCHILD, SCIP_OKAY, SCIPgetExponentExprPow(), and SCIPinfoMessage().
|
static |
expression parse callback
! [SnippetExprParseSignpower]
! [SnippetExprParseSignpower]
Definition at line 2701 of file expr_pow.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPcreateExprSignpower(), SCIPerrorMessage, SCIPisInfinity(), SCIPparseExpr(), SCIPparseReal(), SCIPreleaseExpr(), and TRUE.
|
static |
expression point evaluation callback
Definition at line 2751 of file expr_pow.c.
References assert(), NULL, REALABS, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetEvalValue(), SCIPexprGetNChildren(), SCIPgetExponentExprPow(), SCIPisFinite, and SIGN.
|
static |
expression derivative evaluation callback
Definition at line 2776 of file expr_pow.c.
References assert(), NULL, REALABS, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetEvalValue(), SCIPexprGetHdlr(), SCIPexprhdlrGetName(), and SCIPgetExponentExprPow().
|
static |
expression interval evaluation callback
Definition at line 2803 of file expr_pow.c.
References assert(), NULL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetExponentExprPow(), SCIPintervalIsEmpty(), SCIPintervalSetEmpty(), and SCIPintervalSignPowerScalar().
|
static |
expression estimator callback
Definition at line 2824 of file expr_pow.c.
References assert(), 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.
|
static |
initial estimates callback for a signpower expression
Definition at line 2917 of file expr_pow.c.
References addSignpowerRefpoints(), addTangentRefpoints(), assert(), computeSignpowerRoot(), estimateParabola(), estimateSignedpower(), FALSE, i, 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.
|
static |
expression reverse propagaton callback
Definition at line 3009 of file expr_pow.c.
References assert(), SCIP_Interval::inf, NULL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPdebugMsgPrint, SCIPexprGetNChildren(), SCIPgetExponentExprPow(), SCIPintervalIsEntire(), SCIPintervalReciprocal(), SCIPintervalSet(), SCIPintervalSignPowerScalar(), SCIPintervalUnify(), and SCIP_Interval::sup.
|
static |
expression hash callback
Definition at line 3053 of file expr_pow.c.
References assert(), NULL, SCIP_OKAY, SCIPexprGetNChildren(), and SIGNPOWEXPRHDLR_HASHKEY.
|
static |
expression curvature detection callback
Definition at line 3070 of file expr_pow.c.
References assert(), 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.
|
static |
expression monotonicity detection callback
Definition at line 3108 of file expr_pow.c.
References assert(), NULL, result, SCIP_MONOTONE_INC, and SCIP_OKAY.
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
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 assert(), FALSE, NULL, REALABS, SCIP_Bool, SCIP_Real, SCIPfloor(), SCIPisInfinity(), and SCIPisIntegral().
Referenced by addBilinearTermToCut(), addRltTerm(), and buildPowEstimator().
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
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 assert(), FALSE, NULL, REALABS, SCIP_Bool, SCIP_Real, SCIPisInfinity(), and SCIPisLE().
Referenced by addBilinearTermToCut(), addRltTerm(), and buildPowEstimator().
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]
8 +----------------------------------------------------------------------+ | + + + + | 7 |-+ x**0.5 ********| | *********| | ******** | 6 |-+ ******** +-| | ****** | 5 |-+ ****** +-| | ****** | | ***** | 4 |-+ **** +-| | ***** | 3 |-+ **** +-| | *** | | *** | 2 |-+ ** +-| | ** | 1 |** +-| |* | |* + + + + | 0 +----------------------------------------------------------------------+ 0 10 20 30 40 50
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 assert(), computeSecant(), computeTangent(), FALSE, NULL, SCIP_Bool, SCIP_Real, SCIPisZero(), and TRUE.
Referenced by buildPowEstimator(), and estimateSpecialPower().
|
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().