product expression handler
Definition in file expr_product.c.
#include <string.h>
#include "scip/pub_expr.h"
#include "scip/expr_product.h"
#include "scip/expr_sum.h"
#include "scip/expr_pow.h"
#include "scip/expr_value.h"
#include "scip/expr_exp.h"
#include "scip/expr_abs.h"
#include "scip/expr_entropy.h"
#include "scip/cons_nonlinear.h"
#include "scip/pub_misc.h"
#include "scip/nlhdlr_bilinear.h"
#include "symmetry/struct_symmetry.h"
Go to the source code of this file.
Data Structures | |
struct | exprnode |
Macros | |
#define | EXPRHDLR_NAME "prod" |
#define | EXPRHDLR_DESC "product expression" |
#define | EXPRHDLR_PRECEDENCE 50000 |
#define | EXPRHDLR_HASHKEY SCIPcalcFibHash(54949.0) |
#define | debugSimplify while( FALSE ) printf |
Functions | |
static | SCIP_DECL_VERTEXPOLYFUN (prodfunction) |
static SCIP_RETCODE | buildSimplifiedProduct (SCIP *scip, SCIP_Real simplifiedcoef, EXPRNODE **simplifiedfactors, SCIP_Bool expandalways, SCIP_Bool changed, SCIP_EXPR **simplifiedexpr, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata) |
static void | insertFirstList (EXPRNODE *newnode, EXPRNODE **list) |
static EXPRNODE * | listPopFirst (EXPRNODE **list) |
static int | listLength (EXPRNODE *list) |
static SCIP_RETCODE | createExprNode (SCIP *scip, SCIP_EXPR *expr, EXPRNODE **newnode) |
static SCIP_RETCODE | createExprlistFromExprs (SCIP *scip, SCIP_EXPR **exprs, int nexprs, EXPRNODE **list) |
static SCIP_RETCODE | freeExprNode (SCIP *scip, EXPRNODE **node) |
static SCIP_RETCODE | freeExprlist (SCIP *scip, EXPRNODE **exprlist) |
static SCIP_RETCODE | createExprProductFromExprlist (SCIP *scip, EXPRNODE *exprlist, SCIP_Real coef, SCIP_EXPR **expr, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata) |
static SCIP_RETCODE | simplifyFactor (SCIP *scip, SCIP_EXPR *factor, SCIP_Real *simplifiedcoef, EXPRNODE **simplifiedfactor, SCIP_Bool *changed) |
static SCIP_RETCODE | mergeProductExprlist (SCIP *scip, EXPRNODE *tomerge, EXPRNODE **finalchildren, EXPRNODE **unsimplifiedchildren, SCIP_Bool *changed, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata) |
static SCIP_RETCODE | simplifyMultiplyChildren (SCIP *scip, SCIP_EXPR **exprs, int nexprs, SCIP_Real *simplifiedcoef, EXPRNODE **finalchildren, SCIP_Bool *changed, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata) |
static SCIP_RETCODE | enforceSP10 (SCIP *scip, SCIP_Real simplifiedcoef, EXPRNODE *finalchildren, SCIP_EXPR **simplifiedexpr, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata) |
static SCIP_RETCODE | enforceSP11 (SCIP *scip, SCIP_Real simplifiedcoef, EXPRNODE *finalchildren, SCIP_EXPR **simplifiedexpr, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata) |
static SCIP_RETCODE | enforceSP12 (SCIP *scip, SCIP_Real simplifiedcoef, EXPRNODE *finalchildren, SCIP_Bool expandalways, SCIP_EXPR **simplifiedexpr, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata) |
static SCIP_RETCODE | enforceSP12b (SCIP *scip, SCIP_Real simplifiedcoef, EXPRNODE *finalchildren, SCIP_EXPR **simplifiedexpr, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata) |
static SCIP_RETCODE | estimateVertexPolyhedralProduct (SCIP *scip, SCIP_CONSHDLR *conshdlr, int nfactors, SCIP_INTERVAL *bounds, SCIP_Real constantfactor, SCIP_Real *refpoint, SCIP_Bool overestimate, SCIP_Real targetvalue, SCIP_Real *coefs, SCIP_Real *constant, SCIP_Bool *success) |
static | SCIP_DECL_EXPRSIMPLIFY (simplifyProduct) |
static | SCIP_DECL_EXPRCOMPARE (compareProduct) |
static | SCIP_DECL_EXPRCOPYHDLR (copyhdlrProduct) |
static | SCIP_DECL_EXPRFREEHDLR (freehdlrProduct) |
static | SCIP_DECL_EXPRCOPYDATA (copydataProduct) |
static | SCIP_DECL_EXPRFREEDATA (freedataProduct) |
static | SCIP_DECL_EXPRPRINT (printProduct) |
static | SCIP_DECL_EXPRHASH (hashProduct) |
static | SCIP_DECL_EXPREVAL (evalProduct) |
static | SCIP_DECL_EXPRFWDIFF (fwdiffProduct) |
static | SCIP_DECL_EXPRBWFWDIFF (bwfwdiffProduct) |
static | SCIP_DECL_EXPRBWDIFF (bwdiffProduct) |
static | SCIP_DECL_EXPRINTEVAL (intevalProduct) |
static | SCIP_DECL_EXPRESTIMATE (estimateProduct) |
static | SCIP_DECL_EXPRINITESTIMATES (initestimatesProduct) |
static | SCIP_DECL_EXPRREVERSEPROP (reversepropProduct) |
static | SCIP_DECL_EXPRCURVATURE (curvatureProduct) |
static | SCIP_DECL_EXPRMONOTONICITY (monotonicityProduct) |
static | SCIP_DECL_EXPRINTEGRALITY (integralityProduct) |
static | SCIP_DECL_EXPRGETSYMDATA (getSymDataProduct) |
SCIP_RETCODE | SCIPincludeExprhdlrProduct (SCIP *scip) |
SCIP_RETCODE | SCIPcreateExprProduct (SCIP *scip, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real coefficient, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata) |
SCIP_Real | SCIPgetCoefExprProduct (SCIP_EXPR *expr) |
#define EXPRHDLR_NAME "prod" |
Definition at line 51 of file expr_product.c.
#define EXPRHDLR_DESC "product expression" |
Definition at line 52 of file expr_product.c.
#define EXPRHDLR_PRECEDENCE 50000 |
Definition at line 53 of file expr_product.c.
#define EXPRHDLR_HASHKEY SCIPcalcFibHash(54949.0) |
Definition at line 54 of file expr_product.c.
macro to activate/deactivate debugging information of simplify method
Definition at line 63 of file expr_product.c.
Referenced by buildSimplifiedProduct(), createExprlistFromExprs(), enforceSP12(), SCIP_DECL_EXPRSIMPLIFY(), simplifyFactor(), and simplifyMultiplyChildren().
Definition at line 93 of file expr_product.c.
|
static |
evaluation callback for (vertex-polyhedral) functions used as input for facet computation of its envelopes
Definition at line 101 of file expr_product.c.
|
static |
builds a simplified product from simplifiedfactors
scip | SCIP data structure |
simplifiedcoef | simplified product should be simplifiedcoef * PI simplifiedfactors |
simplifiedfactors | factors of simplified product |
expandalways | whether to expand products of a sum and several factors in simplify (SP12b) |
changed | indicates whether some of the simplified factors was changed |
simplifiedexpr | buffer to store the simplified expression |
ownercreatedata | data to pass to ownercreate |
Definition at line 1220 of file expr_product.c.
References createExprProductFromExprlist(), debugSimplify, enforceSP10(), enforceSP11(), enforceSP12(), enforceSP12b(), freeExprlist(), listLength(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcreateExprSum(), and SCIPreleaseExpr().
Referenced by enforceSP12(), enforceSP12b(), and SCIP_DECL_EXPRSIMPLIFY().
inserts newnode at beginning of list
newnode | node to insert |
list | list |
Definition at line 129 of file expr_product.c.
References assert(), exprnode::next, and NULL.
Referenced by createExprlistFromExprs(), and mergeProductExprlist().
removes first element of list and returns it
list | list |
Definition at line 143 of file expr_product.c.
References assert(), exprnode::next, and NULL.
Referenced by mergeProductExprlist(), and simplifyMultiplyChildren().
|
static |
returns length of list
list | list |
Definition at line 163 of file expr_product.c.
References exprnode::next, and NULL.
Referenced by buildSimplifiedProduct(), and createExprProductFromExprlist().
|
static |
creates expression node and captures expression
scip | SCIP data structure |
expr | expression stored at node |
newnode | pointer to store node |
Definition at line 181 of file expr_product.c.
References exprnode::expr, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, and SCIPcaptureExpr().
Referenced by createExprlistFromExprs(), and simplifyFactor().
|
static |
creates expression list from expressions
scip | SCIP data structure |
exprs | expressions stored in list |
nexprs | number of expressions |
list | pointer to store list |
Definition at line 198 of file expr_product.c.
References assert(), createExprNode(), debugSimplify, i, insertFirstList(), NULL, SCIP_CALL, and SCIP_OKAY.
Referenced by simplifyFactor(), and simplifyMultiplyChildren().
|
static |
frees expression node and releases expressions
scip | SCIP data structure |
node | node to be freed |
Definition at line 225 of file expr_product.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, and SCIPreleaseExpr().
Referenced by freeExprlist(), and mergeProductExprlist().
|
static |
frees an expression list
scip | SCIP data structure |
exprlist | list |
Definition at line 240 of file expr_product.c.
References assert(), freeExprNode(), exprnode::next, NULL, SCIP_CALL, and SCIP_OKAY.
Referenced by buildSimplifiedProduct(), and simplifyMultiplyChildren().
|
static |
creates a product expression with the elements of exprlist as its children
scip | SCIP data structure |
exprlist | list containing the children of expr |
coef | coef of expr |
expr | pointer to store the product expression |
ownercreatedata | data to pass to ownercreate |
Definition at line 269 of file expr_product.c.
References assert(), exprnode::expr, i, listLength(), exprnode::next, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreateExprProduct(), and SCIPfreeBufferArray.
Referenced by buildSimplifiedProduct().
|
static |
simplifies a factor of a product expression: base, so that it is a valid children of a simplified product expr
scip | SCIP data structure |
factor | expression to be simplified |
simplifiedcoef | coefficient of parent product expression |
simplifiedfactor | pointer to store the resulting expression node/list of nodes |
changed | pointer to store if some term actually got simplified |
Definition at line 312 of file expr_product.c.
References assert(), createExprlistFromExprs(), createExprNode(), debugSimplify, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetCoefExprProduct(), SCIPgetCoefsExprSum(), SCIPgetConstantExprSum(), SCIPgetValueExprValue(), SCIPisExprProduct(), SCIPisExprSum(), SCIPisExprValue(), and TRUE.
Referenced by simplifyMultiplyChildren().
|
static |
merges tomerge into finalchildren
Both, tomerge and finalchildren contain expressions that could be the children of a simplified product (except for SP8 and SP10 which are enforced later). However, the concatenation of both lists will not in general yield a simplified product expression, because SP4, SP5 and SP14 could be violated. So the purpose of this method is to enforce SP4, SP5 and SP14. In the process of enforcing SP4, it could happen that SP2 is violated. Since enforcing SP2 could generate further violations, we remove the affected children from finalchildren and include them in unsimplifiedchildren for further processing.
scip | SCIP data structure |
tomerge | list to merge |
finalchildren | pointer to store the result of merge between tomerge and *finalchildren |
unsimplifiedchildren | the list of children that should go to the product expression; they are unsimplified when seen as children of a simplified product |
changed | pointer to store if some term actually got simplified |
ownercreatedata | data to pass to ownercreate |
Definition at line 392 of file expr_product.c.
References assert(), EPSISINT, exprnode::expr, FALSE, freeExprNode(), insertFirstList(), listPopFirst(), exprnode::next, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPappendExprSumExpr(), SCIPcompareExpr(), SCIPcreateExprAbs(), SCIPcreateExprExp(), SCIPcreateExprPow(), SCIPcreateExprSignpower(), SCIPcreateExprSum(), SCIPexprGetChildren(), SCIPgetExponentExprPow(), SCIPisExprExp(), SCIPisExprPower(), SCIPisExprSignpower(), SCIPisExprValue(), SCIPreleaseExpr(), and TRUE.
Referenced by simplifyMultiplyChildren().
|
static |
simplifies the given (simplified) exprs so that they can be factors of a simplified product
in particular, it will sort and multiply factors whose product leads to new expressions
scip | SCIP data structure |
exprs | factors to be simplified |
nexprs | number of factors |
simplifiedcoef | buffer to store coefficient of PI exprs; needs to be initialized |
finalchildren | expr node list to store the simplified factors |
changed | buffer to store whether some factor changed |
ownercreatedata | data to pass to ownercreate |
Definition at line 724 of file expr_product.c.
References assert(), createExprlistFromExprs(), debugSimplify, exprnode::expr, FALSE, freeExprlist(), listPopFirst(), mergeProductExprlist(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPinfoMessage(), SCIPprintExpr(), simplifyFactor(), and TRUE.
Referenced by enforceSP12(), enforceSP12b(), and SCIP_DECL_EXPRSIMPLIFY().
|
static |
scip | SCIP data structure |
simplifiedcoef | simplified product should be simplifiedcoef * PI simplifiedfactors |
finalchildren | factors of simplified product |
simplifiedexpr | buffer to store the simplified expression |
ownercreatedata | data to pass to ownercreate |
Definition at line 790 of file expr_product.c.
References exprnode::expr, exprnode::next, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcaptureExpr(), SCIPcreateExprSum(), SCIPcreateExprValue(), and SCIPreleaseExpr().
Referenced by buildSimplifiedProduct().
|
static |
checks if it is entropy expression
scip | SCIP data structure |
simplifiedcoef | simplified product should be simplifiedcoef * PI simplifiedfactors |
finalchildren | factors of simplified product |
simplifiedexpr | buffer to store the simplified expression |
ownercreatedata | data to pass to ownercreate |
Definition at line 834 of file expr_product.c.
References assert(), exprnode::expr, exprnode::next, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcompareExpr(), SCIPcreateExprEntropy(), SCIPcreateExprSum(), SCIPexprGetChildren(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetName(), and SCIPreleaseExpr().
Referenced by buildSimplifiedProduct().
|
static |
scip | SCIP data structure |
simplifiedcoef | simplified product should be simplifiedcoef * PI simplifiedfactors |
finalchildren | factors of simplified product |
expandalways | whether to expand products of a sum and several factors in simplify (SP12b) |
simplifiedexpr | buffer to store the simplified expression |
ownercreatedata | data to pass to ownercreate |
Definition at line 895 of file expr_product.c.
References assert(), buildSimplifiedProduct(), debugSimplify, exprnode::expr, i, exprnode::next, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPappendExprSumExpr(), SCIPcreateExprSum(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPexprGetNUses(), SCIPgetCoefsExprSum(), SCIPgetConstantExprSum(), SCIPinfoMessage(), SCIPisExprSum(), SCIPprintExpr(), SCIPreleaseExpr(), simplifyMultiplyChildren(), and TRUE.
Referenced by buildSimplifiedProduct().
|
static |
scip | SCIP data structure |
simplifiedcoef | simplified product should be simplifiedcoef * prod simplifiedfactors |
finalchildren | factors of simplified product |
simplifiedexpr | buffer to store the simplified expression |
ownercreatedata | data to pass to ownercreate |
Definition at line 1112 of file expr_product.c.
References assert(), buildSimplifiedProduct(), exprnode::expr, exprnode::next, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPappendExprSumExpr(), SCIPcreateExprSum(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPfreeBufferArray, SCIPgetCoefsExprSum(), SCIPgetConstantExprSum(), SCIPisExprSum(), SCIPreleaseExpr(), simplifyMultiplyChildren(), and TRUE.
Referenced by buildSimplifiedProduct().
|
static |
computes an estimator for a product as a vertex polyhedral function
Since the product is multilinear, its convex and concave envelopes are piecewise linear.
scip | SCIP data structure |
conshdlr | nonlinear constraint handler |
nfactors | number of factors |
bounds | bound for each factor |
constantfactor | another constant factor |
refpoint | reference point where to estimate, or NULL if called from initestimates |
overestimate | should estimator overestimate expr (TRUE) or underestimate (FALSE) |
targetvalue | no need to compute facet if value in xstar would be worse than target value |
coefs | array to store cut coefficients |
constant | pointer to store cut constant |
success | pointer to store whether estimation was successful |
Definition at line 1293 of file expr_product.c.
References assert(), FALSE, i, SCIP_Interval::inf, NULL, SCIP_Bool, SCIP_CALL, SCIP_INTERVAL_INFINITY, SCIP_MAXVERTEXPOLYDIM, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcomputeFacetVertexPolyhedralNonlinear(), SCIPdebugMsg, SCIPfreeBufferArray, SCIPintervalIsEmpty(), SCIPisInfinity(), SCIPisRelEQ(), and SCIP_Interval::sup.
Referenced by SCIP_DECL_EXPRESTIMATE(), and SCIP_DECL_EXPRINITESTIMATES().
|
static |
simplifies a product expression
Summary: we first build a list of expressions (called finalchildren) which will be the children of the simplified product and then we process this list in order to enforce SP8 and SP10.
Description: In order to build finalchildren, we first build a list of unsimplified children (called unsimplifiedchildren) with the children of the product. Each node of the list is manipulated (see simplifyFactor) in order to satisfy SP2 and SP7 as follows:
Then, we merge the built list (or the simplified node) into finalchildren. While merging, nodes from finalchildren can go back to unsimplifiedchildren for further processing (see mergeProductExprlist() for more details). After building finalchildren, we create the simplified product out of it, taking care that SP8 and SP10 are satisfied
Definition at line 1377 of file expr_product.c.
References assert(), buildSimplifiedProduct(), debugSimplify, exprnode::expr, i, exprnode::next, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcaptureExpr(), SCIPexprGetChildren(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetData(), SCIPgetCoefExprProduct(), SCIPinfoMessage(), SCIPprintExpr(), and simplifyMultiplyChildren().
|
static |
compare two product expressions
The order of two product expressions, u and v, is a lexicographical order on the factors.
Starting from the last, we find the first child where they differ, say, the i-th. Then u < v <=> u_i < v_i. If there is no such children and they have different number of children, then u < v <=> nchildren(u) < nchildren(v). If all children are the same and they have the same number of children, then u < v <=> coeff(u) < coeff(v). Otherwise, they are the same.
Note: we are assuming expression are simplified, so within u, we have u_1 < u_2, etc.
Example: y * z < x * y * z
Definition at line 1450 of file expr_product.c.
References assert(), i, SCIPcompareExpr(), SCIPexprGetChildren(), SCIPexprGetNChildren(), and SCIPgetCoefExprProduct().
|
static |
expression handler copy callback
Definition at line 1500 of file expr_product.c.
References SCIP_CALL, SCIP_OKAY, and SCIPincludeExprhdlrProduct().
|
static |
expression handler free callback
Definition at line 1509 of file expr_product.c.
References assert(), NULL, SCIP_OKAY, and SCIPfreeBlockMemory.
|
static |
expression data copy callback
Definition at line 1524 of file expr_product.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPduplicateBlockMemory, and SCIPexprGetData().
|
static |
expression data free callback
Definition at line 1541 of file expr_product.c.
References assert(), exprnode::expr, NULL, SCIP_OKAY, SCIPexprGetData(), SCIPexprSetData(), and SCIPfreeBlockMemory.
|
static |
expression print callback
Definition at line 1559 of file expr_product.c.
References assert(), exprnode::expr, EXPRHDLR_PRECEDENCE, NULL, SCIP_EXPRITER_ENTEREXPR, SCIP_EXPRITER_LEAVEEXPR, SCIP_EXPRITER_VISITEDCHILD, SCIP_EXPRITER_VISITINGCHILD, SCIP_OKAY, SCIPABORT, SCIPexprGetData(), and SCIPinfoMessage().
|
static |
product hash callback
Definition at line 1628 of file expr_product.c.
References assert(), c, exprnode::expr, EXPRHDLR_HASHKEY, NULL, SCIP_OKAY, SCIPcalcFibHash(), SCIPexprGetData(), and SCIPexprGetNChildren().
|
static |
expression point evaluation callback
Definition at line 1652 of file expr_product.c.
References assert(), c, exprnode::expr, NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetEvalValue(), and SCIPexprGetNChildren().
|
static |
derivative evaluation callback computing <gradient, children.dot>
If expr is \(\prod_i x_i\), then computes \(\sum_j \prod_{i\neq j} x_i x^{\text{dot}}_j\).
! [SnippetExprFwdiffProduct]
! [SnippetExprFwdiffProduct]
Definition at line 1680 of file expr_product.c.
References assert(), c, exprnode::expr, i, NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetDot(), SCIPexprGetEvalValue(), and SCIPexprGetNChildren().
|
static |
expression backward forward derivative evaluation callback
Computes \(\frac{\partial}{\partial \text{childidx}} ( \langle \text{gradient}, \text{children.dot}\rangle )\).
If expr is \(\prod_i x_i\), and childidx is \(k\) then computes \(\partial_k \sum_j \prod_{i \neq j} x_i x^{\text{dot}}_j = \sum_{j \neq k} \prod_{i \neq j, k} x_i x^{\text{dot}}_j\)
! [SnippetExprBwfwdiffProduct]
! [SnippetExprBwfwdiffProduct]
Definition at line 1737 of file expr_product.c.
References assert(), c, exprnode::expr, i, NULL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetDot(), SCIPexprGetEvalValue(), SCIPexprGetNChildren(), and SCIPisExprValue().
|
static |
expression derivative evaluation callback
! [SnippetExprBwdiffProduct]
! [SnippetExprBwdiffProduct]
Definition at line 1796 of file expr_product.c.
References assert(), exprnode::expr, i, NULL, SCIP_INVALID, SCIP_OKAY, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetEvalValue(), SCIPexprGetNChildren(), SCIPisExprValue(), and SCIPisZero().
|
static |
expression interval evaluation callback
! [SnippetExprIntevalProduct]
! [SnippetExprIntevalProduct]
Definition at line 1836 of file expr_product.c.
References assert(), c, exprnode::expr, SCIP_Interval::inf, NULL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIPdebugMsg, SCIPdebugMsgPrint, SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetNChildren(), SCIPintervalIsEmpty(), SCIPintervalMul(), SCIPintervalSet(), SCIPintervalSetEmpty(), and SCIP_Interval::sup.
|
static |
estimates a multilinear function of the form \( f(x) := a \prod_{i = 1}^n x_i \)
\( x_i \) are the auxiliary variables of the children. If !overestimate, then we look for an affine underestimator of \( f(x) \) which has a value above targetvalue at \( x^* \), i.e., \( g(x) := \alpha^T x + \beta \le f(x)\) for all \( x \) in the domain, such that \( \alpha x^* + \beta > \text{targetvalue}\).
Since \( f(x) \) is componentwise linear, its convex envelope is piecewise linear and its value can be computed by finding the largest affine underestimator. This is done either explicitly (if n=2) or by solving an LP, see SCIPcomputeFacetVertexPolyhedralNonlinear().
Definition at line 1884 of file expr_product.c.
References assert(), c, estimateVertexPolyhedralProduct(), exprnode::expr, EXPRHDLR_NAME, FALSE, SCIP_Interval::inf, MAX, MIN, NULL, SCIP_CALL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIP_Real, SCIPaddBilinMcCormick(), SCIPdebugMsg, SCIPdismantleExpr(), SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetData(), SCIPexprhdlrGetName(), SCIPintervalIsEmpty(), SCIPisInfinity(), SCIP_Interval::sup, and TRUE.
|
static |
initial estimators callback
Definition at line 1981 of file expr_product.c.
References assert(), estimateVertexPolyhedralProduct(), exprnode::expr, EXPRHDLR_NAME, SCIP_Interval::inf, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPaddBilinMcCormick(), SCIPdebugMsg, SCIPexprGetData(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrGetData(), SCIPexprhdlrGetName(), SCIPinfinity(), SCIP_Interval::sup, and TRUE.
|
static |
expression reverse propagation callback
! [SnippetExprReversepropProduct]
! [SnippetExprReversepropProduct]
Definition at line 2037 of file expr_product.c.
References assert(), exprnode::expr, FALSE, i, SCIP_Interval::inf, NULL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIPdebugMsg, SCIPexprGetData(), SCIPexprGetNChildren(), SCIPintervalIntersect(), SCIPintervalIsEmpty(), SCIPintervalIsEntire(), SCIPintervalMul(), SCIPintervalSet(), SCIPintervalSolveUnivariateQuadExpression(), SCIP_Interval::sup, and TRUE.
|
static |
expression curvature detection callback
Definition at line 2122 of file expr_product.c.
References assert(), exprnode::expr, FALSE, NULL, SCIP_OKAY, SCIPexprcurvMultiply(), SCIPexprGetNChildren(), SCIPgetCoefExprProduct(), and TRUE.
|
static |
expression monotonicity detection callback
Definition at line 2144 of file expr_product.c.
References assert(), exprnode::expr, i, NULL, result, SCIP_CALL, SCIP_MONOTONE_DEC, SCIP_MONOTONE_INC, SCIP_MONOTONE_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPevalExprActivity(), SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetCoefExprProduct(), SCIPintervalGetInf(), and SCIPintervalGetSup().
|
static |
expression integrality detection callback
Definition at line 2194 of file expr_product.c.
References assert(), EPSISINT, exprnode::expr, i, NULL, SCIP_OKAY, SCIPexprGetChildren(), SCIPexprGetData(), SCIPexprGetNChildren(), and SCIPexprIsIntegral().
|
static |
expression callback to get information for symmetry detection
Definition at line 2221 of file expr_product.c.
References assert(), exprnode::expr, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, and SCIPgetCoefExprProduct().