an algebraic expression used for nonlinear constraints and NLPs
void SCIPexprGetQuadraticData (SCIP_EXPR *expr, SCIP_Real *constant, int *nlinexprs, SCIP_EXPR ***linexprs, SCIP_Real **lincoefs, int *nquadexprs, int *nbilinexprs, SCIP_Real **eigenvalues, SCIP_Real **eigenvectors) void SCIPexprGetQuadraticQuadTerm (SCIP_EXPR *quadexpr, int termidx, SCIP_EXPR **expr, SCIP_Real *lincoef, SCIP_Real *sqrcoef, int *nadjbilin, int **adjbilin, SCIP_EXPR **sqrexpr) void SCIPexprGetQuadraticBilinTerm (SCIP_EXPR *expr, int termidx, SCIP_EXPR **expr1, SCIP_EXPR **expr2, SCIP_Real *coef, int *pos2, SCIP_EXPR **prodexpr) SCIP_Bool SCIPexprAreQuadraticExprsVariables (SCIP_EXPR *expr)More details on the DFS mode: Many algorithms over expression trees need to traverse the tree in depth-first manner and a natural way of implementing these algorithms is by using recursion. In general, a function which traverses the tree in depth-first looks like
fun( expr ) enterexpr() continue skip or abort for( child in expr->children ) visitingchild() continue skip or abort fun(child, data, proceed) visitedchild() continue skip or abort leaveexpr()
Given that some expressions might be quite deep we provide this functionality in an iterative fashion.
Consider an expression (x*y) + z + log(x-y). The corresponding expression graph is
[+] / | \ [*] | [log] / \ | | / \ | [-] | | | / \ [x] [y] [z] [x] [y]
(where [x] and [y] are actually the same expression).
If a pointer to the [+] expression is given as root to this expression, it will iterate the graph in a depth-first manner and stop at various stages.
Thus, for the above expression, the expression are visited in the following order and stages:
enterexpr([+])
visitingchild([+])
, currentchild = 0enterexpr([*])
visitingchild([*])
, currentchild = 0enterexpr([x])
leaveexpr([x])
visitedchild([*])
, currentchild = 0visitingchild([*])
, currentchild = 1enterexpr([y])
leaveexpr([y])
visitedchild([*])
, currentchild = 1leaveexpr([*])
visitedchild([+])
, currentchild = 0visitingchild([+])
, currentchild = 1enterexpr([z])
leaveexpr([z])
visitedchild([+])
, currentchild = 1visitingchild([+])
, currentchild = 2enterexpr([log])
visitingchild([log])
, currentchild = 0enterexpr([-])
visitingchild([-])
, currentchild = 0enterexpr([x])
leaveexpr([x])
visitedchild([-])
, currentchild = 0visitingchild([-])
, currentchild = 1enterexpr([y])
leaveexpr([y])
visitedchild([-])
, currentchild = 1leaveexpr([-])
visitedchild([log])
, currentchild = 0leaveexpr([log])
visitedchild([+])
currentchild = 2leaveexpr([+])
The caller can direct the iterator to skip parts of the tree:
Given a function, say, \(f(s(x,y),t(x,y))\) there is a common mnemonic technique to compute its partial derivatives, using a tree diagram. Suppose we want to compute the partial derivative of \(f\) w.r.t. \(x\). Write the function as a tree:
f |-----| s t |--| |--| x y x y
The weight of an edge between two nodes represents the partial derivative of the parent w.r.t. the children, e.g.,
f | s
is \( \partial_sf \). The weight of a path is the product of the weight of the edges in the path. The partial derivative of \(f\) w.r.t. \(x\) is then the sum of the weights of all paths connecting \(f\) with \(x\):
\[ \frac{\partial f}{\partial x} = \partial_s f \cdot \partial_x s + \partial_t f \cdot \partial_x t. \]
We follow this method in order to compute the gradient of an expression (root) at a given point (point). Note that an expression is a DAG representation of a function, but there is a 1-1 correspondence between paths in the DAG and path in a tree diagram of a function. Initially, we set root->derivative
to 1.0. Then, traversing the tree in Depth First (see SCIPexpriterInit), for every expr that has children, we store in its i-th child, child[i]->derivative
, the derivative of expr w.r.t. child evaluated at point multiplied with expr->derivative
.
For example:
f->derivative
= 1.0s->derivative
= \(\partial_s f \,\cdot\) f->derivative
= \(\partial_s f\)x->derivative
= \(\partial_x s \,\cdot\) s->derivative
= \(\partial_x s \cdot \partial_s f\)However, when the child is a variable expressions, we actually need to initialize child->derivative
to 0.0 and afterwards add, instead of overwrite the computed value. The complete example would then be:
f->derivative
= 1.0, x->derivative
= 0.0, y->derivative
= 0.0s->derivative
= \(\partial_s f \,\cdot\) f->derivative
= \(\partial_s f\)x->derivative
+= \(\partial_x s \,\cdot\) s->derivative
= \(\partial_x s \cdot \partial_s f\)y->derivative
+= \(\partial_y s \,\cdot\) s->derivative
= \(\partial_y s \cdot \partial_s f\)t->derivative
= \(\partial_t f \,\cdot\) f->derivative
= \(\partial_t f\)x->derivative
+= \(\partial_x t \,\cdot\) t->derivative
= \(\partial_x t \cdot \partial_t f\)y->derivative
+= \(\partial_y t \,\cdot\) t->derivative
= \(\partial_y t \cdot \partial_t f\)Note that, to compute this, we only need to know, for each expression, its partial derivatives w.r.t a given child at a point. This is what the callback SCIP_DECL_EXPRBWDIFF
should return. Indeed, from "derivative of expr w.r.t. child evaluated at point multiplied with expr->derivative", note that at the moment of processing a child, we already know expr->derivative
, so the only missing piece of information is "the derivative of expr w.r.t. child evaluated at point".
An equivalent way of interpreting the procedure is that expr->derivative
stores the derivative of the root w.r.t. expr. This way, x->derivative
and y->derivative
will contain the partial derivatives of root w.r.t. the variable, that is, the gradient. Note, however, that this analogy is only correct for leave expressions, since the derivative value of an intermediate expression gets overwritten.
Computing the Hessian is more complicated since it is the derivative of the gradient, which is a function with more than one output. We compute the Hessian by computing "directions" of the Hessian, that is \(H\cdot u\) for different \(u\). This is easy in general, since it is the gradient of the scalar function \(\nabla f u\), that is, the directional derivative of \(f\) in the direction \(u\): \(D_u f\).
This is easily computed via the so called forward mode. Just as expr->derivative
stores the partial derivative of the root w.r.t. expr, expr->dot
stores the directional derivative of expr in the direction \(u\). Then, by the chain rule, expr->dot
= \(\sum_{c:\text{children}} \partial_c \text{expr} \,\cdot\) c->dot
.
Starting with x[i]->dot
= \(u_i\), we can compute expr->dot
for every expression at the same time we evaluate expr. Computing expr->dot
is the purpose of the callback SCIP_DECL_EXPRFWDIFF
. Obviously, when this callback is called, the "dots" of all children are known (just like evaluation, where the value of all children are known).
Once we have this information, we compute the gradient of this function, following the same idea as before. We define expr->bardot
to be the directional derivative in direction \(u\) of the partial derivative of the root w.r.t expr
, that is \(D_u (\partial_{\text{expr}} f) = D_u\) (expr->derivative
).
This way, x[i]->bardot
= \(D_u (\partial_{x_i} f) = e_i^T H_f u\). Hence vars->bardot
contain \(H_f u\). By the chain rule, product rule, and definition we have
\begin{eqnarray*} \texttt{expr->bardot} & = & D_u (\partial_{\text{expr}} f) \\ & = & D_u ( \partial_{\text{parent}} f \cdot \partial_{\text{expr}} \text{parent} ) \\ & = & D_u ( \texttt{parent->derivative} \cdot \partial_{\text{expr}} \text{parent} ) \\ & = & \partial_{\text{expr}} \text{parent} \cdot D_u (\texttt{parent->derivative}) + \texttt{parent->derivative} \cdot D_u (\partial_{\text{expr}} \text{parent}) \\ & = & \texttt{parent->bardot} \cdot \partial_{\text{expr}} \text{parent} + \texttt{parent->derivative} \cdot D_u (\partial_{\text{expr}} \text{parent}) \end{eqnarray*}
Note that we have computed parent->bardot
and parent->derivative
at this point, while \(\partial_{\text{expr}} \text{parent}\) is the return of SCIP_DECL_EXPRBWDIFF
. Hence the only information we need to compute is \(D_u (\partial_{\text{expr}} \text{parent})\). This is the purpose of the callback SCIP_DECL_EXPRBWFWDIFF
.
gives the number of children of an expression
Definition at line 3860 of file expr.c.
References SCIP_Expr::nchildren, and NULL.
Referenced by addSymmetryInformation(), bilinboundGetX(), bilinboundGetY(), bilinearTermsInsertAll(), buildQuadExprMatrix(), checkAndCollectQuadratic(), collectLeafs(), computeEstimatorsTrig(), computeInitialCutsTrig(), constructExpr(), createNlhdlrExprData(), createNlRow(), DECL_CURVCHECK(), detectExpr(), detectMinors(), detectSocNorm(), detectSocQuadraticComplex(), detectSocQuadraticSimple(), doBfsNext(), doReverseTopologicalNext(), enforceSP11(), enforceSP12(), enforceSP12b(), eval(), evalExprInAux(), exprIsMultivarLinear(), exprIsSemicontinuous(), findUnlockedLinearVar(), forbidNonlinearVariablesMultiaggration(), forwardPropExpr(), getBilinearBinaryTerms(), getBinaryProductExpr(), getBinaryProductExprDo(), getExprSize(), getFactorizedBinaryQuadraticExpr(), getFeasiblePointsBilinear(), hashExpr(), initBounds(), intevalBilinear(), isBinaryProduct(), isExprPolynomial(), isExprSignomial(), isPackingCons(), nlhdlrExprCreate(), nlhdlrExprGrowChildren(), presolveImplint(), presolveSingleLockedVars(), printRowNl(), printSignomial(), propagateLocks(), readConstraints(), readObjective(), replaceBinaryProducts(), reversePropBilinear(), reversePropQueue(), scaleConsSides(), SCIP_DECL_EXPRBWDIFF(), SCIP_DECL_EXPRBWFWDIFF(), SCIP_DECL_EXPRCOMPARE(), SCIP_DECL_EXPRCOPYDATA(), SCIP_DECL_EXPRCURVATURE(), SCIP_DECL_EXPRESTIMATE(), SCIP_DECL_EXPREVAL(), SCIP_DECL_EXPRFWDIFF(), SCIP_DECL_EXPRHASH(), SCIP_DECL_EXPRINITESTIMATES(), SCIP_DECL_EXPRINTEGRALITY(), SCIP_DECL_EXPRINTEVAL(), SCIP_DECL_EXPRMONOTONICITY(), SCIP_DECL_EXPRREVERSEPROP(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLREVALAUX(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRREVERSEPROP(), SCIP_DECL_NLHDLRSOLLINEARIZE(), SCIP_DECL_NONLINCONSUPGD(), SCIPaddIneqBilinear(), SCIPappendExprSumExpr(), SCIPcomputeExprCurvature(), SCIPcomputeExprIntegrality(), SCIPexprCheckQuadratic(), SCIPexprGetMonomialData(), SCIPexprintCompile(), SCIPisExprVaridx(), SCIPmultiplyByConstantExprSum(), SCIPmultiplyBySumExprSum(), SCIPpowerExprSum(), SCIPregisterExprUsageNonlinear(), SCIPtightenExprIntervalNonlinear(), simplifyFactor(), simplifyTerm(), transformExpr(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperator(), tryAddGadgetEvenOperatorSum(), and tryAddGadgetSquaredDifference().
◆ SCIPexprGetChildren()gives the children of an expression (can be NULL if no children)
Definition at line 3870 of file expr.c.
References SCIP_Expr::children, and NULL.
Referenced by addSymmetryInformation(), bilinboundGetX(), bilinboundGetY(), bilinearTermsInsertAll(), buildQuadExprMatrix(), checkAndCollectQuadratic(), constructExpr(), createNlhdlrExprData(), createNlRow(), DECL_CURVCHECK(), detectExpr(), detectMinors(), detectSocNorm(), detectSocQuadraticSimple(), doBfsNext(), doReverseTopologicalNext(), enforceSP11(), enforceSP12(), enforceSP12b(), eval(), evalExprInAux(), exprIsMultivarLinear(), exprIsSemicontinuous(), findUnlockedLinearVar(), forbidNonlinearVariablesMultiaggration(), getBilinearBinaryTerms(), getBinaryProductExpr(), getBinaryProductExprDo(), getExprSize(), getFactorizedBinaryQuadraticExpr(), getFeasiblePointsBilinear(), hashExpr(), initBounds(), intevalBilinear(), isBinaryProduct(), isExprPolynomial(), isExprSignomial(), isPackingCons(), mergeProductExprlist(), nlhdlrExprGrowChildren(), presolveImplint(), presolveSingleLockedVars(), printRowNl(), printSignomial(), readConstraints(), readObjective(), reversePropBilinear(), reversePropQueue(), scaleConsSides(), SCIP_DECL_EXPRBWDIFF(), SCIP_DECL_EXPRBWFWDIFF(), SCIP_DECL_EXPRCOMPARE(), SCIP_DECL_EXPRCURVATURE(), SCIP_DECL_EXPRESTIMATE(), SCIP_DECL_EXPREVAL(), SCIP_DECL_EXPRFWDIFF(), SCIP_DECL_EXPRGETSYMDATA(), SCIP_DECL_EXPRINITESTIMATES(), SCIP_DECL_EXPRINTEGRALITY(), SCIP_DECL_EXPRINTEVAL(), SCIP_DECL_EXPRMONOTONICITY(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLREVALAUX(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRREVERSEPROP(), SCIP_DECL_NLHDLRSOLLINEARIZE(), SCIP_DECL_NONLINCONSUPGD(), SCIPaddIneqBilinear(), SCIPcomputeExprCurvature(), SCIPexprCheckQuadratic(), SCIPexprGetMonomialData(), SCIPexprintCompile(), SCIPmultiplyBySumExprSum(), SCIPpowerExprSum(), simplifyFactor(), simplifyTerm(), transformExpr(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperator(), tryAddGadgetEvenOperatorSum(), and tryAddGadgetSquaredDifference().
◆ SCIPexprGetHdlr()gets the expression handler of an expression
This identifies the type of the expression (sum, variable, ...).
Definition at line 3883 of file expr.c.
References SCIP_Expr::exprhdlr, and NULL.
Referenced by addSymmetryInformation(), computeEstimatorsTrig(), computeInitialCutsTrig(), constructExpr(), createAuxVar(), DECL_CURVCHECK(), detectNlhdlr(), enforceExpr(), enforceSP11(), eval(), exprIsNonSmooth(), forwardPropExpr(), hashExpr(), printExpr(), propagateLocks(), reversePropQueue(), SCIP_DECL_EXPRBWDIFF(), SCIP_DECL_EXPRBWFWDIFF(), SCIP_DECL_EXPRCURVATURE(), SCIP_DECL_EXPRESTIMATE(), SCIP_DECL_EXPRFWDIFF(), SCIP_DECL_EXPRINITESTIMATES(), SCIP_DECL_EXPRINTEVAL(), SCIP_DECL_EXPRMONOTONICITY(), SCIP_DECL_EXPRPRINT(), SCIP_DECL_EXPRREVERSEPROP(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRREVERSEPROP(), SCIP_DECL_NLHDLRSOLLINEARIZE(), SCIPcallExprEval(), SCIPcallExprEvalFwdiff(), SCIPcomputeExprCurvature(), SCIPcomputeExprIntegrality(), SCIPexprGetSymData(), SCIPexprintCompile(), SCIPexprPrint(), SCIPgetCoefSymData(), SCIPgetIndexExprVaridx(), SCIPgetVarExprVar(), SCIPisExprAbs(), SCIPisExprCos(), SCIPisExprEntropy(), SCIPisExprErf(), SCIPisExprExp(), SCIPisExprLog(), SCIPisExprSignpower(), SCIPisExprSin(), SCIPisExprVaridx(), SCIPsetIndexExprVaridx(), SCIPtightenExprIntervalNonlinear(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperatorSum(), and tryAddGadgetEvenOperatorVariable().
◆ SCIPexprGetData()gets the expression data of an expression
Definition at line 3893 of file expr.c.
References SCIP_Expr::exprdata, and NULL.
Referenced by SCIP_DECL_EXPRBWDIFF(), SCIP_DECL_EXPRBWFWDIFF(), SCIP_DECL_EXPRCOMPARE(), SCIP_DECL_EXPRCOPYDATA(), SCIP_DECL_EXPRCURVATURE(), SCIP_DECL_EXPRESTIMATE(), SCIP_DECL_EXPREVAL(), SCIP_DECL_EXPRFREEDATA(), SCIP_DECL_EXPRFWDIFF(), SCIP_DECL_EXPRGETSYMDATA(), SCIP_DECL_EXPRHASH(), SCIP_DECL_EXPRINITESTIMATES(), SCIP_DECL_EXPRINTEGRALITY(), SCIP_DECL_EXPRINTEVAL(), SCIP_DECL_EXPRMONOTONICITY(), SCIP_DECL_EXPRPRINT(), SCIP_DECL_EXPRREVERSEPROP(), SCIPappendExprSumExpr(), SCIPgetCoefExprProduct(), SCIPgetCoefsExprSum(), SCIPgetConstantExprSum(), SCIPgetExponentExprPow(), SCIPgetIndexExprVaridx(), SCIPgetValueExprValue(), SCIPgetVarExprVar(), SCIPmultiplyByConstantExprSum(), and SCIPsetConstantExprSum().
◆ SCIPexprSetData() ◆ SCIPexprGetOwnerData()gets the data that the owner of an expression has stored in an expression
Definition at line 3921 of file expr.c.
References NULL, and SCIP_Expr::ownerdata.
Referenced by addExprsViolScore(), analyzeViolation(), canonicalizeConstraints(), catchVarEvent(), collectBranchingCandidates(), createAuxVar(), detectNlhdlr(), detectNlhdlrs(), dropVarEvent(), enforceConstraint(), enforceExpr(), forwardPropExpr(), freeAuxVar(), freeEnfoData(), getExprAbsAuxViolation(), getExprAbsOrigViolation(), initSepa(), isSingleLockedCand(), notifyNlhdlrNewsol(), propagateLocks(), propConss(), propExprDomains(), registerBranchingCandidates(), reversePropQueue(), SCIP_DECL_CONSLOCK(), SCIP_DECL_EVENTEXEC(), SCIPaddExprsViolScoreNonlinear(), SCIPaddExprViolScoreNonlinear(), SCIPgetExprAuxVarNonlinear(), SCIPgetExprBoundsNonlinear(), SCIPgetExprEnfoDataNonlinear(), SCIPgetExprNAuxvarUsesNonlinear(), SCIPgetExprNEnfosNonlinear(), SCIPgetExprNLocksNegNonlinear(), SCIPgetExprNLocksPosNonlinear(), SCIPgetExprNPropUsesActivityNonlinear(), SCIPgetExprNSepaUsesActivityNonlinear(), SCIPgetExprPartialDiffGradientDirNonlinear(), SCIPgetExprPartialDiffNonlinear(), SCIPgetExprViolScoreNonlinear(), SCIPgetNlhdlrExprDataNonlinear(), SCIPmarkExprPropagateNonlinear(), SCIPregisterExprUsageNonlinear(), SCIPsetExprEnfoAuxValueNonlinear(), and SCIPtightenExprIntervalNonlinear().
◆ SCIPexprGetEvalValue()gives the value from the last evaluation of an expression (or SCIP_INVALID if there was an eval error)
Definition at line 3934 of file expr.c.
References SCIP_Expr::evalvalue, and NULL.
Referenced by analyzeViolation(), computeOffValues(), computeViolation(), createAuxVar(), AMPLProblemHandler::EndInput(), enforceExpr(), estimateConvexSecant(), estimateGradientInner(), generateCut(), getConsRelViolation(), getExprAbsOrigViolation(), notifyNlhdlrNewsol(), SCIP_DECL_EXPRBWDIFF(), SCIP_DECL_EXPRBWFWDIFF(), SCIP_DECL_EXPREVAL(), SCIP_DECL_EXPRFWDIFF(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLREVALAUX(), SCIP_DECL_VERTEXPOLYFUN(), SCIPexprEvalGradient(), SCIPexprintEval(), SCIPgetExprActivityNonlinear(), SCIPnlrowGetSolActivity(), SCIPnlrowRecalcNLPActivity(), and SCIPnlrowRecalcPseudoActivity().
◆ SCIPexprGetEvalTag() ◆ SCIPexprGetDerivative() ◆ SCIPexprGetDot() ◆ SCIPexprGetBardot() ◆ SCIPexprGetDiffTag() ◆ SCIPexprGetActivity()returns the activity that is currently stored for an expression
Definition at line 4016 of file expr.c.
References SCIP_Expr::activity, and NULL.
Referenced by analyzeViolation(), createAuxVar(), DECL_CURVCHECK(), detectSocQuadraticComplex(), detectSocQuadraticSimple(), enforceExpr(), estimateBivariateQuotient(), estimateUnivariateQuotient(), forwardPropExpr(), getFeasiblePointsBilinear(), intevalBilinear(), nlrowCalcActivityBounds(), presolveRedundantConss(), propConss(), propExprDomains(), reversePropagateLinearExpr(), reversePropBilinear(), reversePropQueue(), SCIP_DECL_EXPRCURVATURE(), SCIP_DECL_EXPRINTEVAL(), SCIP_DECL_EXPRMONOTONICITY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRINTEVAL(), SCIPgetExprBoundsNonlinear(), SCIPtightenExprIntervalNonlinear(), and tryFillNlhdlrExprDataQuad().
◆ SCIPexprGetActivityTag() ◆ SCIPexprSetActivity() ◆ SCIPexprGetCurvature() ◆ SCIPexprSetCurvature() ◆ SCIPexprIsIntegral() ◆ SCIPexprSetIntegrality() ◆ SCIPexprGetQuadraticData()gives the coefficients and expressions that define a quadratic expression
It can return the constant part, the number, arguments, and coefficients of the purely linear part and the number of quadratic terms and bilinear terms. Note that for arguments that appear in the quadratic part, a linear coefficient is stored with the quadratic term. Use SCIPexprGetQuadraticQuadTerm() and SCIPexprGetQuadraticBilinTerm() to access the data for a quadratic or bilinear term.
It can also return the eigenvalues and the eigenvectors of the matrix \(Q\) when the quadratic is written as \(x^T Q x + b^T x + c^T y + d\), where \(c^T y\) defines the purely linear part. Note, however, that to have access to them one needs to call SCIPcomputeExprQuadraticCurvature() with storeeigeninfo=TRUE
. If the eigen information was not stored or it failed to be computed, eigenvalues
and eigenvectors
will be set to NULL.
This function returns pointers to internal data in linexprs and lincoefs. The user must not change this data.
Definition at line 4119 of file expr.c.
References SCIP_QuadExpr::constant, SCIP_QuadExpr::eigenvalues, SCIP_QuadExpr::eigenvectors, SCIP_QuadExpr::lincoefs, SCIP_QuadExpr::linexprs, SCIP_QuadExpr::nbilinexprterms, SCIP_QuadExpr::nlinexprs, SCIP_QuadExpr::nquadexprs, NULL, and SCIP_Expr::quaddata.
Referenced by checkConsQuadraticProblem(), computeApex(), computeIntercut(), computeMonoidalQuadCoefs(), computeMonoidalStrengthCoef(), computeRestrictionToLine(), computeRestrictionToRay(), computeVApexAndVRay(), computeWRayLinear(), constructLPPos2ConsPosMap(), countBasicVars(), createMIP(), createTcliqueGraph(), DECL_CURVCHECK(), doSeachEcAggr(), findAndStoreEcAggregations(), findVertexAndGetRays(), generateIntercut(), intercutsComputeCommonQuantities(), isCandidate(), isPropagable(), isQuadConsViolated(), isRayInStrip(), nlrowaggrCreate(), presolveAddKKTQuadBilinearTerms(), presolveAddKKTQuadLinearTerms(), presolveAddKKTQuadQuadraticTerms(), printRow(), processNlRow(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLREVALAUX(), SCIP_DECL_NLHDLRFREEEXPRDATA(), SCIP_DECL_NLHDLRINTEVAL(), SCIP_DECL_NLHDLRREVERSEPROP(), SCIP_DECL_NONLINCONSUPGD(), SCIPevalExprQuadratic(), SCIPevalExprQuadraticAuxNonlinear(), SCIPprintExprQuadratic(), SCIPwriteMps(), searchEcAggrWithCliques(), storeAggrFromMIP(), storeDenseTableauRowsByColumns(), and updateMIP().
◆ SCIPexprGetQuadraticQuadTerm()gives the data of a quadratic expression term
For a term \(a \cdot \text{expr}^2 + b \cdot \text{expr} + \sum_i (c_i \cdot \text{expr} \cdot \text{otherexpr}_i)\), returns expr
, \(a\), \(b\), the number of summands, and indices of bilinear terms in the quadratic expressions bilinexprterms
.
This function returns pointers to internal data in adjbilin. The user must not change this data.
Definition at line 4164 of file expr.c.
References SCIP_QuadExpr_QuadTerm::adjbilin, SCIP_QuadExpr_QuadTerm::expr, SCIP_QuadExpr_QuadTerm::lincoef, SCIP_QuadExpr_QuadTerm::nadjbilin, NULL, SCIP_Expr::quaddata, SCIP_QuadExpr::quadexprterms, SCIP_QuadExpr_QuadTerm::sqrcoef, and SCIP_QuadExpr_QuadTerm::sqrexpr.
Referenced by constructLPPos2ConsPosMap(), countBasicVars(), createMIP(), createTcliqueGraph(), DECL_CURVCHECK(), doSeachEcAggr(), findVertexAndGetRays(), intercutsComputeCommonQuantities(), isCandidate(), isPropagable(), isPropagableTerm(), isQuadConsViolated(), nlrowaggrCreate(), presolveAddKKTQuadLinearTerms(), presolveAddKKTQuadQuadraticTerms(), printRow(), processNlRow(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLREVALAUX(), SCIP_DECL_NLHDLRINTEVAL(), SCIP_DECL_NLHDLRREVERSEPROP(), SCIP_DECL_NONLINCONSUPGD(), SCIPevalExprQuadratic(), SCIPevalExprQuadraticAuxNonlinear(), SCIPprintExprQuadratic(), SCIPwriteMps(), searchEcAggrWithCliques(), storeAggrFromMIP(), storeDenseTableauRowsByColumns(), and updateMIP().
◆ SCIPexprGetQuadraticBilinTerm()gives the data of a bilinear expression term
For a term a*expr1*expr2, returns expr1, expr2, a, and the position of the quadratic expression term that uses expr2 in the quadratic expressions quadexprterms
.
Definition at line 4204 of file expr.c.
References SCIP_QuadExpr::bilinexprterms, SCIP_QuadExpr_BilinTerm::coef, SCIP_QuadExpr_BilinTerm::expr1, SCIP_QuadExpr_BilinTerm::expr2, NULL, SCIP_QuadExpr_BilinTerm::pos2, SCIP_QuadExpr_BilinTerm::prodexpr, and SCIP_Expr::quaddata.
Referenced by createMIP(), createTcliqueGraph(), isCandidate(), isQuadConsViolated(), nlrowaggrCreate(), presolveAddKKTQuadBilinearTerms(), printRow(), processNlRow(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLREVALAUX(), SCIP_DECL_NLHDLRINTEVAL(), SCIP_DECL_NLHDLRREVERSEPROP(), SCIP_DECL_NONLINCONSUPGD(), SCIPevalExprQuadratic(), SCIPevalExprQuadraticAuxNonlinear(), SCIPprintExprQuadratic(), SCIPwriteMps(), searchEcAggrWithCliques(), storeAggrFromMIP(), and updateMIP().
◆ SCIPexprAreQuadraticExprsVariables() ◆ SCIPgetVarExprVar()gets the variable of a variable expression
Definition at line 416 of file expr_var.c.
References EXPRHDLR_NAME, NULL, SCIPexprGetData(), SCIPexprGetHdlr(), and SCIPexprhdlrGetName().
Referenced by addSymmetryInformation(), analyzeViolation(), buildQuadExprMatrix(), catchVarEvent(), catchVarEvents(), checkAndCollectQuadratic(), collectBranchingCandidates(), collectLeafs(), computeGradient(), computeOffValues(), createMIP(), createNlRow(), createTcliqueGraph(), detectSocNorm(), detectSocQuadraticSimple(), doSeachEcAggr(), dropVarEvent(), enforceConstraints(), estimateConvexSecant(), estimateGradient(), estimateGradientInner(), estimateVertexPolyhedral(), exprIsSemicontinuous(), findUnlockedLinearVar(), forbidNonlinearVariablesMultiaggration(), forwardPropExpr(), generateCut(), getBilinearBinaryTerms(), getBinaryProductExpr(), getBinaryProductExprDo(), isBinaryProduct(), isCandidate(), isPackingCons(), isSingleLockedCand(), nlpAddNlRows(), nlpDelVarPos(), nlrowaggrCreate(), notifyNlhdlrNewsol(), presolveAddKKTQuadBilinearTerms(), presolveAddKKTQuadLinearTerms(), presolveAddKKTQuadQuadraticTerms(), presolveImplint(), presolveRedundantConss(), presolveSingleLockedVars(), printExpr(), printRow(), printSignomial(), processNlRow(), propagateLocks(), readConstraints(), readObjective(), registerBranchingCandidates(), registerBranchingCandidatesAllUnfixed(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSGETVARS(), SCIP_DECL_EXPR_MAPEXPR(), SCIP_DECL_EXPR_OWNERCREATE(), SCIP_DECL_EXPR_OWNERFREE(), SCIP_DECL_EXPRCOMPARE(), SCIP_DECL_EXPRCOPYDATA(), SCIP_DECL_EXPREVAL(), SCIP_DECL_EXPRFWDIFF(), SCIP_DECL_EXPRHASH(), SCIP_DECL_EXPRINTEGRALITY(), SCIP_DECL_EXPRINTEVAL(), SCIP_DECL_EXPRPRINT(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NONLINCONSUPGD(), SCIP_DECL_VERTEXPOLYFUN(), SCIPaddNlRowGradientBenderscutOpt(), SCIPevalExprQuadratic(), SCIPexprComputeQuadraticCurvature(), SCIPexprDismantle(), SCIPgetExprAuxVarNonlinear(), SCIPisSOCNonlinear(), SCIPnlpGetVarsNonlinearity(), SCIPnlpHasContinuousNonlinearity(), SCIPwriteMps(), storeVarExprs(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperatorSum(), tryAddGadgetEvenOperatorVariable(), and tryAddGadgetSquaredDifference().
◆ SCIPgetValueExprValue()gets the value of a constant value expression
Definition at line 294 of file expr_value.c.
References NULL, and SCIPexprGetData().
Referenced by addSymmetryInformation(), canonicalizeConstraints(), eval(), nlrowSimplifyExpr(), AMPLProblemHandler::OnBinary(), AMPLProblemHandler::OnObj(), parseExpr(), presolveRedundantConss(), printSignomial(), readExpression(), SCIP_DECL_EXPRSIMPLIFY(), SCIPexprDismantle(), simplifyFactor(), and simplifyTerm().
◆ SCIPgetCoefsExprSum()gets the coefficients of a summation expression
Definition at line 1552 of file expr_sum.c.
References NULL, and SCIPexprGetData().
Referenced by addSymmetryInformation(), buildQuadExprMatrix(), createNlRow(), DECL_CURVCHECK(), detectExpr(), detectSocNorm(), detectSocQuadraticSimple(), enforceSP12(), enforceSP12b(), eval(), findUnlockedLinearVar(), getFactorizedBinaryQuadraticExpr(), presolveImplint(), presolveSingleLockedVars(), printRowNl(), readConstraints(), readObjective(), scaleConsSides(), SCIP_DECL_EXPRBWDIFF(), SCIP_DECL_EXPRCOMPARE(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLREVALAUX(), SCIP_DECL_NONLINCONSUPGD(), SCIPexprCheckQuadratic(), SCIPexprCompare(), SCIPexprDismantle(), SCIPmultiplyBySumExprSum(), SCIPpowerExprSum(), simplifyFactor(), simplifyTerm(), transformExpr(), tryAddGadgetEvenOperatorSum(), and tryAddGadgetSquaredDifference().
◆ SCIPgetConstantExprSum()gets the constant of a summation expression
Definition at line 1567 of file expr_sum.c.
References NULL, and SCIPexprGetData().
Referenced by addSymmetryInformation(), createNlRow(), DECL_CURVCHECK(), detectExpr(), detectSocNorm(), detectSocQuadraticComplex(), detectSocQuadraticSimple(), enforceSP12(), enforceSP12b(), eval(), getFactorizedBinaryQuadraticExpr(), presolveImplint(), printRowNl(), readConstraints(), readObjective(), scaleConsSides(), SCIP_DECL_EXPRCOMPARE(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLREVALAUX(), SCIP_DECL_NONLINCONSUPGD(), SCIPexprCheckQuadratic(), SCIPexprDismantle(), SCIPmultiplyBySumExprSum(), SCIPpowerExprSum(), simplifyFactor(), simplifyTerm(), transformExpr(), and tryAddGadgetEvenOperatorSum().
◆ SCIPgetCoefExprProduct()gets the constant coefficient of a product expression
Definition at line 2301 of file expr_product.c.
References exprnode::expr, NULL, and SCIPexprGetData().
Referenced by DECL_CURVCHECK(), detectExpr(), eval(), getFeasiblePointsBilinear(), intevalBilinear(), isBinaryProduct(), printSignomial(), reversePropBilinear(), SCIP_DECL_EXPRCOMPARE(), SCIP_DECL_EXPRCURVATURE(), SCIP_DECL_EXPRGETSYMDATA(), SCIP_DECL_EXPRMONOTONICITY(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLREVALAUX(), SCIPexprCheckQuadratic(), SCIPexprDismantle(), SCIPexprGetMonomialData(), and simplifyFactor().
◆ SCIPgetExponentExprPow()gets the exponent of a power or signed power expression
Definition at line 3456 of file expr_pow.c.
References NULL, and SCIPexprGetData().
Referenced by bilinearTermsInsertAll(), buildQuadExprMatrix(), checkAndCollectQuadratic(), DECL_CURVCHECK(), detectExpr(), detectMinors(), detectSocNorm(), detectSocQuadraticSimple(), eval(), evalSignPower(), isPackingCons(), mergeProductExprlist(), presolveSingleLockedVars(), printExpr(), printSignomial(), SCIP_DECL_EXPRBWDIFF(), SCIP_DECL_EXPRBWFWDIFF(), SCIP_DECL_EXPRCOMPARE(), SCIP_DECL_EXPRCURVATURE(), SCIP_DECL_EXPRESTIMATE(), SCIP_DECL_EXPREVAL(), SCIP_DECL_EXPRFWDIFF(), SCIP_DECL_EXPRINTEGRALITY(), SCIP_DECL_EXPRINTEVAL(), SCIP_DECL_EXPRMONOTONICITY(), SCIP_DECL_EXPRPRINT(), SCIP_DECL_EXPRREVERSEPROP(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLREVALAUX(), SCIPexprCheckQuadratic(), SCIPexprCompare(), SCIPexprDismantle(), SCIPexprGetMonomialData(), and SCIPexprintCompile().
◆ SCIPexpriterIsInit() ◆ SCIPexpriterInit()initializes an expression iterator
expr
is NULL, then iterator will be set into ended-state (SCIPexpriterIsEnd() is TRUE). Useful if following with SCIPexpriterRestartDFS().
If type is DFS, then stopstages
will be set to SCIP_EXPRITER_ENTEREXPR. Use SCIPexpriterSetStagesDFS
to change this.
Definition at line 501 of file expriter.c.
References SCIP_ExprIter::curr, deinit(), SCIP_ExprIter::dfsstage, ensureStackSize(), SCIP_Stat::exprlastvisitedtag, SCIP_ExprIter::initialized, SCIP_Expr::iterdata, SCIP_ExprIter::iterindex, SCIP_ExprIter::itertype, MINBFSSIZE, MINDFSSIZE, SCIP_Stat::nactiveexpriter, NULL, printBacktraces(), SCIP_ExprIter::queue, reverseTopologicalInsert(), SCIP_CALL, SCIP_EXPRITER_BFS, SCIP_EXPRITER_DFS, SCIP_EXPRITER_ENTEREXPR, SCIP_EXPRITER_MAXNACTIVE, SCIP_EXPRITER_RTOPOLOGIC, SCIP_MAXDEPTHLEVEL, SCIP_OKAY, SCIPerrorMessage, SCIPexpriterGetNext(), SCIPqueueClear(), SCIPqueueCreate(), SCIPqueueInsert(), SCIP_ExprIter::stat, SCIP_ExprIter::stopstages, storeBacktrace, SCIP_Stat::subscipdepth, TRUE, and SCIP_ExprIter::visitedtag.
Referenced by addExprViolScoresAuxVars(), addSymmetryInformation(), analyzeViolation(), bilinearTermsInsertAll(), canonicalizeConstraints(), collectBranchingCandidates(), collectLeafs(), computeGradient(), computeOffValues(), constructExpr(), createNlhdlrExprData(), deinitSolve(), detectMinors(), detectNlhdlrs(), enforceConstraints(), evalAndDiff(), exprIsNonSmooth(), exprIsSemicontinuous(), forbidNonlinearVariablesMultiaggration(), forwardPropExpr(), generateCut(), initSepa(), nlpAddNlRows(), nlpDelVarPos(), notifyNlhdlrNewsol(), presolveBinaryProducts(), presolveSingleLockedVars(), printExpr(), processNlRow(), propagateLocks(), propConss(), propExprDomains(), registerBranchingCandidates(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_TABLEOUTPUT(), SCIPaddExprsViolScoreNonlinear(), SCIPaddNlRowGradientBenderscutOpt(), SCIPcomputeExprCurvature(), SCIPcomputeExprIntegrality(), SCIPcreateNlpiProblemFromNlRows(), SCIPexprCopy(), SCIPexprDismantle(), SCIPexprEval(), SCIPexprEvalActivity(), SCIPexprEvalGradient(), SCIPexprEvalHessianDir(), SCIPexprintCompile(), SCIPexprPrint(), SCIPexprPrintDot(), SCIPexprRelease(), SCIPexprSimplify(), SCIPgetExprNVars(), SCIPgetExprVarExprs(), SCIPhashExpr(), SCIPmarkExprPropagateNonlinear(), SCIPnlpGetVarsNonlinearity(), SCIPnlpHasContinuousNonlinearity(), SCIPnlpiOracleDelVarSet(), SCIPnlpiOracleGetJacobianSparsity(), SCIPregisterExprUsageNonlinear(), SCIPreplaceCommonSubexpressions(), and updateVariableCounts().
◆ SCIPexpriterRestartDFS()restarts an already initialized expression iterator in DFS mode
The expression iterator will continue from the given expression, not revisiting expressions that this iterator has already been visited (if initialized with allowrevisit=FALSE
) and giving access to the same iterator specified expression data that may have been set already. Also the stop-stages are not reset.
If revisiting is forbidden and given expr has already been visited, then the iterator will behave as on the end of iteration (SCIPexpriterIsEnd() is TRUE). If the enterexpr stage is not one of the stop stages, then the iterator will be moved forward (SCIPexpriterGetNext() is called).
Definition at line 630 of file expriter.c.
References SCIP_ExprIter::curr, SCIP_ExprIter::dfsstage, SCIP_ExprIter::initialized, SCIP_Expr::iterdata, SCIP_ExprIter::iterindex, SCIP_ExprIter::itertype, NULL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_ENTEREXPR, SCIPexpriterGetNext(), SCIP_ExprIter::stopstages, and SCIP_ExprIter::visitedtag.
Referenced by analyzeViolation(), bilinearTermsInsertAll(), collectBranchingCandidates(), deinitSolve(), detectMinors(), detectNlhdlrs(), enforceConstraint(), forbidNonlinearVariablesMultiaggration(), hashExpr(), initSepa(), notifyNlhdlrNewsol(), propExprDomains(), registerBranchingCandidates(), removeSingleLockedVars(), replaceBinaryProducts(), SCIPaddExprsViolScoreNonlinear(), SCIPnlpHasContinuousNonlinearity(), and SCIPnlpiOracleGetJacobianSparsity().
◆ SCIPexpriterSetStagesDFS()specifies in which stages to stop a DFS iterator
Parameter stopstages
should be a bitwise OR of different SCIP_EXPRITER_STAGE values
If the current stage is not one of the stopstages
, then the iterator will be moved on.
Definition at line 664 of file expriter.c.
References SCIP_ExprIter::dfsstage, NULL, SCIPexpriterGetNext(), and SCIP_ExprIter::stopstages.
Referenced by addSymmetryInformation(), bilinearTermsInsertAll(), collectLeafs(), constructExpr(), createNlhdlrExprData(), deinitSolve(), detectMinors(), evalAndDiff(), forwardPropExpr(), notifyNlhdlrNewsol(), presolveBinaryProducts(), presolveSingleLockedVars(), printExpr(), propagateLocks(), SCIP_DECL_CONSACTIVE(), SCIPcomputeExprCurvature(), SCIPcomputeExprIntegrality(), SCIPexprCopy(), SCIPexprDismantle(), SCIPexprEval(), SCIPexprEvalActivity(), SCIPexprEvalGradient(), SCIPexprEvalHessianDir(), SCIPexprPrint(), SCIPexprRelease(), SCIPexprSimplify(), SCIPhashExpr(), and SCIPreplaceCommonSubexpressions().
◆ SCIPexpriterGetCurrent()gets the current expression that the expression iterator points to
Definition at line 683 of file expriter.c.
References SCIP_ExprIter::curr, and NULL.
Referenced by addSymmetryInformation(), collectLeafs(), computeOffValues(), evalAndDiff(), exprIsSemicontinuous(), forwardPropExpr(), propagateLocks(), propConss(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_TABLEOUTPUT(), SCIPcomputeExprCurvature(), SCIPcomputeExprIntegrality(), SCIPexprEvalActivity(), SCIPexprEvalGradient(), SCIPexprEvalHessianDir(), SCIPexprintCompile(), SCIPexprRelease(), SCIPexprSimplify(), and SCIPreplaceCommonSubexpressions().
◆ SCIPexpriterGetStageDFS()gets the current stage that the expression iterator is in when using DFS
If the iterator has finished (SCIPexpriterIsEnd() is TRUE), then the stage is undefined.
Definition at line 696 of file expriter.c.
References SCIP_ExprIter::dfsstage, SCIP_ExprIter::itertype, NULL, and SCIP_EXPRITER_DFS.
Referenced by addSymmetryInformation(), forwardPropExpr(), hashExpr(), printExpr(), propagateLocks(), SCIPexprCopy(), SCIPexprDismantle(), SCIPexprEval(), SCIPexprEvalActivity(), SCIPexprPrint(), SCIPexprRelease(), and SCIPexprSimplify().
◆ SCIPexpriterGetChildIdxDFS()gets the index of the child that the expression iterator considers when in DFS mode and stage SCIP_EXPRITER_VISITINGCHILD or SCIP_EXPRITER_VISITEDCHILD
Definition at line 707 of file expriter.c.
References SCIP_ExprIter::curr, SCIP_ExprIter::dfsstage, SCIP_Expr::iterdata, SCIP_ExprIter::iterindex, SCIP_ExprIter::itertype, NULL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_VISITEDCHILD, and SCIP_EXPRITER_VISITINGCHILD.
Referenced by collectLeafs(), printExpr(), propagateLocks(), replaceBinaryProducts(), SCIP_DECL_CONSACTIVE(), SCIPexprDismantle(), SCIPexprEvalGradient(), SCIPexprEvalHessianDir(), SCIPexprPrint(), SCIPexprRelease(), SCIPexprSimplify(), and SCIPreplaceCommonSubexpressions().
◆ SCIPexpriterGetChildExprDFS()gets the child expression that the expression iterator considers when in DFS mode and stage SCIP_EXPRITER_VISITINGCHILD or SCIP_EXPRITER_VISITEDCHILD
Definition at line 721 of file expriter.c.
References SCIP_Expr::children, SCIP_ExprIter::curr, SCIP_ExprIter::dfsstage, SCIP_Expr::iterdata, SCIP_ExprIter::iterindex, SCIP_ExprIter::itertype, SCIP_Expr::nchildren, NULL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_VISITEDCHILD, and SCIP_EXPRITER_VISITINGCHILD.
Referenced by collectLeafs(), constructExpr(), createNlhdlrExprData(), forwardPropExpr(), replaceBinaryProducts(), SCIP_DECL_CONSACTIVE(), SCIPexprEval(), SCIPexprEvalActivity(), SCIPexprEvalGradient(), SCIPexprEvalHessianDir(), SCIPexprRelease(), SCIPexprSimplify(), and SCIPreplaceCommonSubexpressions().
◆ SCIPexpriterGetParentDFS() ◆ SCIPexpriterGetCurrentUserData() ◆ SCIPexpriterGetChildUserDataDFS()gives the iterator specific user data of the current expressions current child
Definition at line 771 of file expriter.c.
References SCIP_Expr::children, SCIP_ExprIter::curr, SCIP_ExprIter::dfsstage, SCIP_Expr::iterdata, SCIP_ExprIter::iterindex, SCIP_ExprIter::itertype, SCIP_Expr::nchildren, NULL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_VISITEDCHILD, and SCIP_EXPRITER_VISITINGCHILD.
Referenced by SCIPexprCopy(), and SCIPexprSimplify().
◆ SCIPexpriterGetExprUserData() ◆ SCIPexpriterSetCurrentUserData() ◆ SCIPexpriterSetExprUserData()sets the iterator specific user data of a given expression
Definition at line 822 of file expriter.c.
References SCIP_Expr::iterdata, SCIP_ExprIter::iterindex, and NULL.
◆ SCIPexpriterSetChildUserData()sets the iterator specific user data of the current expressions current child
Definition at line 838 of file expriter.c.
References SCIP_Expr::children, SCIP_ExprIter::curr, SCIP_ExprIter::dfsstage, SCIP_Expr::iterdata, SCIP_ExprIter::iterindex, SCIP_ExprIter::itertype, SCIP_Expr::nchildren, NULL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_VISITEDCHILD, and SCIP_EXPRITER_VISITINGCHILD.
Referenced by propagateLocks().
◆ SCIPexpriterGetNext()moves the iterator to the next expression according to the mode of the expression iterator
Definition at line 858 of file expriter.c.
References SCIP_ExprIter::curr, SCIP_ExprIter::dfsstage, doBfsNext(), doDfsNext(), doReverseTopologicalNext(), SCIP_Expr::iterdata, SCIP_ExprIter::iterindex, SCIP_ExprIter::itertype, NULL, SCIP_EXPRITER_BFS, SCIP_EXPRITER_DFS, SCIP_EXPRITER_MAXNACTIVE, SCIP_EXPRITER_RTOPOLOGIC, SCIP_ExprIter::stopstages, and SCIP_ExprIter::visitedtag.
Referenced by addExprViolScoresAuxVars(), addSymmetryInformation(), analyzeViolation(), bilinearTermsInsertAll(), canonicalizeConstraints(), collectBranchingCandidates(), collectLeafs(), computeGradient(), computeOffValues(), constructExpr(), createNlhdlrExprData(), deinitSolve(), detectMinors(), detectNlhdlrs(), enforceConstraint(), evalAndDiff(), exprIsNonSmooth(), exprIsSemicontinuous(), forbidNonlinearVariablesMultiaggration(), forwardPropExpr(), generateCut(), hashExpr(), initSepa(), nlpAddNlRows(), nlpDelVarPos(), notifyNlhdlrNewsol(), printExpr(), processNlRow(), propagateLocks(), propConss(), propExprDomains(), registerBranchingCandidates(), removeSingleLockedVars(), replaceBinaryProducts(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_TABLEOUTPUT(), SCIPaddExprsViolScoreNonlinear(), SCIPaddNlRowGradientBenderscutOpt(), SCIPcomputeExprCurvature(), SCIPcomputeExprIntegrality(), SCIPcreateNlpiProblemFromNlRows(), SCIPexprCopy(), SCIPexprDismantle(), SCIPexprEval(), SCIPexprEvalActivity(), SCIPexprEvalGradient(), SCIPexprEvalHessianDir(), SCIPexprintCompile(), SCIPexpriterInit(), SCIPexpriterRestartDFS(), SCIPexpriterSetStagesDFS(), SCIPexpriterSkipDFS(), SCIPexprPrint(), SCIPexprPrintDot(), SCIPexprRelease(), SCIPexprSimplify(), SCIPgetExprNVars(), SCIPgetExprVarExprs(), SCIPmarkExprPropagateNonlinear(), SCIPnlpGetVarsNonlinearity(), SCIPnlpHasContinuousNonlinearity(), SCIPnlpiOracleDelVarSet(), SCIPnlpiOracleGetJacobianSparsity(), SCIPregisterExprUsageNonlinear(), SCIPreplaceCommonSubexpressions(), and updateVariableCounts().
◆ SCIPexpriterSkipDFS()moves a DFS iterator to one of the next expressions
stopstages
, then it will be the next stage. Otherwise, the iterator will move further on (go to the parent, etc).Definition at line 930 of file expriter.c.
References SCIP_ExprIter::curr, SCIP_ExprIter::dfsstage, doDfsNext(), SCIP_ExprIter::iterindex, SCIP_ExprIter::itertype, NULL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_ENTEREXPR, SCIP_EXPRITER_LEAVEEXPR, SCIP_EXPRITER_VISITEDCHILD, SCIP_EXPRITER_VISITINGCHILD, SCIPABORT, SCIPerrorMessage, SCIPexpriterGetNext(), and SCIP_ExprIter::stopstages.
Referenced by constructExpr(), forwardPropExpr(), SCIPexprCopy(), SCIPexprEval(), SCIPexprEvalActivity(), SCIPexprRelease(), and SCIPreplaceCommonSubexpressions().
◆ SCIPexpriterIsEnd()returns whether the iterator visited all expressions already
Definition at line 969 of file expriter.c.
References SCIP_ExprIter::curr, and NULL.
Referenced by addExprViolScoresAuxVars(), addSymmetryInformation(), analyzeViolation(), bilinearTermsInsertAll(), canonicalizeConstraints(), collectBranchingCandidates(), collectLeafs(), computeGradient(), computeOffValues(), constructExpr(), createNlhdlrExprData(), deinitSolve(), detectMinors(), detectNlhdlrs(), enforceConstraint(), evalAndDiff(), exprIsNonSmooth(), exprIsSemicontinuous(), forbidNonlinearVariablesMultiaggration(), forwardPropExpr(), generateCut(), hashExpr(), initSepa(), nlpAddNlRows(), nlpDelVarPos(), notifyNlhdlrNewsol(), printExpr(), processNlRow(), propagateLocks(), propConss(), propExprDomains(), registerBranchingCandidates(), removeSingleLockedVars(), replaceBinaryProducts(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_TABLEOUTPUT(), SCIPaddExprsViolScoreNonlinear(), SCIPaddNlRowGradientBenderscutOpt(), SCIPcomputeExprCurvature(), SCIPcomputeExprIntegrality(), SCIPcreateNlpiProblemFromNlRows(), SCIPexprCopy(), SCIPexprDismantle(), SCIPexprEval(), SCIPexprEvalActivity(), SCIPexprEvalGradient(), SCIPexprEvalHessianDir(), SCIPexprintCompile(), SCIPexprPrint(), SCIPexprPrintDot(), SCIPexprRelease(), SCIPexprSimplify(), SCIPgetExprNVars(), SCIPgetExprVarExprs(), SCIPmarkExprPropagateNonlinear(), SCIPnlpGetVarsNonlinearity(), SCIPnlpHasContinuousNonlinearity(), SCIPnlpiOracleDelVarSet(), SCIPnlpiOracleGetJacobianSparsity(), SCIPregisterExprUsageNonlinear(), SCIPreplaceCommonSubexpressions(), and updateVariableCounts().
◆ SCIPexprcurvAdd()gives curvature for a sum of two functions with given curvature
Definition at line 53 of file exprcurv.c.
◆ SCIPexprcurvNegate() ◆ SCIPexprcurvMultiply() ◆ SCIPexprcurvPower()gives curvature for base^exponent for given bounds and curvature of base-function and constant exponent
Definition at line 101 of file exprcurv.c.
References EPSISINT, SCIP_Interval::inf, SCIP_Bool, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_Real, SCIPexprcurvPower(), SCIPintervalSetBounds(), and SCIP_Interval::sup.
Referenced by SCIPexprcurvMonomial(), and SCIPexprcurvPower().
◆ SCIPexprcurvPowerInv()gives required curvature for base so that base^exponent has given curvature under given bounds on base and constant exponent
returns curvature unknown if expected curvature cannot be obtained
Definition at line 209 of file exprcurv.c.
References EPSISINT, SCIP_Interval::inf, SCIP_Bool, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_Real, SCIPexprcurvPowerInv(), SCIPintervalSetBounds(), and SCIP_Interval::sup.
Referenced by SCIP_DECL_EXPRCURVATURE(), SCIPexprcurvMonomialInv(), and SCIPexprcurvPowerInv().
◆ SCIPexprcurvMonomial()gives curvature for a monomial with given curvatures and bounds for each factor
See Maranas and Floudas, Finding All Solutions of Nonlinearly Constrained Systems of Equations, JOGO 7, 1995 for the categorization in the case that all factors are linear.
Exponents can also be negative or rational.
Definition at line 331 of file exprcurv.c.
References EPSGE, EPSISINT, EPSLE, FALSE, SCIP_Interval::inf, NULL, SCIP_Bool, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_Real, SCIPexprcurvMultiply(), SCIPexprcurvNegate(), SCIPexprcurvPower(), SCIP_Interval::sup, and TRUE.
◆ SCIPexprcurvMonomialInv()for a monomial with given bounds for each factor, gives condition on the curvature of each factor, so that monomial has a requested curvature, if possible
monomialcurv
can be achieved
Definition at line 457 of file exprcurv.c.
References EPSGE, EPSISINT, EPSLE, FALSE, SCIP_Interval::inf, NULL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_Real, SCIPexprcurvNegate(), SCIPexprcurvPowerInv(), SCIP_Interval::sup, and TRUE.
Referenced by DECL_CURVCHECK().
◆ SCIPexprcurvGetName() ◆ SCIPcreateExpr()creates and captures an expression with given expression data and children
Definition at line 981 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprCreate().
Referenced by SCIPcreateExpr2(), SCIPcreateExprAbs(), SCIPcreateExprCos(), SCIPcreateExprEntropy(), SCIPcreateExprErf(), SCIPcreateExprExp(), SCIPcreateExprLog(), SCIPcreateExprPow(), SCIPcreateExprProduct(), SCIPcreateExprSignpower(), SCIPcreateExprSin(), SCIPcreateExprSum(), SCIPcreateExprValue(), SCIPcreateExprVar(), and SCIPcreateExprVaridx().
◆ SCIPcreateExpr2()creates and captures an expression with given expression data and up to two children
Definition at line 1002 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPcreateExpr().
◆ SCIPcreateExprQuadratic() SCIP_RETCODE SCIPcreateExprQuadratic ( SCIP * scip, SCIP_EXPR ** expr, int nlinvars, SCIP_VAR ** linvars, SCIP_Real * lincoefs, int nquadterms, SCIP_VAR ** quadvars1, SCIP_VAR ** quadvars2, SCIP_Real * quadcoefs, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)) , void * ownercreatedata )creates and captures an expression representing a quadratic function
Definition at line 1040 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreateExprPow(), SCIPcreateExprProduct(), SCIPcreateExprSum(), SCIPcreateExprVar(), SCIPfreeBufferArray, and SCIPreleaseExpr().
Referenced by createConstraint(), readExpression(), and SCIPcreateConsQuadraticNonlinear().
◆ SCIPcreateExprMonomial()creates and captures an expression representing a monomial
Definition at line 1148 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPcreateExprPow(), SCIPcreateExprProduct(), SCIPcreateExprValue(), SCIPcreateExprVar(), SCIPfreeBufferArray, and SCIPreleaseExpr().
Referenced by readPolynomial().
◆ SCIPappendExprChild() ◆ SCIPreplaceExprChild() ◆ SCIPremoveExprChildren() ◆ SCIPduplicateExpr()duplicates the given expression and its children
Definition at line 1288 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprCopy().
Referenced by createCons(), SCIP_DECL_CONSTRANS(), SCIP_DECL_EXPRSIMPLIFY(), SCIPaddExprNonlinear(), SCIPaddNlpiProblemNlRows(), SCIPchgExprNonlinear(), SCIPcreateNlpiProblemFromNlRows(), and SCIPwritePip().
◆ SCIPduplicateExprShallow() ◆ SCIPcopyExpr()copies an expression including children to use in a (possibly different) SCIP instance
Definition at line 1325 of file scip_expr.c.
References COPY_MAPEXPR_DATA::consmap, COPY_MAPEXPR_DATA::global, Scip::mem, NULL, SCIP_Mem::probmem, SCIP_CALL, SCIP_OKAY, SCIPexprCopy(), Scip::set, Scip::stat, TRUE, COPY_MAPEXPR_DATA::valid, and COPY_MAPEXPR_DATA::varmap.
Referenced by SCIP_DECL_CONSCOPY().
◆ SCIPparseExpr()creates an expression from a string
We specify the grammar that defines the syntax of an expression. Loosely speaking, a Base
will be any "block", a Factor
is a Base
to a power, a Term
is a product of Factors
and an Expression
is a sum of Terms
.
The actual definition:
Expression -> ["+" | "-"] Term { [ ("+" | "-" | "number *") Term | ("number" <varname>) ] }
Term -> Factor { ("*" | "/" ) Factor }
Factor -> Base [ "^" "number" | "^(" "number" ")" ]
Base -> "number" | "<varname>" | "(" Expression ")" | Op "(" OpExpression ")
where [a|b]
means a
or b
or none, (a|b)
means a
or b
, {a}
means 0 or more a
.
Note that Op
and OpExpression
are undefined. Op
corresponds to the name of an expression handler and OpExpression
to whatever string the expression handler accepts (through its parse method).
Definition at line 1387 of file scip_expr.c.
References NULL, parseExpr(), SCIP_CALL, SCIPblkmem(), SCIPgetNVars(), SCIPhashmapCreate(), and SCIPhashmapFree().
Referenced by SCIP_DECL_CONSPARSE(), and SCIP_DECL_EXPRPARSE().
◆ SCIPcaptureExpr()captures an expression (increments usage count)
Definition at line 1416 of file scip_expr.c.
References SCIPexprCapture().
Referenced by createCons(), createConstraint(), createExprNode(), createExprVar(), enforceSP10(), exprdataCreate(), getBinaryProductExpr(), initBounds(), nlhdlrExprCreate(), readExpression(), scaleConsSides(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIPgetExprVarExprs(), and SCIPnlpiOracleChgExpr().
◆ SCIPreleaseExpr()releases an expression (decrements usage count and possibly frees expression)
Definition at line 1424 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprRelease().
Referenced by addNlrow(), addRegularScholtes(), AMPLProblemHandler::LinearExprHandler::AddTerm(), buildSimplifiedProduct(), canonicalizeConstraints(), AMPLProblemHandler::cleanup(), collectLeafs(), computeOffValues(), constructExpr(), createConstraint(), createNlRow(), createSOCExpression(), enforceSP10(), enforceSP11(), enforceSP12(), enforceSP12b(), exprdataFree(), freeConstraint(), freeExprNode(), freeVarExprs(), getBinaryProductExpr(), getFactorizedBinaryQuadraticExpr(), mergeProductExprlist(), nlhdlrExprGrowChildren(), AMPLProblemHandler::OnBinary(), AMPLProblemHandler::OnHeader(), AMPLProblemHandler::OnUnary(), parseBase(), parseExpr(), parseFactor(), parseTerm(), presolveBinaryProducts(), readConstraints(), readExpression(), readObjective(), readPolynomial(), replaceBinaryProducts(), scaleConsSides(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSDELETE(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSTRANS(), SCIP_DECL_EXPRPARSE(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLRFREEEXPRDATA(), SCIP_DECL_PROPEXITSOL(), SCIP_DECL_READERREAD(), SCIPaddBilinTermQuadratic(), SCIPaddExprNonlinear(), SCIPaddLinearVarNonlinear(), SCIPaddNlpiProblemNlRows(), SCIPaddQuadVarQuadratic(), SCIPaddSquareCoefQuadratic(), SCIPchgExprNonlinear(), SCIPcreateConsBasicSignpowerNonlinear(), SCIPcreateConsBasicSOC(), SCIPcreateConsBasicSOCNonlinear(), SCIPcreateConsQuadraticNonlinear(), SCIPcreateConsSOC(), SCIPcreateExprMonomial(), SCIPcreateExprQuadratic(), SCIPcreateNlpiProblemFromNlRows(), SCIPhasExprCurvature(), SCIPmultiplyBySumExprSum(), SCIPnlpiOracleChgExpr(), SCIPnlpiOracleDelVarSet(), SCIPpowerExprSum(), SCIPreplaceCommonSubexpressions(), SCIPwritePip(), setQuadraticObj(), setupProblem(), and simplifyTerm().
◆ SCIPisExprVar()returns whether an expression is a variable expression
Definition at line 1438 of file scip_expr.c.
References NULL, and SCIPexprIsVar().
Referenced by addSymmetryInformation(), analyzeViolation(), buildQuadExprMatrix(), catchVarEvent(), catchVarEvents(), checkAndCollectQuadratic(), collectLeafs(), computeGradient(), computeOffValues(), constructExpr(), createAuxVar(), createNlRow(), detectSocNorm(), detectSocQuadraticSimple(), doSeachEcAggr(), dropVarEvent(), exprIsSemicontinuous(), findUnlockedLinearVar(), forbidNonlinearVariablesMultiaggration(), forwardPropExpr(), generateCut(), getNLPVarsNonConvexity(), isBinaryProduct(), isCandidate(), isExprSignomial(), isPackingCons(), isSingleLockedCand(), nlrowaggrCreate(), presolveAddKKTQuadBilinearTerms(), presolveAddKKTQuadLinearTerms(), presolveAddKKTQuadQuadraticTerms(), presolveImplint(), presolveRedundantConss(), presolveSingleLockedVars(), printExpr(), printRow(), printSignomial(), processNlRow(), propagateLocks(), readConstraints(), readObjective(), removeSingleLockedVars(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_EVENTEXEC(), SCIP_DECL_EXPR_MAPEXPR(), SCIP_DECL_EXPR_OWNERCREATE(), SCIP_DECL_EXPR_OWNERFREE(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NONLINCONSUPGD(), SCIPaddExprsViolScoreNonlinear(), SCIPaddExprViolScoreNonlinear(), SCIPaddNlRowGradientBenderscutOpt(), SCIPexprintCompile(), SCIPgetExprPartialDiffGradientDirNonlinear(), SCIPgetExprPartialDiffNonlinear(), SCIPisSOCNonlinear(), SCIPmarkExprPropagateNonlinear(), SCIPregisterExprUsageNonlinear(), SCIPwriteMps(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperator(), tryAddGadgetEvenOperatorSum(), tryAddGadgetEvenOperatorVariable(), and tryAddGadgetSquaredDifference().
◆ SCIPisExprValue()returns whether an expression is a value expression
Definition at line 1449 of file scip_expr.c.
References NULL, and SCIPexprIsValue().
Referenced by addSymmetryInformation(), canonicalizeConstraints(), constructExpr(), createAuxVar(), eval(), isExprSignomial(), mergeProductExprlist(), AMPLProblemHandler::OnBinary(), AMPLProblemHandler::OnObj(), presolveRedundantConss(), printExpr(), printSignomial(), readExpression(), SCIP_DECL_EXPRBWDIFF(), SCIP_DECL_EXPRBWFWDIFF(), SCIP_DECL_EXPRFWDIFF(), SCIP_DECL_EXPRSIMPLIFY(), SCIPexprintCompile(), SCIPgetExprPartialDiffGradientDirNonlinear(), SCIPgetExprPartialDiffNonlinear(), simplifyFactor(), simplifyTerm(), and tryAddGadgetEvenOperator().
◆ SCIPisExprSum()returns whether an expression is a sum expression
Definition at line 1460 of file scip_expr.c.
References NULL, and SCIPexprIsSum().
Referenced by addSymmetryInformation(), computeOffValues(), constructExpr(), createConstraint(), createNlRow(), DECL_CURVCHECK(), detectExpr(), detectSocNorm(), detectSocQuadraticComplex(), detectSocQuadraticSimple(), enforceSP12(), enforceSP12b(), eval(), exprIsMultivarLinear(), exprIsSemicontinuous(), findUnlockedLinearVar(), forbidNonlinearVariablesMultiaggration(), getBilinearBinaryTerms(), getFactorizedBinaryQuadraticExpr(), isExprPolynomial(), isPackingCons(), presolveImplint(), presolveSingleLockedVars(), printExpr(), printRowNl(), scaleConsSides(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLREVALAUX(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRSOLLINEARIZE(), SCIP_DECL_NONLINCONSUPGD(), SCIPaddExprNonlinear(), SCIPaddLinearVarNonlinear(), SCIPappendExprSumExpr(), SCIPexprintCompile(), SCIPmultiplyBySumExprSum(), SCIPpowerExprSum(), simplifyFactor(), simplifyTerm(), transformExpr(), tryAddGadgetEvenOperator(), tryAddGadgetEvenOperatorSum(), and tryAddGadgetSquaredDifference().
◆ SCIPisExprProduct()returns whether an expression is a product expression
Definition at line 1471 of file scip_expr.c.
References NULL, and SCIPexprIsProduct().
Referenced by addSymmetryInformation(), bilinearTermsInsertAll(), buildQuadExprMatrix(), checkAndCollectQuadratic(), DECL_CURVCHECK(), detectExpr(), detectMinors(), detectSocQuadraticSimple(), eval(), getBinaryProductExprDo(), isBinaryProduct(), isExprSignomial(), isPackingCons(), presolveSingleLockedVars(), printExpr(), printSignomial(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLREVALAUX(), SCIPexprintCompile(), simplifyFactor(), simplifyTerm(), tryAddGadgetBilinearProductSignedPerm(), and tryAddGadgetSquaredDifference().
◆ SCIPisExprPower()returns whether an expression is a power expression
Definition at line 1482 of file scip_expr.c.
References NULL, and SCIPexprIsPower().
Referenced by bilinearTermsInsertAll(), buildQuadExprMatrix(), checkAndCollectQuadratic(), DECL_CURVCHECK(), detectExpr(), detectMinors(), detectSocNorm(), detectSocQuadraticSimple(), eval(), isEvenOperator(), isExprSignomial(), isPackingCons(), mergeProductExprlist(), presolveSingleLockedVars(), printExpr(), printSignomial(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLREVALAUX(), SCIPexprintCompile(), and tryAddGadgetSquaredDifference().
◆ SCIPprintExpr()print an expression as info-message
Definition at line 1493 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprPrint().
Referenced by analyzeViolation(), constructExpr(), createNlhdlrExprData(), DECL_CURVCHECK(), detectExpr(), detectSocNorm(), detectSocQuadraticComplex(), detectSocQuadraticSimple(), enforceConstraint(), enforceExpr(), enforceSP12(), estimateConvexSecant(), estimateGradient(), estimateVertexPolyhedral(), forwardPropExpr(), generateIntercut(), printFunction(), propagateBoundsLinExpr(), propagateBoundsQuadExpr(), readPolynomial(), reversePropQueue(), SCIP_DECL_CONSPRINT(), SCIP_DECL_EXPRINITESTIMATES(), SCIP_DECL_EXPRINTEVAL(), SCIP_DECL_EXPRREVERSEPROP(), SCIP_DECL_EXPRSIMPLIFY(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLHDLRENFO(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRINITSEPA(), SCIP_DECL_NLHDLRINTEVAL(), SCIP_DECL_NLHDLRSOLLINEARIZE(), SCIPexprEvalActivity(), SCIPexprintGrad(), SCIPexprintHessian(), SCIPexprintHessianSparsity(), SCIPpowerExprSum(), SCIPprintExprQuadratic(), SCIPtightenExprIntervalNonlinear(), and simplifyMultiplyChildren().
◆ SCIPprintExprDotInit()initializes printing of expressions in dot format to a give FILE* pointer
Definition at line 1508 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprPrintDotInit().
Referenced by SCIPshowExpr().
◆ SCIPprintExprDotInit2()initializes printing of expressions in dot format to a file with given filename
Definition at line 1524 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprPrintDotInit2().
◆ SCIPprintExprDot() ◆ SCIPprintExprDotFinal() ◆ SCIPshowExpr()shows a single expression by use of dot and gv
This function is meant for debugging purposes. It's signature is kept as simple as possible to make it easily callable from gdb, for example.
It prints the expression into a temporary file in dot format, then calls dot to create a postscript file, then calls ghostview (gv) to show the file. SCIP will hold until ghostscript is closed.
Definition at line 1576 of file scip_expr.c.
References NULL, SCIP_CALL_TERMINATE, SCIP_ERROR, SCIP_EXPRPRINT_ALL, SCIP_FILECREATEERROR, SCIP_OKAY, SCIPerrorMessage, SCIPprintExprDot(), SCIPprintExprDotFinal(), and SCIPprintExprDotInit().
◆ SCIPdismantleExpr() ◆ SCIPevalExpr()evaluate an expression in a point
Iterates over expressions to also evaluate children, if necessary. Value can be received via SCIPexprGetEvalValue(). If an evaluation error (division by zero, ...) occurs, this value will be set to SCIP_INVALID.
If a nonzero soltag
is passed, then only (sub)expressions are reevaluated that have a different solution tag. If a soltag of 0 is passed, then subexpressions are always reevaluated. The tag is stored together with the value and can be received via SCIPexprGetEvalTag().
Definition at line 1642 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprEval().
Referenced by computeOffValues(), computeViolation(), AMPLProblemHandler::EndInput(), enforceExpr(), estimateConvexSecant(), initSepa(), notifyNlhdlrNewsol(), SCIP_DECL_NLHDLREVALAUX(), SCIP_DECL_NLHDLRSOLLINEARIZE(), SCIP_DECL_VERTEXPOLYFUN(), SCIPexprintEval(), SCIPgetExprAbsOrigViolationNonlinear(), and SCIPgetExprActivityNonlinear().
◆ SCIPgetExprNewSoltag() ◆ SCIPevalExprGradient()evaluates gradient of an expression for a given point
Initiates an expression walk to also evaluate children, if necessary. Value can be received via SCIPgetExprPartialDiffNonlinear(). If an error (division by zero, ...) occurs, this value will be set to SCIP_INVALID.
Definition at line 1674 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprEvalGradient().
Referenced by computeGradient(), estimateGradientInner(), generateCut(), getConsRelViolation(), and SCIPaddNlRowGradientBenderscutOpt().
◆ SCIPevalExprHessianDir()evaluates Hessian-vector product of an expression for a given point and direction
Evaluates children, if necessary. Value can be received via SCIPgetExprPartialDiffGradientDirNonlinear(). If an error (division by zero, ...) occurs, this value will be set to SCIP_INVALID.
Definition at line 1696 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprEvalHessianDir().
◆ SCIPevalExprActivity()possibly reevaluates and then returns the activity of the expression
Reevaluate activity if currently stored is no longer uptodate (some bound was changed since last evaluation).
The owner of the expression may overwrite the methods used to evaluate the activity, including whether the local or global domain of variables is used. By default (no owner, or owner doesn't overwrite activity evaluation), the local domain of variables is used.
Definition at line 1724 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprEvalActivity().
Referenced by checkSubproblemConvexity(), DECL_CURVCHECK(), deinitSolve(), detectSocQuadraticComplex(), detectSocQuadraticSimple(), estimateBivariateQuotient(), estimateUnivariateQuotient(), initSepa(), SCIP_DECL_EXPRCURVATURE(), SCIP_DECL_EXPRMONOTONICITY(), SCIP_DECL_NLHDLRESTIMATE(), SCIP_DECL_NLHDLRINITSEPA(), SCIPregisterExprUsageNonlinear(), and tryFillNlhdlrExprDataQuad().
◆ SCIPcompareExpr()compare expressions
Definition at line 1741 of file scip_expr.c.
References NULL, and SCIPexprCompare().
Referenced by DECL_CURVCHECK(), enforceSP11(), mergeProductExprlist(), SCIP_DECL_EXPRCOMPARE(), SCIP_DECL_EXPRSIMPLIFY(), and SCIP_DECL_SORTINDCOMP().
◆ SCIPhashExpr()compute the hash value of an expression
Definition at line 1753 of file scip_expr.c.
References FALSE, hashExpr(), NULL, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_LEAVEEXPR, SCIP_OKAY, SCIPexpriterCreate(), SCIPexpriterFree(), SCIPexpriterGetExprUserData(), SCIPexpriterInit(), SCIPexpriterSetStagesDFS(), and SCIP_EXPRITER_USERDATA::uintval.
◆ SCIPsimplifyExpr()simplifies an expression
This is largely inspired by Joel Cohen's Computer algebra and symbolic computation: Mathematical methods, in particular Chapter 3. The other fountain of inspiration are the simplifying methods of expr.c in SCIP 7.
Note: The things to keep in mind when adding simplification rules are the following. I will be using the product expressions (see expr_product.c) as an example. There are mainly 3 parts of the simplification process. You need to decide at which stage the simplification rule makes sense.
During steps 1 and 2 do not forget to set the flag changed
to TRUE when something actually changes.
An expression is simplified if it
abs
expr*log(expr)
(TODO: we could handle more complicated stuff like \(xy\log(x) \to - y * \mathrm{entropy}(x)\), but I am not sure this should happen at the simplification level; similar for \((xy) \log(xy)\), which currently simplifies to \(xy \log(xy)\))exp
is a signedpower expression such that
TODO: Some of these criteria are too restrictive for signed powers; for example, the exponent does not need to be an integer for signedpower to distribute over a product (SPOW5, SPOW6, SPOW8). Others can also be improved.
Equal type expressions:
SCIPvarGetIndex(var(u))
< SCIPvarGetIndex(var(v))
Different type expressions:
Examples:
The recursive version of the algorithm is
EXPR simplify(expr) for c in 1..expr->nchildren expr->children[c] = simplify(expr->children[c]) end return expr->exprhdlr->simplify(expr) end
Important: Whatever is returned by a simplify callback has to be simplified. Also, all children of the given expression are already simplified.
simplifies an expression (duplication of long doxygen comment omitted here)
Definition at line 1780 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprSimplify().
Referenced by canonicalizeConstraints(), SCIP_DECL_CONSACTIVE(), SCIPmultiplyBySumExprSum(), SCIPpowerExprSum(), and SCIPwritePip().
◆ SCIPgetSymDataExpr() ◆ SCIPreplaceCommonSubexpressions()replaces common sub-expressions in a given expression graph by using a hash key for each expression
The algorithm consists of two steps:
Definition at line 1827 of file scip_expr.c.
References FALSE, findEqualExpr(), hashExpr(), COMMONSUBEXPR_HASH_DATA::hashiterator, NULL, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_LEAVEEXPR, SCIP_EXPRITER_VISITINGCHILD, SCIP_OKAY, SCIPcreateExpriter(), SCIPdebugMsg, SCIPexprCapture(), SCIPexprCompare(), SCIPexpriterFree(), SCIPexpriterGetChildExprDFS(), SCIPexpriterGetChildIdxDFS(), SCIPexpriterGetCurrent(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterSetStagesDFS(), SCIPexpriterSkipDFS(), SCIPmultihashCreate(), SCIPmultihashFree(), SCIPreleaseExpr(), SCIPreplaceExprChild(), COMMONSUBEXPR_HASH_DATA::set, and TRUE.
Referenced by canonicalizeConstraints(), and SCIP_DECL_CONSACTIVE().
◆ SCIPcomputeExprCurvature()computes the curvature of a given expression and all its subexpressions
Definition at line 1942 of file scip_expr.c.
References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_EXPRITER_DFS, SCIP_EXPRITER_LEAVEEXPR, SCIP_OKAY, SCIPallocBufferArray, SCIPcalcMemGrowSize(), SCIPexprGetChildren(), SCIPexprGetCurvature(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrCurvatureExpr(), SCIPexprhdlrHasCurvature(), SCIPexpriterCreate(), SCIPexpriterFree(), SCIPexpriterGetCurrent(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterSetStagesDFS(), SCIPexprSetCurvature(), SCIPfreeBufferArray, and SCIPreallocBufferArray.
◆ SCIPcomputeExprIntegrality()computes integrality information of a given expression and all its subexpressions
The integrality information can be accessed via SCIPexprIsIntegral().
Definition at line 2022 of file scip_expr.c.
References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_LEAVEEXPR, SCIP_OKAY, SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprhdlrIntegralityExpr(), SCIPexpriterCreate(), SCIPexpriterFree(), SCIPexpriterGetCurrent(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterSetStagesDFS(), and SCIPexprSetIntegrality().
Referenced by collectLeafs(), and detectNlhdlrs().
◆ SCIPgetExprNVars()returns the total number of variable expressions in an expression
The function counts variable expressions in common sub-expressions only once, but counts variables appearing in several variable expressions multiple times.
Definition at line 2065 of file scip_expr.c.
References FALSE, NULL, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_OKAY, SCIPexprIsVar(), SCIPexpriterCreate(), SCIPexpriterFree(), SCIPexpriterGetNext(), SCIPexpriterInit(), and SCIPexpriterIsEnd().
Referenced by SCIP_DECL_NLHDLRDETECT(), and storeVarExprs().
◆ SCIPgetExprVarExprs()returns all variable expressions contained in a given expression
The array to store all variable expressions needs to be at least of size the number of unique variable expressions in the expression which is given by SCIPgetExprNVars().
If every variable is represented by only one variable expression (common subexpression have been removed) then SCIPgetExprNVars() can be bounded by SCIPgetNTotalVars(). If, in addition, non-active variables have been removed from the expression, e.g., by simplifying, then SCIPgetExprNVars() can be bounded by SCIPgetNVars().
Definition at line 2103 of file scip_expr.c.
References FALSE, NULL, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_OKAY, SCIPcaptureExpr(), SCIPexprIsVar(), SCIPexpriterCreate(), SCIPexpriterFree(), SCIPexpriterGetNext(), SCIPexpriterInit(), and SCIPexpriterIsEnd().
Referenced by computeOffValues(), SCIP_DECL_NLHDLRDETECT(), and storeVarExprs().
◆ SCIP_DECL_EXPRPRINT() SCIP_DECL_EXPRPRINT ( SCIPcallExprPrint ) ◆ SCIP_DECL_EXPRCURVATURE() SCIP_DECL_EXPRCURVATURE ( SCIPcallExprCurvature ) ◆ SCIP_DECL_EXPRMONOTONICITY() SCIP_DECL_EXPRMONOTONICITY ( SCIPcallExprMonotonicity ) ◆ SCIPcallExprEval()calls the eval callback for an expression with given values for children
Does not iterates over expressions, but requires values for children to be given. Value is not stored in expression, but returned in val
. If an evaluation error (division by zero, ...) occurs, this value will be set to SCIP_INVALID
.
Definition at line 2192 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPexprGetHdlr(), and SCIPexprhdlrEvalExpr().
Referenced by evalExprInAux().
◆ SCIPcallExprEvalFwdiff()calls the eval and fwdiff callback of an expression with given values for children
Does not iterates over expressions, but requires values for children and direction to be given.
Value is not stored in expression, but returned in val
. If an evaluation error (division by zero, ...) occurs, this value will be set to SCIP_INVALID
.
Direction is not stored in expression, but returned in dot
. If an differentiation error (division by zero, ...) occurs, this value will be set to SCIP_INVALID
.
Definition at line 2219 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPexprGetHdlr(), and SCIPexprhdlrEvalFwDiffExpr().
◆ SCIP_DECL_EXPRINTEVAL() SCIP_DECL_EXPRINTEVAL ( SCIPcallExprInteval ) ◆ SCIP_DECL_EXPRESTIMATE() SCIP_DECL_EXPRESTIMATE ( SCIPcallExprEstimate ) ◆ SCIP_DECL_EXPRINITESTIMATES() SCIP_DECL_EXPRINITESTIMATES ( SCIPcallExprInitestimates ) ◆ SCIP_DECL_EXPRSIMPLIFY() SCIP_DECL_EXPRSIMPLIFY ( SCIPcallExprSimplify ) ◆ SCIP_DECL_EXPRREVERSEPROP() SCIP_DECL_EXPRREVERSEPROP ( SCIPcallExprReverseprop ) ◆ SCIP_DECL_EXPRGETSYMDATA() SCIP_DECL_EXPRGETSYMDATA ( SCIPcallExprGetSymData )calls the symmetry information callback for an expression
Returns NULL pointer if not implemented.
calls the symmetry data callback for an expression
Returns no information if not implemented.
Definition at line 2322 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprGetSymData().
◆ SCIPcreateExpriter()creates an expression iterator
Definition at line 2344 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexpriterCreate().
Referenced by addExprViolScoresAuxVars(), addSymmetryInformation(), analyzeViolation(), bilinearTermsInsertAll(), canonicalizeConstraints(), collectBranchingCandidates(), collectLeafs(), computeOffValues(), constructExpr(), createNlhdlrExprData(), deinitSolve(), detectMinors(), detectNlhdlrs(), enforceConstraints(), exprIsNonSmooth(), exprIsSemicontinuous(), forbidNonlinearVariablesMultiaggration(), forwardPropExpr(), improvePoint(), initSepa(), notifyNlhdlrNewsol(), presolveBinaryProducts(), presolveSingleLockedVars(), printExpr(), processNlRow(), propagateLocks(), propConss(), propExprDomains(), registerBranchingCandidates(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_TABLEOUTPUT(), SCIPaddExprsViolScoreNonlinear(), SCIPaddNlRowGradientBenderscutOpt(), SCIPcreateNlpiProblemFromNlRows(), SCIPexprintCompile(), SCIPmarkExprPropagateNonlinear(), SCIPnlpiOracleDelVarSet(), SCIPnlpiOracleGetJacobianSparsity(), SCIPregisterExprUsageNonlinear(), SCIPreplaceCommonSubexpressions(), separateCuts(), and updateVariableCounts().
◆ SCIPfreeExpriter()frees an expression iterator
Definition at line 2358 of file scip_expr.c.
References SCIPexpriterFree().
Referenced by addExprViolScoresAuxVars(), addSymmetryInformation(), analyzeViolation(), bilinearTermsInsertAll(), canonicalizeConstraints(), collectBranchingCandidates(), collectLeafs(), computeOffValues(), constructExpr(), createNlhdlrExprData(), deinitSolve(), detectMinors(), detectNlhdlrs(), enforceConstraints(), exprIsNonSmooth(), exprIsSemicontinuous(), forbidNonlinearVariablesMultiaggration(), forwardPropExpr(), improvePoint(), initSepa(), notifyNlhdlrNewsol(), presolveBinaryProducts(), presolveSingleLockedVars(), printExpr(), processNlRow(), propagateLocks(), propConss(), propExprDomains(), registerBranchingCandidates(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_TABLEOUTPUT(), SCIPaddExprsViolScoreNonlinear(), SCIPaddNlRowGradientBenderscutOpt(), SCIPcreateNlpiProblemFromNlRows(), SCIPexprintCompile(), SCIPmarkExprPropagateNonlinear(), SCIPnlpiOracleDelVarSet(), SCIPnlpiOracleGetJacobianSparsity(), SCIPregisterExprUsageNonlinear(), separateCuts(), and updateVariableCounts().
◆ SCIPcheckExprQuadratic()checks whether an expression is quadratic
An expression is quadratic if it is either a square (of some expression), a product (of two expressions), or a sum of terms where at least one is a square or a product.
Use SCIPexprGetQuadraticData() to get data about the representation as quadratic.
Definition at line 2384 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprCheckQuadratic().
Referenced by DECL_CURVCHECK(), isCandidate(), printNonlinearCons(), processNlRow(), SCIP_DECL_NLHDLRDETECT(), SCIPcheckQuadraticNonlinear(), and SCIPwritePip().
◆ SCIPfreeExprQuadratic() ◆ SCIPevalExprQuadratic() ◆ SCIPprintExprQuadratic() ◆ SCIPcomputeExprQuadraticCurvature()checks the curvature of the quadratic expression
For this, it builds the matrix Q of quadratic coefficients and computes its eigenvalues using LAPACK. If Q is
If assumevarfixed
is given and some expressions in quadratic terms correspond to variables present in this hashmap, then the corresponding rows and columns are ignored in the matrix Q.
Definition at line 2593 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprComputeQuadraticCurvature().
Referenced by DECL_CURVCHECK(), SCIP_DECL_NLHDLRDETECT(), and SCIP_DECL_PRESOLEXEC().
◆ SCIPgetExprMonomialData()returns a monomial representation of a product expression
The array to store all factor expressions needs to be of size the number of children in the expression which is given by SCIPexprGetNChildren().
Given a non-trivial monomial expression, the function finds its representation as \(cx^\alpha\), where \(c\) is a real coefficient, \(x\) is a vector of auxiliary or original variables (where some entries can be NULL is the auxiliary variable has not been created yet), and \(\alpha\) is a real vector of exponents.
A non-trivial monomial is a product of a least two expressions.
Definition at line 2630 of file scip_expr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprGetMonomialData().
Referenced by SCIP_DECL_NLHDLRDETECT().
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4