Scippy

SCIP

Solving Constraint Integer Programs

pub_expr.h File Reference

Detailed Description

public methods for expressions, expression trees, expression graphs, and related stuff

Author
Stefan Vigerske
Thorsten Gellermann

Definition in file pub_expr.h.

Go to the source code of this file.

Functions

Expression curvature methods
SCIP_EXPRCURV SCIPexprcurvAdd (SCIP_EXPRCURV curv1, SCIP_EXPRCURV curv2)
 
SCIP_EXPRCURV SCIPexprcurvNegate (SCIP_EXPRCURV curvature)
 
SCIP_EXPRCURV SCIPexprcurvMultiply (SCIP_Real factor, SCIP_EXPRCURV curvature)
 
SCIP_EXPRCURV SCIPexprcurvPower (SCIP_INTERVAL basebounds, SCIP_EXPRCURV basecurv, SCIP_Real exponent)
 
SCIP_EXPRCURV SCIPexprcurvMonomial (int nfactors, SCIP_Real *exponents, int *factoridxs, SCIP_EXPRCURV *factorcurv, SCIP_INTERVAL *factorbounds)
 
const char * SCIPexprcurvGetName (SCIP_EXPRCURV curv)
 
Expression operand methods
const char * SCIPexpropGetName (SCIP_EXPROP op)
 
int SCIPexpropGetNChildren (SCIP_EXPROP op)
 
Expression methods
SCIP_EXPROP SCIPexprGetOperator (SCIP_EXPR *expr)
 
int SCIPexprGetNChildren (SCIP_EXPR *expr)
 
SCIP_EXPR ** SCIPexprGetChildren (SCIP_EXPR *expr)
 
int SCIPexprGetOpIndex (SCIP_EXPR *expr)
 
SCIP_Real SCIPexprGetOpReal (SCIP_EXPR *expr)
 
void * SCIPexprGetOpData (SCIP_EXPR *expr)
 
SCIP_Real SCIPexprGetRealPowerExponent (SCIP_EXPR *expr)
 
int SCIPexprGetIntPowerExponent (SCIP_EXPR *expr)
 
SCIP_Real SCIPexprGetSignPowerExponent (SCIP_EXPR *expr)
 
SCIP_RealSCIPexprGetLinearCoefs (SCIP_EXPR *expr)
 
SCIP_Real SCIPexprGetLinearConstant (SCIP_EXPR *expr)
 
SCIP_QUADELEMSCIPexprGetQuadElements (SCIP_EXPR *expr)
 
SCIP_Real SCIPexprGetQuadConstant (SCIP_EXPR *expr)
 
SCIP_RealSCIPexprGetQuadLinearCoefs (SCIP_EXPR *expr)
 
int SCIPexprGetNQuadElements (SCIP_EXPR *expr)
 
SCIP_EXPRDATA_MONOMIAL ** SCIPexprGetMonomials (SCIP_EXPR *expr)
 
int SCIPexprGetNMonomials (SCIP_EXPR *expr)
 
SCIP_Real SCIPexprGetPolynomialConstant (SCIP_EXPR *expr)
 
SCIP_Real SCIPexprGetMonomialCoef (SCIP_EXPRDATA_MONOMIAL *monomial)
 
int SCIPexprGetMonomialNFactors (SCIP_EXPRDATA_MONOMIAL *monomial)
 
int * SCIPexprGetMonomialChildIndices (SCIP_EXPRDATA_MONOMIAL *monomial)
 
SCIP_RealSCIPexprGetMonomialExponents (SCIP_EXPRDATA_MONOMIAL *monomial)
 
SCIP_USEREXPRDATASCIPexprGetUserData (SCIP_EXPR *expr)
 
SCIP_Bool SCIPexprHasUserEstimator (SCIP_EXPR *expr)
 
SCIP_EXPRINTCAPABILITY SCIPexprGetUserEvalCapability (SCIP_EXPR *expr)
 
SCIP_RETCODE SCIPexprCreate (BMS_BLKMEM *blkmem, SCIP_EXPR **expr, SCIP_EXPROP op,...)
 
SCIP_RETCODE SCIPexprCopyDeep (BMS_BLKMEM *blkmem, SCIP_EXPR **targetexpr, SCIP_EXPR *sourceexpr)
 
void SCIPexprFreeDeep (BMS_BLKMEM *blkmem, SCIP_EXPR **expr)
 
void SCIPexprFreeShallow (BMS_BLKMEM *blkmem, SCIP_EXPR **expr)
 
SCIP_RETCODE SCIPexprAdd (BMS_BLKMEM *blkmem, SCIP_EXPR **expr, SCIP_Real coef1, SCIP_EXPR *term1, SCIP_Real coef2, SCIP_EXPR *term2, SCIP_Real constant)
 
SCIP_RETCODE SCIPexprMulConstant (BMS_BLKMEM *blkmem, SCIP_EXPR **expr, SCIP_EXPR *term, SCIP_Real factor)
 
SCIP_RETCODE SCIPexprCreateLinear (BMS_BLKMEM *blkmem, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real *coefs, SCIP_Real constant)
 
SCIP_RETCODE SCIPexprAddToLinear (BMS_BLKMEM *blkmem, SCIP_EXPR *expr, int nchildren, SCIP_Real *coefs, SCIP_EXPR **children, SCIP_Real constant)
 
SCIP_RETCODE SCIPexprCreateQuadratic (BMS_BLKMEM *blkmem, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real constant, SCIP_Real *lincoefs, int nquadelems, SCIP_QUADELEM *quadelems)
 
void SCIPexprSortQuadElems (SCIP_EXPR *expr)
 
SCIP_RETCODE SCIPexprCreatePolynomial (BMS_BLKMEM *blkmem, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, int nmonomials, SCIP_EXPRDATA_MONOMIAL **monomials, SCIP_Real constant, SCIP_Bool copymonomials)
 
SCIP_RETCODE SCIPexprAddMonomials (BMS_BLKMEM *blkmem, SCIP_EXPR *expr, int nmonomials, SCIP_EXPRDATA_MONOMIAL **monomials, SCIP_Bool copymonomials)
 
void SCIPexprChgPolynomialConstant (SCIP_EXPR *expr, SCIP_Real constant)
 
void SCIPexprMultiplyPolynomialByConstant (BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_Real factor)
 
SCIP_RETCODE SCIPexprMultiplyPolynomialByMonomial (BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_EXPRDATA_MONOMIAL *factor, int *childmap)
 
SCIP_RETCODE SCIPexprMultiplyPolynomialByPolynomial (BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_EXPR *factor, int *childmap)
 
SCIP_RETCODE SCIPexprPolynomialPower (BMS_BLKMEM *blkmem, SCIP_EXPR *expr, int exponent)
 
void SCIPexprMergeMonomials (BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_Real eps, SCIP_Bool mergefactors)
 
SCIP_RETCODE SCIPexprCreateMonomial (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_MONOMIAL **monomial, SCIP_Real coef, int nfactors, int *childidxs, SCIP_Real *exponents)
 
void SCIPexprFreeMonomial (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_MONOMIAL **monomial)
 
void SCIPexprSortMonomialFactors (SCIP_EXPRDATA_MONOMIAL *monomial)
 
SCIP_Bool SCIPexprFindMonomialFactor (SCIP_EXPRDATA_MONOMIAL *monomial, int childidx, int *pos)
 
SCIP_Bool SCIPexprAreMonomialsEqual (SCIP_EXPRDATA_MONOMIAL *monomial1, SCIP_EXPRDATA_MONOMIAL *monomial2, SCIP_Real eps)
 
SCIP_RETCODE SCIPexprAddMonomialFactors (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_MONOMIAL *monomial, int nfactors, int *childidxs, SCIP_Real *exponents)
 
void SCIPexprChgMonomialCoef (SCIP_EXPRDATA_MONOMIAL *monomial, SCIP_Real newcoef)
 
SCIP_RETCODE SCIPexprMultiplyMonomialByMonomial (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_MONOMIAL *monomial, SCIP_EXPRDATA_MONOMIAL *factor, int *childmap)
 
void SCIPexprMonomialPower (SCIP_EXPRDATA_MONOMIAL *monomial, int exponent)
 
void SCIPexprMergeMonomialFactors (SCIP_EXPRDATA_MONOMIAL *monomial, SCIP_Real eps)
 
void SCIPexprSortMonomials (SCIP_EXPR *expr)
 
SCIP_RETCODE SCIPexprCreateUser (BMS_BLKMEM *blkmem, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_USEREXPRDATA *data, SCIP_EXPRINTCAPABILITY evalcapability, SCIP_DECL_USEREXPREVAL((*eval)), SCIP_DECL_USEREXPRINTEVAL((*inteval)), SCIP_DECL_USEREXPRCURV((*curv)), SCIP_DECL_USEREXPRPROP((*prop)), SCIP_DECL_USEREXPRESTIMATE((*estimate)), SCIP_DECL_USEREXPRCOPYDATA((*copydata)), SCIP_DECL_USEREXPRFREEDATA((*freedata)))
 
SCIP_Bool SCIPexprHasParam (SCIP_EXPR *expr)
 
SCIP_RETCODE SCIPexprGetMaxDegree (SCIP_EXPR *expr, int *maxdegree)
 
void SCIPexprGetVarsUsage (SCIP_EXPR *expr, int *varsusage)
 
SCIP_Bool SCIPexprAreEqual (SCIP_EXPR *expr1, SCIP_EXPR *expr2, SCIP_Real eps)
 
SCIP_RETCODE SCIPexprSimplify (BMS_BLKMEM *blkmem, SCIP_MESSAGEHDLR *messagehdlr, SCIP_EXPR *expr, SCIP_Real eps, int maxexpansionexponent, int nvars, int *nlinvars, int *linidxs, SCIP_Real *lincoefs)
 
SCIP_RETCODE SCIPexprEvalShallow (SCIP_EXPR *expr, SCIP_Real *argvals, SCIP_Real *varvals, SCIP_Real *param, SCIP_Real *val)
 
SCIP_RETCODE SCIPexprEval (SCIP_EXPR *expr, SCIP_Real *varvals, SCIP_Real *param, SCIP_Real *val)
 
SCIP_RETCODE SCIPexprEvalIntShallow (SCIP_EXPR *expr, SCIP_Real infinity, SCIP_INTERVAL *argvals, SCIP_INTERVAL *varvals, SCIP_Real *param, SCIP_INTERVAL *val)
 
SCIP_RETCODE SCIPexprEvalInt (SCIP_EXPR *expr, SCIP_Real infinity, SCIP_INTERVAL *varvals, SCIP_Real *param, SCIP_INTERVAL *val)
 
SCIP_RETCODE SCIPexprEvalUser (SCIP_EXPR *expr, SCIP_Real *argvals, SCIP_Real *val, SCIP_Real *gradient, SCIP_Real *hessian)
 
SCIP_RETCODE SCIPexprEvalIntUser (SCIP_EXPR *expr, SCIP_Real infinity, SCIP_INTERVAL *argvals, SCIP_INTERVAL *val, SCIP_INTERVAL *gradient, SCIP_INTERVAL *hessian)
 
SCIP_RETCODE SCIPexprCheckCurvature (SCIP_EXPR *expr, SCIP_Real infinity, SCIP_INTERVAL *varbounds, SCIP_Real *param, SCIP_EXPRCURV *curv, SCIP_INTERVAL *bounds)
 
SCIP_RETCODE SCIPexprEstimateUser (SCIP_EXPR *expr, SCIP_Real infinity, SCIP_Real *argvals, SCIP_INTERVAL *argbounds, SCIP_Bool overestimate, SCIP_Real *coeffs, SCIP_Real *constant, SCIP_Bool *success)
 
SCIP_RETCODE SCIPexprSubstituteVars (BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_EXPR **substexprs)
 
void SCIPexprReindexVars (SCIP_EXPR *expr, int *newindices)
 
void SCIPexprReindexParams (SCIP_EXPR *expr, int *newindices)
 
void SCIPexprPrint (SCIP_EXPR *expr, SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char **varnames, const char **paramnames, SCIP_Real *paramvals)
 
SCIP_RETCODE SCIPexprParse (BMS_BLKMEM *blkmem, SCIP_MESSAGEHDLR *messagehdlr, SCIP_EXPR **expr, const char *str, const char *lastchar, int *nvars, int *varnames)
 
Expression tree methods
SCIP_EXPRSCIPexprtreeGetRoot (SCIP_EXPRTREE *tree)
 
int SCIPexprtreeGetNVars (SCIP_EXPRTREE *tree)
 
int SCIPexprtreeGetNParams (SCIP_EXPRTREE *tree)
 
SCIP_RealSCIPexprtreeGetParamVals (SCIP_EXPRTREE *tree)
 
void SCIPexprtreeSetParamVal (SCIP_EXPRTREE *tree, int paramidx, SCIP_Real paramval)
 
SCIP_EXPRINTDATASCIPexprtreeGetInterpreterData (SCIP_EXPRTREE *tree)
 
void SCIPexprtreeSetInterpreterData (SCIP_EXPRTREE *tree, SCIP_EXPRINTDATA *interpreterdata)
 
SCIP_RETCODE SCIPexprtreeFreeInterpreterData (SCIP_EXPRTREE *tree)
 
SCIP_Bool SCIPexprtreeHasParam (SCIP_EXPRTREE *tree)
 
SCIP_RETCODE SCIPexprtreeGetMaxDegree (SCIP_EXPRTREE *tree, int *maxdegree)
 
SCIP_RETCODE SCIPexprtreeEval (SCIP_EXPRTREE *tree, SCIP_Real *varvals, SCIP_Real *val)
 
SCIP_RETCODE SCIPexprtreeEvalInt (SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *varvals, SCIP_INTERVAL *val)
 
void SCIPexprtreePrint (SCIP_EXPRTREE *tree, SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char **varnames, const char **paramnames)
 
SCIP_RETCODE SCIPexprtreeCreate (BMS_BLKMEM *blkmem, SCIP_EXPRTREE **tree, SCIP_EXPR *root, int nvars, int nparams, SCIP_Real *params)
 
SCIP_RETCODE SCIPexprtreeCopy (BMS_BLKMEM *blkmem, SCIP_EXPRTREE **targettree, SCIP_EXPRTREE *sourcetree)
 
SCIP_RETCODE SCIPexprtreeFree (SCIP_EXPRTREE **tree)
 
SCIP_RETCODE SCIPexprtreeSetParams (SCIP_EXPRTREE *tree, int nparams, SCIP_Real *paramvals)
 
void SCIPexprtreeGetVarsUsage (SCIP_EXPRTREE *tree, int *varsusage)
 
SCIP_RETCODE SCIPexprtreeSimplify (SCIP_EXPRTREE *tree, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Real eps, int maxexpansionexponent, int *nlinvars, int *linidxs, SCIP_Real *lincoefs)
 
SCIP_RETCODE SCIPexprtreeAddExpr (SCIP_EXPRTREE *tree, SCIP_EXPR *expr, SCIP_Bool copyexpr)
 
SCIP_RETCODE SCIPexprtreeCheckCurvature (SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *varbounds, SCIP_EXPRCURV *curv, SCIP_INTERVAL *bounds)
 
SCIP_RETCODE SCIPexprtreeSubstituteVars (SCIP_EXPRTREE *tree, SCIP_EXPR **substexprs)
 
Quadratic element methods
void SCIPquadelemSort (SCIP_QUADELEM *quadelems, int nquadelems)
 
SCIP_Bool SCIPquadelemSortedFind (SCIP_QUADELEM *quadelems, int idx1, int idx2, int nquadelems, int *pos)
 
void SCIPquadelemSqueeze (SCIP_QUADELEM *quadelems, int nquadelems, int *nquadelemsnew)
 
Expression graph node methods
void SCIPexprgraphCaptureNode (SCIP_EXPRGRAPHNODE *node)
 
SCIP_Bool SCIPexprgraphIsNodeEnabled (SCIP_EXPRGRAPHNODE *node)
 
int SCIPexprgraphGetNodeNChildren (SCIP_EXPRGRAPHNODE *node)
 
SCIP_EXPRGRAPHNODE ** SCIPexprgraphGetNodeChildren (SCIP_EXPRGRAPHNODE *node)
 
int SCIPexprgraphGetNodeNParents (SCIP_EXPRGRAPHNODE *node)
 
SCIP_EXPRGRAPHNODE ** SCIPexprgraphGetNodeParents (SCIP_EXPRGRAPHNODE *node)
 
int SCIPexprgraphGetNodeDepth (SCIP_EXPRGRAPHNODE *node)
 
int SCIPexprgraphGetNodePosition (SCIP_EXPRGRAPHNODE *node)
 
SCIP_EXPROP SCIPexprgraphGetNodeOperator (SCIP_EXPRGRAPHNODE *node)
 
int SCIPexprgraphGetNodeOperatorIndex (SCIP_EXPRGRAPHNODE *node)
 
SCIP_Real SCIPexprgraphGetNodeOperatorReal (SCIP_EXPRGRAPHNODE *node)
 
void * SCIPexprgraphGetNodeVar (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node)
 
SCIP_Real SCIPexprgraphGetNodeRealPowerExponent (SCIP_EXPRGRAPHNODE *node)
 
int SCIPexprgraphGetNodeIntPowerExponent (SCIP_EXPRGRAPHNODE *node)
 
SCIP_Real SCIPexprgraphGetNodeSignPowerExponent (SCIP_EXPRGRAPHNODE *node)
 
SCIP_RealSCIPexprgraphGetNodeLinearCoefs (SCIP_EXPRGRAPHNODE *node)
 
SCIP_Real SCIPexprgraphGetNodeLinearConstant (SCIP_EXPRGRAPHNODE *node)
 
SCIP_Real SCIPexprgraphGetNodeQuadraticConstant (SCIP_EXPRGRAPHNODE *node)
 
SCIP_RealSCIPexprgraphGetNodeQuadraticLinearCoefs (SCIP_EXPRGRAPHNODE *node)
 
SCIP_QUADELEMSCIPexprgraphGetNodeQuadraticQuadElements (SCIP_EXPRGRAPHNODE *node)
 
int SCIPexprgraphGetNodeQuadraticNQuadElements (SCIP_EXPRGRAPHNODE *node)
 
SCIP_EXPRDATA_MONOMIAL ** SCIPexprgraphGetNodePolynomialMonomials (SCIP_EXPRGRAPHNODE *node)
 
int SCIPexprgraphGetNodePolynomialNMonomials (SCIP_EXPRGRAPHNODE *node)
 
SCIP_Real SCIPexprgraphGetNodePolynomialConstant (SCIP_EXPRGRAPHNODE *node)
 
SCIP_RETCODE SCIPexprgraphGetNodePolynomialMonomialCurvature (SCIP_EXPRGRAPHNODE *node, int monomialidx, SCIP_Real infinity, SCIP_EXPRCURV *curv)
 
SCIP_USEREXPRDATASCIPexprgraphGetNodeUserData (SCIP_EXPRGRAPHNODE *node)
 
SCIP_Bool SCIPexprgraphHasNodeUserEstimator (SCIP_EXPRGRAPHNODE *node)
 
SCIP_INTERVAL SCIPexprgraphGetNodeBounds (SCIP_EXPRGRAPHNODE *node)
 
SCIP_Real SCIPexprgraphGetNodeVal (SCIP_EXPRGRAPHNODE *node)
 
SCIP_EXPRCURV SCIPexprgraphGetNodeCurvature (SCIP_EXPRGRAPHNODE *node)
 
SCIP_RETCODE SCIPexprgraphCreateNode (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, SCIP_EXPROP op,...)
 
SCIP_RETCODE SCIPexprgraphCreateNodeLinear (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, int ncoefs, SCIP_Real *coefs, SCIP_Real constant)
 
SCIP_RETCODE SCIPexprgraphCreateNodeQuadratic (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, int nchildren, SCIP_Real *lincoefs, int nquadelems, SCIP_QUADELEM *quadelems, SCIP_Real constant)
 
SCIP_RETCODE SCIPexprgraphCreateNodePolynomial (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, int nmonomials, SCIP_EXPRDATA_MONOMIAL **monomials, SCIP_Real constant, SCIP_Bool copymonomials)
 
SCIP_RETCODE SCIPexprgraphNodePolynomialAddMonomials (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE *node, int nmonomials, SCIP_EXPRDATA_MONOMIAL **monomials, SCIP_Bool copymonomials)
 
SCIP_RETCODE SCIPexprgraphCreateNodeUser (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, SCIP_USEREXPRDATA *data, SCIP_EXPRINTCAPABILITY evalcapability, SCIP_DECL_USEREXPREVAL((*eval)), SCIP_DECL_USEREXPRINTEVAL((*inteval)), SCIP_DECL_USEREXPRCURV((*curv)), SCIP_DECL_USEREXPRPROP((*prop)), SCIP_DECL_USEREXPRESTIMATE((*estimate)), SCIP_DECL_USEREXPRCOPYDATA((*copydata)), SCIP_DECL_USEREXPRFREEDATA((*freedata)))
 
SCIP_RETCODE SCIPexprgraphNodeSplitOffLinear (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE **node, int linvarssize, int *nlinvars, void **linvars, SCIP_Real *lincoefs, SCIP_Real *constant)
 
SCIP_RETCODE SCIPexprgraphMoveNodeParents (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE **srcnode, SCIP_EXPRGRAPHNODE *targetnode)
 
SCIP_RETCODE SCIPexprgraphReleaseNode (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE **node)
 
void SCIPexprgraphFreeNode (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node)
 
void SCIPexprgraphEnableNode (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node)
 
void SCIPexprgraphDisableNode (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node)
 
SCIP_Bool SCIPexprgraphHasNodeSibling (SCIP_EXPRGRAPHNODE *node)
 
SCIP_Bool SCIPexprgraphAreAllNodeChildrenVars (SCIP_EXPRGRAPHNODE *node)
 
SCIP_Bool SCIPexprgraphHasNodeNonlinearAncestor (SCIP_EXPRGRAPHNODE *node)
 
void SCIPexprgraphPrintNode (SCIP_EXPRGRAPHNODE *node, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
 
void SCIPexprgraphTightenNodeBounds (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, SCIP_INTERVAL nodebounds, SCIP_Real minstrength, SCIP_Real infinity, SCIP_Bool *cutoff)
 
SCIP_RETCODE SCIPexprgraphUpdateNodeBoundsCurvature (SCIP_EXPRGRAPHNODE *node, SCIP_Real infinity, SCIP_Real minstrength, SCIP_Bool clearreverseprop)
 
Expression graph methods
int SCIPexprgraphGetDepth (SCIP_EXPRGRAPH *exprgraph)
 
int * SCIPexprgraphGetNNodes (SCIP_EXPRGRAPH *exprgraph)
 
SCIP_EXPRGRAPHNODE *** SCIPexprgraphGetNodes (SCIP_EXPRGRAPH *exprgraph)
 
int SCIPexprgraphGetNVars (SCIP_EXPRGRAPH *exprgraph)
 
void ** SCIPexprgraphGetVars (SCIP_EXPRGRAPH *exprgraph)
 
SCIP_EXPRGRAPHNODE ** SCIPexprgraphGetVarNodes (SCIP_EXPRGRAPH *exprgraph)
 
void SCIPexprgraphSetVarNodeValue (SCIP_EXPRGRAPHNODE *varnode, SCIP_Real value)
 
void SCIPexprgraphSetVarsBounds (SCIP_EXPRGRAPH *exprgraph, SCIP_INTERVAL *varbounds)
 
void SCIPexprgraphSetVarBounds (SCIP_EXPRGRAPH *exprgraph, void *var, SCIP_INTERVAL varbounds)
 
void SCIPexprgraphSetVarNodeBounds (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *varnode, SCIP_INTERVAL varbounds)
 
void SCIPexprgraphSetVarNodeLb (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *varnode, SCIP_Real lb)
 
void SCIPexprgraphSetVarNodeUb (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *varnode, SCIP_Real ub)
 
SCIP_INTERVALSCIPexprgraphGetVarsBounds (SCIP_EXPRGRAPH *exprgraph)
 
SCIP_RETCODE SCIPexprgraphCreate (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPH **exprgraph, int varssizeinit, int depthinit, SCIP_DECL_EXPRGRAPHVARADDED((*exprgraphvaradded)), SCIP_DECL_EXPRGRAPHVARREMOVE((*exprgraphvarremove)), SCIP_DECL_EXPRGRAPHVARCHGIDX((*exprgraphvarchgidx)), void *userdata)
 
SCIP_RETCODE SCIPexprgraphFree (SCIP_EXPRGRAPH **exprgraph)
 
SCIP_RETCODE SCIPexprgraphAddNode (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, int mindepth, int nchildren, SCIP_EXPRGRAPHNODE **children)
 
SCIP_RETCODE SCIPexprgraphAddVars (SCIP_EXPRGRAPH *exprgraph, int nvars, void **vars, SCIP_EXPRGRAPHNODE **varnodes)
 
SCIP_RETCODE SCIPexprgraphAddConst (SCIP_EXPRGRAPH *exprgraph, SCIP_Real constant, SCIP_EXPRGRAPHNODE **constnode)
 
SCIP_RETCODE SCIPexprgraphAddExprtreeSum (SCIP_EXPRGRAPH *exprgraph, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *coefs, SCIP_EXPRGRAPHNODE **rootnode, SCIP_Bool *rootnodeisnew)
 
SCIP_RETCODE SCIPexprgraphReplaceVarByLinearSum (SCIP_EXPRGRAPH *exprgraph, void *var, int ncoefs, SCIP_Real *coefs, void **vars, SCIP_Real constant)
 
SCIP_Bool SCIPexprgraphFindVarNode (SCIP_EXPRGRAPH *exprgraph, void *var, SCIP_EXPRGRAPHNODE **varnode)
 
SCIP_Bool SCIPexprgraphFindConstNode (SCIP_EXPRGRAPH *exprgraph, SCIP_Real constant, SCIP_EXPRGRAPHNODE **constnode)
 
SCIP_RETCODE SCIPexprgraphPrintDot (SCIP_EXPRGRAPH *exprgraph, SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char **varnames)
 
SCIP_RETCODE SCIPexprgraphEval (SCIP_EXPRGRAPH *exprgraph, SCIP_Real *varvals)
 
SCIP_RETCODE SCIPexprgraphPropagateVarBounds (SCIP_EXPRGRAPH *exprgraph, SCIP_Real infinity, SCIP_Bool clearreverseprop, SCIP_Bool *domainerror)
 
void SCIPexprgraphPropagateNodeBounds (SCIP_EXPRGRAPH *exprgraph, SCIP_Real infinity, SCIP_Real minstrength, SCIP_Bool *cutoff)
 
SCIP_RETCODE SCIPexprgraphCheckCurvature (SCIP_EXPRGRAPH *exprgraph, SCIP_Real infinity, SCIP_Bool clearreverseprop)
 
SCIP_RETCODE SCIPexprgraphSimplify (SCIP_EXPRGRAPH *exprgraph, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Real eps, int maxexpansionexponent, SCIP_Bool *havechange, SCIP_Bool *domainerror)
 
SCIP_RETCODE SCIPexprgraphGetTree (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *rootnode, SCIP_EXPRTREE **exprtree)
 
SCIP_RETCODE SCIPexprgraphGetSeparableTrees (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, int exprtreessize, int *nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *exprtreecoefs)
 
void SCIPexprgraphGetSubtreeVarsUsage (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, int *varsusage)
 
int SCIPexprgraphGetSumTreesNSummands (SCIP_EXPRGRAPHNODE *node)
 
SCIP_RETCODE SCIPexprgraphGetSumTrees (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, int exprtreessize, int *nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *exprtreecoefs)
 

Function Documentation

SCIP_EXPRCURV SCIPexprcurvAdd ( SCIP_EXPRCURV  curv1,
SCIP_EXPRCURV  curv2 
)

gives curvature for a sum of two functions with given curvature

Parameters
curv1curvature of first summand
curv2curvature of second summand

Definition at line 188 of file expr.c.

Referenced by checkCurvature(), and SCIP_DECL_EXPRCURV().

SCIP_EXPRCURV SCIPexprcurvNegate ( SCIP_EXPRCURV  curvature)

gives the curvature for the negation of a function with given curvature

Parameters
curvaturecurvature of function

Definition at line 197 of file expr.c.

References SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIPABORT, and SCIPerrorMessage.

Referenced by reformulate(), SCIP_DECL_EXPRCURV(), SCIPexprcurvMonomial(), and SCIPexprcurvMultiply().

SCIP_EXPRCURV SCIPexprcurvMultiply ( SCIP_Real  factor,
SCIP_EXPRCURV  curvature 
)

gives curvature for a functions with given curvature multiplied by a constant factor

Parameters
factorconstant factor
curvaturecurvature of other factor

Definition at line 223 of file expr.c.

References SCIP_EXPRCURV_LINEAR, and SCIPexprcurvNegate().

Referenced by checkCurvature(), reformulate(), SCIP_DECL_EXPRCURV(), SCIPexprcurvMonomial(), and SCIPexprgraphGetNodePolynomialMonomialCurvature().

SCIP_EXPRCURV SCIPexprcurvPower ( SCIP_INTERVAL  basebounds,
SCIP_EXPRCURV  basecurv,
SCIP_Real  exponent 
)

gives curvature for base^exponent for given bounds and curvature of base-function and constant exponent

Parameters
baseboundsbounds on base function
basecurvcurvature of base function
exponentexponent

Definition at line 236 of file expr.c.

References EPSISINT, SCIP_Interval::inf, SCIP_Bool, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_Real, SCIPexprcurvPower(), SCIPintervalSetBounds(), sign(), and SCIP_Interval::sup.

Referenced by reformulate(), SCIP_DECL_EXPRCURV(), SCIPexprcurvMonomial(), and SCIPexprcurvPower().

SCIP_EXPRCURV SCIPexprcurvMonomial ( int  nfactors,
SCIP_Real exponents,
int *  factoridxs,
SCIP_EXPRCURV factorcurv,
SCIP_INTERVAL factorbounds 
)

gives curvature for a monomial with given curvatures and bounds for each factor

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.

Parameters
nfactorsnumber of factors in monomial
exponentsexponents in monomial, or NULL if all 1.0
factoridxsindices of factors (but not exponents), or NULL if identity mapping
factorcurvcurvature of each factor
factorboundsbounds of each factor

Definition at line 344 of file expr.c.

References EPSGE, EPSISINT, EPSLE, FALSE, NULL, SCIP_Bool, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_Real, SCIPexprcurvMultiply(), SCIPexprcurvNegate(), SCIPexprcurvPower(), and TRUE.

Referenced by SCIP_DECL_EXPRCURV(), and SCIPexprgraphGetNodePolynomialMonomialCurvature().

const char* SCIPexprcurvGetName ( SCIP_EXPRCURV  curv)

gives name as string for a curvature

Parameters
curvcurvature

Definition at line 457 of file expr.c.

References curvnames, and SCIP_EXPRCURV_LINEAR.

Referenced by checkCurvature(), reformEnsureChildrenMinCurvature(), reformulate(), and registerBranchingVariables().

const char* SCIPexpropGetName ( SCIP_EXPROP  op)

gives the name of an operand

gives the name of an operand as string

Parameters
opexpression operand

Definition at line 3237 of file expr.c.

References SCIP_EXPR_LAST.

Referenced by exprgraphNodeUpdateBounds(), exprgraphPrintNodeExpression(), printExpr(), printRowNl(), reformulate(), SCIPexprgraphNodeSplitOffLinear(), SCIPexprgraphReleaseNode(), SCIPexprgraphUpdateNodeBoundsCurvature(), and SCIPwritePip().

int SCIPexpropGetNChildren ( SCIP_EXPROP  op)

gives the number of children of a simple operand

Returns
-1 for invalid operands and -2 for complex operands (those where the number of children depends on the expression)

gives the number of children of a simple operand

Parameters
opexpression operand

Definition at line 3247 of file expr.c.

References SCIP_EXPR_LAST.

SCIP_EXPR** SCIPexprGetChildren ( SCIP_EXPR expr)

gives pointer to array with children of an expression

Parameters
exprexpression

Definition at line 5593 of file expr.c.

References SCIP_Expr::children, and NULL.

Referenced by addUserEstimator(), analyzeTree(), eval(), exprIsNonSmooth(), getCoeffsAndConstantFromLinearExpr(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), readObjective(), SCIPexprAdd(), and SCIPwritePip().

int SCIPexprGetOpIndex ( SCIP_EXPR expr)

gives index belonging to a SCIP_EXPR_VARIDX or SCIP_EXPR_PARAM operand

Parameters
exprexpression

Definition at line 5603 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, SCIP_EXPR_PARAM, and SCIP_EXPR_VARIDX.

Referenced by eval(), exprsimplifySeparateLinearFromPolynomial(), getCoeffsAndConstantFromLinearExpr(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), and readObjective().

SCIP_Real SCIPexprGetOpReal ( SCIP_EXPR expr)

gives real belonging to a SCIP_EXPR_CONST operand

Parameters
exprexpression

Definition at line 5614 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_CONST.

Referenced by eval(), exprParse(), exprsimplifyFlattenPolynomials(), getCoeffsAndConstantFromLinearExpr(), printExpr(), printRowNl(), readExpression(), SCIPexprAdd(), and SCIPexprMulConstant().

void* SCIPexprGetOpData ( SCIP_EXPR expr)

gives void* belonging to a complex operand

Parameters
exprexpression

Definition at line 5625 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_SUM.

SCIP_Real SCIPexprGetRealPowerExponent ( SCIP_EXPR expr)

gives exponent belonging to a SCIP_EXPR_REALPOWER expression

Parameters
exprexpression

Definition at line 5636 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_REALPOWER.

Referenced by eval(), printExpr(), printRowNl(), and SCIPwritePip().

int SCIPexprGetIntPowerExponent ( SCIP_EXPR expr)

gives exponent belonging to a SCIP_EXPR_INTPOWER expression

Parameters
exprexpression

Definition at line 5647 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_INTPOWER.

Referenced by eval(), printExpr(), printRowNl(), and SCIPwritePip().

SCIP_Real SCIPexprGetSignPowerExponent ( SCIP_EXPR expr)

gives exponent belonging to a SCIP_EXPR_SIGNPOWER expression

Parameters
exprexpression

Definition at line 5658 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_SIGNPOWER.

Referenced by atomic_signpower< Type >::atomic_signpower(), evalSignPower(), and printExpr().

SCIP_Real* SCIPexprGetLinearCoefs ( SCIP_EXPR expr)

gives linear coefficients belonging to a SCIP_EXPR_LINEAR expression

Parameters
exprexpression

Definition at line 5669 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, SCIP_EXPR_LINEAR, and SCIP_Real.

Referenced by eval(), getCoeffsAndConstantFromLinearExpr(), printExpr(), printRowNl(), and SCIPexprAdd().

SCIP_Real SCIPexprGetLinearConstant ( SCIP_EXPR expr)

gives constant belonging to a SCIP_EXPR_LINEAR expression

Parameters
exprexpression

Definition at line 5682 of file expr.c.

References SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_EXPR_LINEAR, and SCIP_Real.

Referenced by eval(), getCoeffsAndConstantFromLinearExpr(), printExpr(), printRowNl(), and SCIPexprAdd().

SCIP_QUADELEM* SCIPexprGetQuadElements ( SCIP_EXPR expr)

gives quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
exprquadratic expression

Definition at line 5695 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_QUADRATIC.

Referenced by eval(), printExpr(), and printRowNl().

SCIP_Real SCIPexprGetQuadConstant ( SCIP_EXPR expr)

gives constant belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
exprquadratic expression

Definition at line 5707 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_QUADRATIC.

Referenced by eval(), printExpr(), and printRowNl().

SCIP_Real* SCIPexprGetQuadLinearCoefs ( SCIP_EXPR expr)

gives linear coefficients belonging to a SCIP_EXPR_QUADRATIC expression can be NULL if all coefficients are 0.0

Parameters
exprquadratic expression

Definition at line 5720 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_QUADRATIC.

Referenced by eval(), printExpr(), and printRowNl().

int SCIPexprGetNQuadElements ( SCIP_EXPR expr)

gives number of quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
exprquadratic expression

Definition at line 5732 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_QUADRATIC.

Referenced by eval(), printExpr(), and printRowNl().

SCIP_EXPRDATA_MONOMIAL** SCIPexprGetMonomials ( SCIP_EXPR expr)

gives the monomials belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
exprexpression

Definition at line 5744 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_POLYNOMIAL.

Referenced by eval(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), readObjective(), and SCIPwritePip().

int SCIPexprGetNMonomials ( SCIP_EXPR expr)

gives the number of monomials belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
exprexpression

Definition at line 5756 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_POLYNOMIAL.

Referenced by eval(), exprsimplifyFlattenPolynomials(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), readConstraints(), readObjective(), and SCIPwritePip().

SCIP_Real SCIPexprGetPolynomialConstant ( SCIP_EXPR expr)

gives the constant belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
exprexpression

Definition at line 5768 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_POLYNOMIAL.

Referenced by eval(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), and readObjective().

SCIP_Real SCIPexprGetMonomialCoef ( SCIP_EXPRDATA_MONOMIAL monomial)

gets coefficient of a monomial

Parameters
monomialmonomial

Definition at line 5780 of file expr.c.

References SCIP_ExprData_Monomial::coef, and NULL.

Referenced by eval(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), readObjective(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

int SCIPexprGetMonomialNFactors ( SCIP_EXPRDATA_MONOMIAL monomial)

gets number of factors of a monomial

Parameters
monomialmonomial

Definition at line 5790 of file expr.c.

References SCIP_ExprData_Monomial::nfactors, and NULL.

Referenced by eval(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), readObjective(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_NONLINCONSUPGD(), and SCIPwritePip().

int* SCIPexprGetMonomialChildIndices ( SCIP_EXPRDATA_MONOMIAL monomial)

gets indices of children corresponding to factors of a monomial

Parameters
monomialmonomial

Definition at line 5800 of file expr.c.

References SCIP_ExprData_Monomial::childidxs, and NULL.

Referenced by eval(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), readObjective(), and reformulate().

SCIP_Real* SCIPexprGetMonomialExponents ( SCIP_EXPRDATA_MONOMIAL monomial)

gets exponents in factors of a monomial

Parameters
monomialmonomial

Definition at line 5810 of file expr.c.

References SCIP_ExprData_Monomial::exponents, and NULL.

Referenced by eval(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), readObjective(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_NONLINCONSUPGD(), and SCIPwritePip().

SCIP_USEREXPRDATA* SCIPexprGetUserData ( SCIP_EXPR expr)

gets user data of a user expression

Definition at line 5820 of file expr.c.

References SCIP_Expr::data, and NULL.

SCIP_Bool SCIPexprHasUserEstimator ( SCIP_EXPR expr)

indicates whether a user expression has the estimator callback defined

Definition at line 5831 of file expr.c.

References SCIP_Expr::data, and NULL.

Referenced by addUserEstimator().

SCIP_EXPRINTCAPABILITY SCIPexprGetUserEvalCapability ( SCIP_EXPR expr)

gives the evaluation capability of a user expression

Definition at line 5842 of file expr.c.

References SCIP_Expr::data, and NULL.

Referenced by analyzeTree().

SCIP_RETCODE SCIPexprCreate ( BMS_BLKMEM blkmem,
SCIP_EXPR **  expr,
SCIP_EXPROP  op,
  ... 
)

creates a simple expression

Parameters
blkmemblock memory data structure
exprpointer to buffer for expression address
opoperand of expression

Definition at line 5853 of file expr.c.

References BMSallocBlockMemoryArray, BMSduplicateBlockMemoryArray, SCIP_Expr::data, exprCreate(), NULL, SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_ABS, SCIP_EXPR_CONST, SCIP_EXPR_COS, SCIP_EXPR_DIV, SCIP_EXPR_EXP, SCIP_EXPR_INTPOWER, SCIP_EXPR_LAST, SCIP_EXPR_LINEAR, SCIP_EXPR_LOG, SCIP_EXPR_MAX, SCIP_EXPR_MIN, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PARAM, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SIGN, SCIP_EXPR_SIGNPOWER, SCIP_EXPR_SIN, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_EXPR_TAN, SCIP_EXPR_USER, SCIP_EXPR_VARIDX, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPABORT, and SCIPerrorMessage.

Referenced by createConsFromQuadTerm(), createExprtreeFromMonomial(), createNlRow(), exprgraphNodeCreateExpr(), exprParse(), exprparseReadVariable(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), initSepaData(), initSepaDataCreateVred(), readExpression(), readNonlinearExprs(), readPolynomial(), removeFixedVariables(), SCIPexprAdd(), SCIPexprgraphGetSeparableTrees(), SCIPexprgraphGetSumTrees(), SCIPexprMulConstant(), SCIPexprtreeAddExpr(), SCIPexprtreeRemoveFixedVars(), and SCIPwritePip().

SCIP_RETCODE SCIPexprCopyDeep ( BMS_BLKMEM blkmem,
SCIP_EXPR **  targetexpr,
SCIP_EXPR sourceexpr 
)
void SCIPexprFreeShallow ( BMS_BLKMEM blkmem,
SCIP_EXPR **  expr 
)

frees an expression but not its children

Parameters
blkmemblock memory data structure
exprpointer to expression to free

Definition at line 6099 of file expr.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, and NULL.

Referenced by SCIPexprAdd().

SCIP_RETCODE SCIPexprAdd ( BMS_BLKMEM blkmem,
SCIP_EXPR **  expr,
SCIP_Real  coef1,
SCIP_EXPR term1,
SCIP_Real  coef2,
SCIP_EXPR term2,
SCIP_Real  constant 
)

creates an expression from the addition of two given expression, with coefficients, and a constant

the given expressions may be modified or freed, otherwise it will be used a child expression favors creation and maintaining of SCIP_EXPR_LINEAR over SCIP_EXPR_PLUS or SCIP_EXPR_SUM

creates an expression from the addition of two given expression, with coefficients, and a constant

The given expressions may be modified or freed, otherwise it will be used a child expression. Favors creation and maintaining of SCIP_EXPR_LINEAR over SCIP_EXPR_PLUS or SCIP_EXPR_SUM.

Parameters
blkmemblock memory data structure
exprpointer to store pointer to created expression
coef1coefficient of first term
term1expression of first term, or NULL
coef2coefficient of second term
term2expression of second term, or NULL
constantconstant term to add

Definition at line 6124 of file expr.c.

References SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_LINEAR, SCIP_OKAY, SCIP_Real, SCIPexprAddToLinear(), SCIPexprCreate(), SCIPexprCreateLinear(), SCIPexprFreeDeep(), SCIPexprFreeShallow(), SCIPexprGetChildren(), SCIPexprGetLinearCoefs(), SCIPexprGetLinearConstant(), SCIPexprGetNChildren(), SCIPexprGetOperator(), and SCIPexprGetOpReal().

Referenced by exprParse(), and readExpression().

SCIP_RETCODE SCIPexprMulConstant ( BMS_BLKMEM blkmem,
SCIP_EXPR **  expr,
SCIP_EXPR term,
SCIP_Real  factor 
)

creates an expression from the multiplication of an expression with a constant

the given expressions may be modified or freed, otherwise it will be used a child expression favors creation of SCIP_EXPR_LINEAR over SCIP_EXPR_MUP or SCIP_EXPR_PROD

creates an expression from the multiplication of an expression with a constant

The given expressions may be modified or freed, otherwise it will be used a child expression. Favors creation and maintaining SCIP_EXPR_LINEAR over SCIP_EXPR_PLUS or SCIP_EXPR_SUM.

Parameters
blkmemblock memory data structure
exprbuffer to store pointer to created expression
termterm to multiply by factor
factorfactor

Definition at line 6282 of file expr.c.

References SCIP_ExprData_Monomial::coef, SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, SCIP_Expr::data, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Polynomial::monomials, SCIP_Expr::nchildren, NULL, SCIP_ExprData_Quadratic::quadelems, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_LINEAR, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_QUADRATIC, SCIP_OKAY, SCIP_Real, SCIPexprCreate(), SCIPexprCreateLinear(), SCIPexprFreeDeep(), SCIPexprGetNChildren(), SCIPexprGetOperator(), and SCIPexprGetOpReal().

Referenced by exprParse(), and readExpression().

SCIP_RETCODE SCIPexprCreateLinear ( BMS_BLKMEM blkmem,
SCIP_EXPR **  expr,
int  nchildren,
SCIP_EXPR **  children,
SCIP_Real coefs,
SCIP_Real  constant 
)

creates a SCIP_EXPR_LINEAR expression that is (affine) linear in its children: constant + sum_i coef_i child_i

Parameters
blkmemblock memory data structure
exprpointer to buffer for expression address
nchildrennumber of children
childrenchildren of expression
coefscoefficients of children
constantconstant part

Definition at line 6380 of file expr.c.

References BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSduplicateBlockMemoryArray, exprCreate(), NULL, SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_LINEAR, SCIP_OKAY, and SCIP_Real.

Referenced by createNlRow(), exprgraphNodeCreateExpr(), exprparseReadVariable(), initSepaData(), initSepaDataCreateVred(), readExpression(), removeFixedVariables(), SCIPexprAdd(), SCIPexprgraphGetSeparableTrees(), SCIPexprMulConstant(), and SCIPexprtreeRemoveFixedVars().

SCIP_RETCODE SCIPexprAddToLinear ( BMS_BLKMEM blkmem,
SCIP_EXPR expr,
int  nchildren,
SCIP_Real coefs,
SCIP_EXPR **  children,
SCIP_Real  constant 
)

adds new terms to a linear expression

Parameters
blkmemblock memory
exprlinear expression
nchildrennumber of children to add
coefscoefficients of additional children
childrenadditional children expressions
constantconstant to add

Definition at line 6417 of file expr.c.

References BMScopyMemoryArray, BMSreallocBlockMemoryArray, SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_ALLOC, SCIP_EXPR_LINEAR, SCIP_OKAY, and SCIP_Real.

Referenced by SCIPexprAdd().

SCIP_RETCODE SCIPexprCreateQuadratic ( BMS_BLKMEM blkmem,
SCIP_EXPR **  expr,
int  nchildren,
SCIP_EXPR **  children,
SCIP_Real  constant,
SCIP_Real lincoefs,
int  nquadelems,
SCIP_QUADELEM quadelems 
)

creates a SCIP_EXPR_QUADRATIC expression: constant + sum_i coef_i child_i + sum_i coef_i child1_i child2_i

Parameters
blkmemblock memory data structure
exprpointer to buffer for expression address
nchildrennumber of children
childrenchildren of expression
constantconstant
lincoefslinear coefficients of children, or NULL if all 0.0
nquadelemsnumber of quadratic elements
quadelemsquadratic elements specifying coefficients and child indices

Definition at line 6462 of file expr.c.

References BMSduplicateBlockMemoryArray, exprCreate(), NULL, quadraticdataCreate(), SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_QUADRATIC, and SCIP_OKAY.

Referenced by createConsFromQuadTerm(), exprgraphNodeCreateExpr(), readExpression(), readNonlinearExprs(), and SCIPexprgraphGetSeparableTrees().

void SCIPexprSortQuadElems ( SCIP_EXPR expr)

ensures that quadratic elements of a quadratic expression are sorted

Parameters
exprquadratic expression

Definition at line 6498 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, quadraticdataSort(), and SCIP_EXPR_QUADRATIC.

Referenced by eval(), and SCIPexprAreEqual().

SCIP_RETCODE SCIPexprCreatePolynomial ( BMS_BLKMEM blkmem,
SCIP_EXPR **  expr,
int  nchildren,
SCIP_EXPR **  children,
int  nmonomials,
SCIP_EXPRDATA_MONOMIAL **  monomials,
SCIP_Real  constant,
SCIP_Bool  copymonomials 
)

creates a SCIP_EXPR_POLYNOMIAL expression from an array of monomials: constant + sum_i monomial_i

Parameters
blkmemblock memory data structure
exprpointer to buffer for expression address
nchildrennumber of children
childrenchildren of expression
nmonomialsnumber of monomials
monomialsmonomials
constantconstant part
copymonomialsshould monomials by copied or ownership be assumed?

Definition at line 6510 of file expr.c.

References BMSduplicateBlockMemoryArray, exprCreate(), NULL, polynomialdataCreate(), SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_POLYNOMIAL, and SCIP_OKAY.

Referenced by createExprtreeFromMonomial(), createNlRow(), exprgraphNodeCreateExpr(), readPolynomial(), SCIPexprgraphGetSeparableTrees(), and SCIPexprgraphGetSumTrees().

SCIP_RETCODE SCIPexprAddMonomials ( BMS_BLKMEM blkmem,
SCIP_EXPR expr,
int  nmonomials,
SCIP_EXPRDATA_MONOMIAL **  monomials,
SCIP_Bool  copymonomials 
)

adds an array of monomials to a SCIP_EXPR_POLYNOMIAL expression

Parameters
blkmemblock memory of expression
exprexpression
nmonomialsnumber of monomials to add
monomialsthe monomials to add
copymonomialsshould monomials by copied or ownership be assumed?

Definition at line 6545 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataAddMonomials(), SCIP_CALL, SCIP_EXPR_POLYNOMIAL, and SCIP_OKAY.

void SCIPexprChgPolynomialConstant ( SCIP_EXPR expr,
SCIP_Real  constant 
)

changes the constant in a SCIP_EXPR_POLYNOMIAL expression

Parameters
exprexpression
constantnew value for constant

Definition at line 6567 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_POLYNOMIAL.

void SCIPexprMultiplyPolynomialByConstant ( BMS_BLKMEM blkmem,
SCIP_EXPR expr,
SCIP_Real  factor 
)

multiplies each summand of a polynomial by a given constant

Parameters
blkmemblock memory
exprpolynomial expression
factorconstant factor

Definition at line 6580 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataMultiplyByConstant(), and SCIP_EXPR_POLYNOMIAL.

SCIP_RETCODE SCIPexprMultiplyPolynomialByMonomial ( BMS_BLKMEM blkmem,
SCIP_EXPR expr,
SCIP_EXPRDATA_MONOMIAL factor,
int *  childmap 
)

multiplies each summand of a polynomial by a given monomial

Parameters
blkmemblock memory
exprpolynomial expression
factormonomial factor
childmapmap children in factor to children in expr, or NULL for 1:1

Definition at line 6594 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataMultiplyByMonomial(), SCIP_CALL, SCIP_EXPR_POLYNOMIAL, and SCIP_OKAY.

SCIP_RETCODE SCIPexprMultiplyPolynomialByPolynomial ( BMS_BLKMEM blkmem,
SCIP_EXPR expr,
SCIP_EXPR factor,
int *  childmap 
)

multiplies this polynomial by a polynomial factor needs to be different from expr

multiplies this polynomial by a polynomial

Factor needs to be different from expr. Children of factor need to be children of expr already, w.r.t. an optional mapping of child indices.

Parameters
blkmemblock memory
exprpolynomial expression
factorpolynomial factor
childmapmap children in factor to children in expr, or NULL for 1:1

Definition at line 6617 of file expr.c.

References SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, polynomialdataMultiplyByPolynomial(), SCIP_CALL, SCIP_EXPR_POLYNOMIAL, SCIP_OKAY, and SCIPexprAreEqual().

SCIP_RETCODE SCIPexprPolynomialPower ( BMS_BLKMEM blkmem,
SCIP_EXPR expr,
int  exponent 
)

takes a power of the polynomial exponent need to be an integer polynomial need to be a monomial, if exponent is negative

takes a power of the polynomial

Exponent need to be an integer. Polynomial needs to be a monomial, if exponent is negative.

Parameters
blkmemblock memory
exprpolynomial expression
exponentexponent of power operation

Definition at line 6663 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataPower(), SCIP_CALL, SCIP_EXPR_POLYNOMIAL, and SCIP_OKAY.

void SCIPexprMergeMonomials ( BMS_BLKMEM blkmem,
SCIP_EXPR expr,
SCIP_Real  eps,
SCIP_Bool  mergefactors 
)

merges monomials in a polynomial expression that differ only in coefficient into a single monomial eliminates monomials with coefficient between -eps and eps

merges monomials in a polynomial expression that differ only in coefficient into a single monomial

Eliminates monomials with coefficient between -eps and eps.

Parameters
blkmemblock memory
exprpolynomial expression
epsthreshold under which numbers are treat as zero
mergefactorswhether to merge factors in monomials too

Definition at line 6683 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataMergeMonomials(), and SCIP_EXPR_POLYNOMIAL.

Referenced by exprsimplifyFlattenPolynomials().

SCIP_RETCODE SCIPexprCreateMonomial ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_MONOMIAL **  monomial,
SCIP_Real  coef,
int  nfactors,
int *  childidxs,
SCIP_Real exponents 
)

creates a monomial

Parameters
blkmemblock memory
monomialbuffer where to store pointer to new monomial
coefcoefficient of monomial
nfactorsnumber of factors in monomial
childidxsindices of children corresponding to factors, or NULL if identity
exponentsexponent in each factor, or NULL if all 1.0

Definition at line 6913 of file expr.c.

References BMSallocBlockMemory, BMSallocBlockMemoryArray, BMSduplicateBlockMemoryArray, NULL, SCIP_ALLOC, and SCIP_OKAY.

Referenced by createExprtreeFromMonomial(), createNlRow(), exprConvertToPolynomial(), polynomialdataAddMonomials(), polynomialdataCopy(), polynomialdataCreate(), polynomialdataMultiplyByMonomial(), polynomialdataMultiplyByPolynomial(), readPolynomial(), reformulate(), SCIPexprgraphGetSeparableTrees(), and SCIPexprgraphGetSumTrees().

void SCIPexprFreeMonomial ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_MONOMIAL **  monomial 
)

frees a monomial

Parameters
blkmemblock memory
monomialpointer to monomial that should be freed

Definition at line 6970 of file expr.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, and NULL.

Referenced by exprConvertToPolynomial(), polynomialdataExpandMonomialFactor(), polynomialdataFree(), polynomialdataMergeMonomials(), polynomialdataMultiplyByConstant(), and polynomialdataPower().

void SCIPexprSortMonomialFactors ( SCIP_EXPRDATA_MONOMIAL monomial)
SCIP_Bool SCIPexprFindMonomialFactor ( SCIP_EXPRDATA_MONOMIAL monomial,
int  childidx,
int *  pos 
)

finds a factor corresponding to a given child index in a monomial note that if the factors have not been merged, the position of some factor corresponding to a given child is given returns TRUE if a factor is found, FALSE if not

finds a factor corresponding to a given child index in a monomial

Note that if the factors have not been merged, the position of some factor corresponding to a given child is given. Returns TRUE if a factor is found, FALSE if not.

Parameters
monomialmonomial
childidxindex of the child which factor to search for
posbuffer to store position of factor

Definition at line 7014 of file expr.c.

References SCIP_ExprData_Monomial::childidxs, FALSE, SCIP_ExprData_Monomial::nfactors, NULL, SCIPexprSortMonomialFactors(), and SCIPsortedvecFindInt().

Referenced by exprgraphNodeSimplify(), and exprsimplifyFlattenPolynomials().

SCIP_Bool SCIPexprAreMonomialsEqual ( SCIP_EXPRDATA_MONOMIAL monomial1,
SCIP_EXPRDATA_MONOMIAL monomial2,
SCIP_Real  eps 
)

checks if two monomials are equal

Parameters
monomial1first monomial
monomial2second monomial
epsthreshold under which numbers are treated as 0.0

Definition at line 6698 of file expr.c.

References SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, EPSEQ, SCIP_ExprData_Monomial::exponents, FALSE, SCIP_ExprData_Monomial::nfactors, NULL, SCIPexprSortMonomialFactors(), and TRUE.

Referenced by exprgraphFindParentByOperator(), and SCIPexprAreEqual().

SCIP_RETCODE SCIPexprAddMonomialFactors ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_MONOMIAL monomial,
int  nfactors,
int *  childidxs,
SCIP_Real exponents 
)

adds factors to a monomial

Parameters
blkmemblock memory
monomialmonomial
nfactorsnumber of factors to add
childidxsindices of children corresponding to factors
exponentsexponent in each factor

Definition at line 6740 of file expr.c.

References BMScopyMemoryArray, SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::exponents, monomialdataEnsureFactorsSize(), SCIP_ExprData_Monomial::nfactors, NULL, SCIP_CALL, SCIP_OKAY, and SCIP_ExprData_Monomial::sorted.

Referenced by exprConvertToPolynomial(), polynomialdataExpandMonomialFactor(), and SCIPexprMultiplyMonomialByMonomial().

void SCIPexprChgMonomialCoef ( SCIP_EXPRDATA_MONOMIAL monomial,
SCIP_Real  newcoef 
)

changes coefficient of monomial

Parameters
monomialmonomial
newcoefnew coefficient

Definition at line 6729 of file expr.c.

References SCIP_ExprData_Monomial::coef, and NULL.

Referenced by polynomialdataMultiplyByConstant(), and polynomialdataMultiplyByPolynomial().

SCIP_RETCODE SCIPexprMultiplyMonomialByMonomial ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_MONOMIAL monomial,
SCIP_EXPRDATA_MONOMIAL factor,
int *  childmap 
)

multiplies a monomial with a monomial

Parameters
blkmemblock memory
monomialmonomial
factorfactor monomial
childmapmap to apply to children in factor, or NULL for 1:1

Definition at line 6769 of file expr.c.

References SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Monomial::nfactors, NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprAddMonomialFactors().

Referenced by polynomialdataMultiplyByMonomial(), and polynomialdataMultiplyByPolynomial().

void SCIPexprMonomialPower ( SCIP_EXPRDATA_MONOMIAL monomial,
int  exponent 
)

replaces the monomial by a power of the monomial allows only integers as exponent

replaces the monomial by a power of the monomial

Allows only integers as exponent.

Parameters
monomialmonomial
exponentinteger exponent of power operation

Definition at line 6804 of file expr.c.

References SCIP_ExprData_Monomial::coef, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Monomial::nfactors, NULL, pow(), and SCIP_Real.

Referenced by polynomialdataPower().

void SCIPexprMergeMonomialFactors ( SCIP_EXPRDATA_MONOMIAL monomial,
SCIP_Real  eps 
)

merges factors that correspond to the same child by adding exponents eliminates factors with exponent between -eps and eps

merges factors that correspond to the same child by adding exponents

Eliminates factors with exponent between -eps and eps.

Parameters
monomialmonomial
epsthreshold under which numbers are treated as 0.0

Definition at line 6834 of file expr.c.

References SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, EPSEQ, EPSISINT, EPSROUND, EPSZ, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Monomial::nfactors, NULL, and SCIPexprSortMonomialFactors().

Referenced by polynomialdataMergeMonomials().

void SCIPexprSortMonomials ( SCIP_EXPR expr)

ensures that monomials of a polynomial are sorted

Parameters
exprpolynomial expression

Definition at line 6901 of file expr.c.

References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataSortMonomials(), and SCIP_EXPR_POLYNOMIAL.

Referenced by SCIPexprAreEqual().

SCIP_RETCODE SCIPexprCreateUser ( BMS_BLKMEM blkmem,
SCIP_EXPR **  expr,
int  nchildren,
SCIP_EXPR **  children,
SCIP_USEREXPRDATA data,
SCIP_EXPRINTCAPABILITY  evalcapability,
SCIP_DECL_USEREXPREVAL((*eval))  ,
SCIP_DECL_USEREXPRINTEVAL((*inteval))  ,
SCIP_DECL_USEREXPRCURV((*curv))  ,
SCIP_DECL_USEREXPRPROP((*prop))  ,
SCIP_DECL_USEREXPRESTIMATE((*estimate))  ,
SCIP_DECL_USEREXPRCOPYDATA((*copydata))  ,
SCIP_DECL_USEREXPRFREEDATA((*freedata))   
)

creates a user expression

Parameters
blkmemblock memory data structure
exprpointer to buffer for expression address
nchildrennumber of children
childrenchildren of expression
datauser data for expression, expression assumes ownership
evalcapabilitycapability of evaluation functions (partially redundant, currently)

Definition at line 7031 of file expr.c.

References BMSallocBlockMemory, BMSduplicateBlockMemoryArray, eval(), SCIP_ExprData_User::evalcapability, exprCreate(), NULL, SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_USER, SCIP_EXPRINTCAPABILITY_FUNCVALUE, SCIP_EXPRINTCAPABILITY_INTFUNCVALUE, SCIP_OKAY, and SCIP_ExprData_User::userdata.

Referenced by exprgraphNodeCreateExpr().

SCIP_Bool SCIPexprHasParam ( SCIP_EXPR expr)

indicates whether the expression contains a SCIP_EXPR_PARAM

Parameters
exprexpression

Definition at line 7089 of file expr.c.

References SCIP_Expr::children, FALSE, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_EXPR_PARAM, SCIPexprHasParam(), and TRUE.

Referenced by SCIPexprHasParam(), and SCIPexprtreeHasParam().

void SCIPexprGetVarsUsage ( SCIP_EXPR expr,
int *  varsusage 
)

counts usage of variables in expression

Parameters
exprexpression to update
varsusagearray with counters of variable usage

Definition at line 7433 of file expr.c.

References SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_EXPR_VARIDX, and SCIPexprGetVarsUsage().

Referenced by exprsimplifySeparateLinearFromPolynomial(), SCIPexprGetVarsUsage(), and SCIPexprtreeGetVarsUsage().

SCIP_Bool SCIPexprAreEqual ( SCIP_EXPR expr1,
SCIP_EXPR expr2,
SCIP_Real  eps 
)

compares whether two expressions are the same inconclusive, i.e., may give FALSE even if expressions are equivalent (x*y != y*x)

compares whether two expressions are the same

Inconclusive, i.e., may give FALSE even if expressions are equivalent (x*y != y*x).

Parameters
expr1first expression
expr2second expression
epsthreshold under which numbers are assumed to be zero

Definition at line 7456 of file expr.c.

References SCIP_Expr::children, SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, SCIP_Expr::data, EPSEQ, EPSZ, FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Polynomial::monomials, SCIP_Expr::nchildren, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_Expr::op, SCIP_ExprData_Quadratic::quadelems, SCIP_EXPR_ABS, SCIP_EXPR_CONST, SCIP_EXPR_COS, SCIP_EXPR_DIV, SCIP_EXPR_EXP, SCIP_EXPR_INTPOWER, SCIP_EXPR_LAST, SCIP_EXPR_LINEAR, SCIP_EXPR_LOG, SCIP_EXPR_MAX, SCIP_EXPR_MIN, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PARAM, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SIGN, SCIP_EXPR_SIGNPOWER, SCIP_EXPR_SIN, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_EXPR_TAN, SCIP_EXPR_USER, SCIP_EXPR_VARIDX, SCIP_Real, SCIPABORT, SCIPerrorMessage, SCIPexprAreEqual(), SCIPexprAreMonomialsEqual(), SCIPexprSortMonomials(), SCIPexprSortQuadElems(), and TRUE.

Referenced by exprsimplifyAddChildren(), exprsimplifyRemoveDuplicatePolynomialChildren(), SCIPexprAreEqual(), and SCIPexprMultiplyPolynomialByPolynomial().

SCIP_RETCODE SCIPexprSimplify ( BMS_BLKMEM blkmem,
SCIP_MESSAGEHDLR messagehdlr,
SCIP_EXPR expr,
SCIP_Real  eps,
int  maxexpansionexponent,
int  nvars,
int *  nlinvars,
int *  linidxs,
SCIP_Real lincoefs 
)

aims at simplifying an expression and splitting of a linear expression if linear variables are split off, expression interpreter data, if stored in the tree, is freed

aims at simplifying an expression and splitting of a linear expression

If linear variables are split off, expression interpreter data, if stored in the tree, is freed.

Parameters
blkmemblock memory data structure
messagehdlrmessage handler
exprexpression
epsthreshold, under which positive values are treat as 0
maxexpansionexponentmaximal exponent for which we still expand non-monomial polynomials
nvarsnumber of variables in expression
nlinvarsbuffer to store number of linear variables in linear part, or NULL if linear part should not be separated
linidxsarray to store indices of variables in expression tree which belong to linear part, or NULL
lincoefsarray to store coefficients of linear part, or NULL

Definition at line 7665 of file expr.c.

References exprsimplifyConvertToPolynomials(), exprsimplifyFlattenPolynomials(), exprsimplifySeparateLinearFromPolynomial(), exprsimplifyUnconvertPolynomials(), NULL, SCIP_CALL, SCIP_OKAY, SCIPdebug, SCIPdebugMessage, SCIPdebugPrintf, and SCIPexprPrint().

Referenced by SCIPexprtreeSimplify().

SCIP_RETCODE SCIPexprEvalShallow ( SCIP_EXPR expr,
SCIP_Real argvals,
SCIP_Real varvals,
SCIP_Real param,
SCIP_Real val 
)

evaluates an expression w.r.t. given values for children expressions

Parameters
exprexpression
argvalsvalues for children, can be NULL if the expression has no children
varvalsvalues for variables, can be NULL if the expression operand is not a variable
paramvalues for parameters, can be NULL if the expression operand is not a parameter
valbuffer to store value

Definition at line 7717 of file expr.c.

References SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_CALL, and SCIP_OKAY.

SCIP_RETCODE SCIPexprEval ( SCIP_EXPR expr,
SCIP_Real varvals,
SCIP_Real param,
SCIP_Real val 
)

evaluates an expression w.r.t. a point

Parameters
exprexpression
varvalsvalues for variables, can be NULL if the expression is constant
paramvalues for parameters, can be NULL if the expression is not parameterized
valbuffer to store value

Definition at line 7736 of file expr.c.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_ALLOC, SCIP_CALL, SCIP_EXPRESSION_MAXCHILDEST, SCIP_OKAY, SCIP_Real, and SCIPexprEval().

Referenced by addUserEstimator(), exprsimplifyFlattenPolynomials(), SCIPexprEval(), and SCIPexprtreeEval().

SCIP_RETCODE SCIPexprEvalIntShallow ( SCIP_EXPR expr,
SCIP_Real  infinity,
SCIP_INTERVAL argvals,
SCIP_INTERVAL varvals,
SCIP_Real param,
SCIP_INTERVAL val 
)

evaluates an expression w.r.t. given interval values for children expressions

Parameters
exprexpression
infinityvalue to use for infinity
argvalsinterval values for children, can be NULL if the expression has no children
varvalsinterval values for variables, can be NULL if the expression is constant
paramvalues for parameters, can be NULL if the expression is not parameterized
valbuffer to store value

Definition at line 7777 of file expr.c.

References SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_CALL, and SCIP_OKAY.

SCIP_RETCODE SCIPexprEvalInt ( SCIP_EXPR expr,
SCIP_Real  infinity,
SCIP_INTERVAL varvals,
SCIP_Real param,
SCIP_INTERVAL val 
)

evaluates an expression w.r.t. an interval

Parameters
exprexpression
infinityvalue to use for infinity
varvalsinterval values for variables, can be NULL if the expression is constant
paramvalues for parameters, can be NULL if the expression is not parameterized
valbuffer to store value

Definition at line 7797 of file expr.c.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_ALLOC, SCIP_CALL, SCIP_EXPRESSION_MAXCHILDEST, SCIP_OKAY, and SCIPexprEvalInt().

Referenced by addUserEstimator(), SCIPexprEvalInt(), and SCIPexprtreeEvalInt().

SCIP_RETCODE SCIPexprEvalUser ( SCIP_EXPR expr,
SCIP_Real argvals,
SCIP_Real val,
SCIP_Real gradient,
SCIP_Real hessian 
)

evaluates a user expression w.r.t. given values for children expressions

Parameters
exprexpression
argvalsvalues for children
valbuffer to store function value
gradientbuffer to store gradient values, or NULL if not requested
hessianbuffer to store values of full Hessian, or NULL if not requested

Definition at line 7839 of file expr.c.

References SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_CALL, SCIP_EXPR_USER, SCIP_OKAY, and SCIP_ExprData_User::userdata.

Referenced by exprEvalUser().

SCIP_RETCODE SCIPexprEvalIntUser ( SCIP_EXPR expr,
SCIP_Real  infinity,
SCIP_INTERVAL argvals,
SCIP_INTERVAL val,
SCIP_INTERVAL gradient,
SCIP_INTERVAL hessian 
)

evaluates a user expression w.r.t. an interval

Parameters
exprexpression
infinityvalue to use for infinity
argvalsvalues for children
valbuffer to store value
gradientbuffer to store gradient values, or NULL if not requested
hessianbuffer to store values of full Hessian, or NULL if not requested

Definition at line 7862 of file expr.c.

References SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_CALL, SCIP_EXPR_USER, SCIP_OKAY, SCIPintervalSetEntire(), and SCIP_ExprData_User::userdata.

Referenced by exprEvalUser().

SCIP_RETCODE SCIPexprCheckCurvature ( SCIP_EXPR expr,
SCIP_Real  infinity,
SCIP_INTERVAL varbounds,
SCIP_Real param,
SCIP_EXPRCURV curv,
SCIP_INTERVAL bounds 
)

tries to determine the curvature type of an expression w.r.t. given variable domains

Parameters
exprexpression to check
infinityvalue to use for infinity
varboundsdomains of variables
paramvalues for parameters, can be NULL if the expression is not parameterized
curvbuffer to store curvature of expression
boundsbuffer to store bounds on expression

Definition at line 7895 of file expr.c.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_ALLOC, SCIP_CALL, SCIP_EXPRCURV_LINEAR, SCIP_EXPRESSION_MAXCHILDEST, SCIP_OKAY, and SCIPexprCheckCurvature().

Referenced by SCIPexprCheckCurvature(), and SCIPexprtreeCheckCurvature().

SCIP_RETCODE SCIPexprEstimateUser ( SCIP_EXPR expr,
SCIP_Real  infinity,
SCIP_Real argvals,
SCIP_INTERVAL argbounds,
SCIP_Bool  overestimate,
SCIP_Real coeffs,
SCIP_Real constant,
SCIP_Bool success 
)

under-/overestimates a user expression w.r.t. to given values and bounds for children expressions

Parameters
exprexpression
infinityvalue to use for infinity
argvalsvalues for children
argboundsbounds for children
overestimatewhether to overestimate the expression
coeffsbuffer to store the linear coefficients for each child expression that gives a valid under-/overestimator
constantbuffer to store the constant value of the linear under-/overestimator
successbuffer to store whether an estimator was successfully computed

Definition at line 7953 of file expr.c.

References SCIP_Expr::data, FALSE, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_CALL, SCIP_EXPR_USER, SCIP_OKAY, and SCIP_ExprData_User::userdata.

Referenced by addUserEstimator().

SCIP_RETCODE SCIPexprSubstituteVars ( BMS_BLKMEM blkmem,
SCIP_EXPR expr,
SCIP_EXPR **  substexprs 
)

substitutes variables (SCIP_EXPR_VARIDX) by expressions Note that only the children of the given expr are checked! A variable with index i is replaced by a copy of substexprs[i], if that latter is not NULL if substexprs[i] == NULL, then the variable expression i is not touched

substitutes variables (SCIP_EXPR_VARIDX) by expressions

Note that only the children of the given expr are checked! A variable with index i is replaced by a copy of substexprs[i], if the latter is not NULL. If substexprs[i] == NULL, then the variable expression i is not touched.

Parameters
blkmemblock memory data structure
exprexpression, which of the children may be replaced
substexprsarray of substitute expressions; single entries can be NULL

Definition at line 7991 of file expr.c.

References SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_CALL, SCIP_EXPR_VARIDX, SCIP_OKAY, SCIPexprCopyDeep(), SCIPexprFreeDeep(), and SCIPexprSubstituteVars().

Referenced by generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), initSepaDataCreateVred(), SCIPexprSubstituteVars(), and SCIPexprtreeSubstituteVars().

void SCIPexprReindexVars ( SCIP_EXPR expr,
int *  newindices 
)

updates variable indices in expression tree

Parameters
exprexpression to update
newindicesnew indices of variables

Definition at line 8029 of file expr.c.

References SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_EXPR_VARIDX, and SCIPexprReindexVars().

Referenced by initSepaData(), removeFixedVariables(), SCIPexprReindexVars(), and SCIPexprtreeRemoveFixedVars().

void SCIPexprReindexParams ( SCIP_EXPR expr,
int *  newindices 
)

updates parameter indices in expression tree

Parameters
exprexpression to update
newindicesnew indices of variables

Definition at line 8050 of file expr.c.

References SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_EXPR_PARAM, and SCIPexprReindexParams().

Referenced by SCIPexprReindexParams().

void SCIPexprPrint ( SCIP_EXPR expr,
SCIP_MESSAGEHDLR messagehdlr,
FILE *  file,
const char **  varnames,
const char **  paramnames,
SCIP_Real paramvals 
)

prints an expression

Parameters
exprexpression
messagehdlrmessage handler
filefile for printing, or NULL for stdout
varnamesnames of variables, or NULL for default names
paramnamesnames of parameters, or NULL for default names
paramvalsvalues of parameters, or NULL for not printing

Definition at line 8071 of file expr.c.

References SCIP_ExprData_Monomial::childidxs, SCIP_Expr::children, SCIP_ExprData_Monomial::coef, SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, SCIP_Expr::data, SCIP_ExprData_Monomial::exponents, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Polynomial::monomials, SCIP_Expr::nchildren, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_Expr::op, SCIP_ExprData_Quadratic::quadelems, SCIP_EXPR_ABS, SCIP_EXPR_CONST, SCIP_EXPR_COS, SCIP_EXPR_DIV, SCIP_EXPR_EXP, SCIP_EXPR_INTPOWER, SCIP_EXPR_LAST, SCIP_EXPR_LINEAR, SCIP_EXPR_LOG, SCIP_EXPR_MAX, SCIP_EXPR_MIN, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PARAM, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SIGN, SCIP_EXPR_SIGNPOWER, SCIP_EXPR_SIN, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_EXPR_TAN, SCIP_EXPR_USER, SCIP_EXPR_VARIDX, SCIP_Real, SCIPABORT, SCIPerrorMessage, SCIPexprPrint(), and SCIPmessageFPrintInfo().

Referenced by exprParse(), exprsimplifyFlattenPolynomials(), SCIPexprPrint(), SCIPexprSimplify(), and SCIPexprtreePrint().

SCIP_RETCODE SCIPexprParse ( BMS_BLKMEM blkmem,
SCIP_MESSAGEHDLR messagehdlr,
SCIP_EXPR **  expr,
const char *  str,
const char *  lastchar,
int *  nvars,
int *  varnames 
)

parses an expression from a string

Parameters
blkmemblock memory data structure
messagehdlrmessage handler
exprbuffer to store pointer to created expression
strpointer to the string to be parsed
lastcharpointer to the last char of str that should be parsed
nvarsbuffer to store number of variables
varnamesbuffer to store variable names, prefixed by index (as int)

Definition at line 8381 of file expr.c.

References exprParse(), NULL, SCIP_CALL, SCIPhashtableCreate(), and SCIPhashtableFree().

Referenced by SCIP_DECL_CONSPARSE().

int SCIPexprtreeGetNVars ( SCIP_EXPRTREE tree)

returns number of variables in expression tree

Parameters
treeexpression tree

Definition at line 8452 of file expr.c.

References NULL, and SCIP_ExprTree::nvars.

Referenced by addConcaveEstimatorBivariate(), addConcaveEstimatorMultivariate(), addConcaveEstimatorUnivariate(), addIntervalGradientEstimator(), addLinearization(), addUserEstimator(), checkCurvature(), computeViolation(), consdataAddExprtrees(), createConstraint(), evalFunctionGradient(), evalFunctionValue(), freeConstraint(), generateCut(), getGradientMaxElement(), getLinearAndQuadraticCoefs(), hessLagAddExprtree(), hessLagSparsitySetNzFlagForExprtree(), nlpAddNlRows(), nlpSetupNlpiIndices(), nlrowCalcActivityBounds(), nlrowExprtreeChanged(), nlrowRemoveFixedExprtreeVars(), printFunction(), printRowNl(), processNlRow(), readObjective(), registerBranchingVariables(), registerLargeLPValueVariableForBranching(), removeFixedVariables(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSENFOPS(), SCIP_DECL_CONSEXITPRE(), SCIP_DECL_CONSGETNVARS(), SCIP_DECL_CONSGETVARS(), SCIP_DECL_CONSINITLP(), SCIPcreateConsBivariate(), SCIPevalExprtreeGlobalBounds(), SCIPevalExprtreeLocalBounds(), SCIPevalExprtreeSol(), SCIPexprintCompile(), SCIPexprintEval(), SCIPexprintEvalInt(), SCIPexprintGrad(), SCIPexprintGradInt(), SCIPexprintHessianDense(), SCIPexprintHessianSparsityDense(), SCIPexprtreeSimplify(), SCIPgetExprtreeTransformedVars(), SCIPnlpGetVarsNonlinearity(), SCIPnlpHasContinuousNonlinearity(), SCIPnlpiOracleChgExprtree(), SCIPnlpiOracleDelVarSet(), SCIPnlpiOracleEvalJacobian(), SCIPnlpiOracleGetJacobianSparsity(), SCIPnlrowGetSolActivity(), SCIPnlrowRecalcNLPActivity(), SCIPnlrowRecalcPseudoActivity(), SCIPwritePip(), solveDerivativeEquation(), and updateVariableDegreesCons().

int SCIPexprtreeGetNParams ( SCIP_EXPRTREE tree)

returns number of parameters in expression tree

Parameters
treeexpression tree

Definition at line 8462 of file expr.c.

References SCIP_ExprTree::nparams, and NULL.

Referenced by nlrowExprtreeParamChanged(), nlrowRemoveFixedExprtreeVars(), SCIPnlpiOracleChgExprParam(), and SCIPnlrowChgExprtreeParams().

SCIP_Real* SCIPexprtreeGetParamVals ( SCIP_EXPRTREE tree)

returns values of parameters or NULL if none

Parameters
treeexpression tree

Definition at line 8472 of file expr.c.

References NULL, and SCIP_ExprTree::params.

Referenced by addUserEstimator(), nlrowExprtreeParamChanged(), SCIPexprintEval(), and SCIPexprintEvalInt().

void SCIPexprtreeSetParamVal ( SCIP_EXPRTREE tree,
int  paramidx,
SCIP_Real  paramval 
)

sets value of a single parameter in expression tree

Parameters
treeexpression tree
paramidxindex of parameter
paramvalnew value of parameter

Definition at line 8482 of file expr.c.

References NULL, and SCIP_ExprTree::params.

Referenced by generateConvexConcaveUnderestimator(), SCIPnlpiOracleChgExprParam(), and SCIPnlrowChgExprtreeParam().

void SCIPexprtreeSetInterpreterData ( SCIP_EXPRTREE tree,
SCIP_EXPRINTDATA interpreterdata 
)

sets data of expression tree interpreter

Parameters
treeexpression tree
interpreterdataexpression interpreter data

Definition at line 8507 of file expr.c.

References SCIP_ExprTree::interpreterdata, and NULL.

Referenced by SCIPexprintCompile().

SCIP_RETCODE SCIPexprtreeFreeInterpreterData ( SCIP_EXPRTREE tree)

frees data of expression tree interpreter, if any

Parameters
treeexpression tree

Definition at line 8520 of file expr.c.

References SCIP_ExprTree::interpreterdata, NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprintFreeData().

Referenced by SCIPexprtreeAddExpr(), SCIPexprtreeFree(), SCIPexprtreeSimplify(), and SCIPexprtreeSubstituteVars().

SCIP_Bool SCIPexprtreeHasParam ( SCIP_EXPRTREE tree)

indicates whether there are parameterized constants (SCIP_EXPR_PARAM) in expression tree

Parameters
treeexpression tree

Definition at line 8534 of file expr.c.

References NULL, SCIP_ExprTree::root, and SCIPexprHasParam().

SCIP_RETCODE SCIPexprtreeGetMaxDegree ( SCIP_EXPRTREE tree,
int *  maxdegree 
)

Gives maximal degree of expression in expression tree. If constant expression, gives 0, if linear expression, gives 1, if polynomial expression, gives its maximal degree, otherwise (nonpolynomial nonconstant expressions) gives at least SCIP_EXPR_DEGREEINFINITY.

Parameters
treeexpression tree
maxdegreebuffer to store maximal degree

Definition at line 8550 of file expr.c.

References NULL, SCIP_ExprTree::root, SCIP_CALL, SCIP_OKAY, and SCIPexprGetMaxDegree().

Referenced by SCIPwriteGms().

SCIP_RETCODE SCIPexprtreeEvalInt ( SCIP_EXPRTREE tree,
SCIP_Real  infinity,
SCIP_INTERVAL varvals,
SCIP_INTERVAL val 
)

evaluates an expression tree w.r.t. an interval

Parameters
treeexpression tree
infinityvalue for infinity
varvalsintervals for variables
valbuffer to store expression tree value

Definition at line 8579 of file expr.c.

References NULL, SCIP_ExprTree::nvars, SCIP_ExprTree::params, SCIP_ExprTree::root, SCIP_CALL, SCIP_OKAY, and SCIPexprEvalInt().

Referenced by nlrowCalcActivityBounds(), SCIPevalExprtreeGlobalBounds(), SCIPevalExprtreeLocalBounds(), and SCIPexprintEvalInt().

void SCIPexprtreePrint ( SCIP_EXPRTREE tree,
SCIP_MESSAGEHDLR messagehdlr,
FILE *  file,
const char **  varnames,
const char **  paramnames 
)

prints an expression tree

Parameters
treeexpression tree
messagehdlrmessage handler
filefile for printing, or NULL for stdout
varnamesnames of variables, or NULL for default names
paramnamesnames of parameters, or NULL for default names

Definition at line 8596 of file expr.c.

References NULL, SCIP_ExprTree::params, SCIP_ExprTree::root, and SCIPexprPrint().

Referenced by generateConvexConcaveUnderestimator(), isConvexLocal(), printFunction(), and SCIPexprtreePrintWithNames().

SCIP_RETCODE SCIPexprtreeCreate ( BMS_BLKMEM blkmem,
SCIP_EXPRTREE **  tree,
SCIP_EXPR root,
int  nvars,
int  nparams,
SCIP_Real params 
)

creates an expression tree

Parameters
blkmemblock memory data structure
treebuffer to store address of created expression tree
rootpointer to root expression, not copied deep !, can be NULL
nvarsnumber of variables in variable mapping
nparamsnumber of parameters in expression
paramsvalues for parameters, or NULL (if NULL but nparams > 0, then params is initialized with zeros)

Definition at line 8611 of file expr.c.

References BMSallocBlockMemory, BMSallocBlockMemoryArray, BMSclearMemoryArray, BMSduplicateBlockMemoryArray, NULL, SCIP_ALLOC, and SCIP_OKAY.

Referenced by createConsFromQuadTerm(), createExprtreeFromMonomial(), createNlRow(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), initSepaData(), initSepaDataCreateVred(), readNonlinearExprs(), readPolynomial(), SCIP_DECL_CONSPARSE(), SCIPexprgraphGetSeparableTrees(), SCIPexprgraphGetSumTrees(), SCIPexprgraphGetTree(), and SCIPwritePip().

SCIP_RETCODE SCIPexprtreeSetParams ( SCIP_EXPRTREE tree,
int  nparams,
SCIP_Real paramvals 
)

sets number and values of all parameters in expression tree

Parameters
treeexpression tree
nparamsnumber of parameters
paramvalsvalues of parameters, can be NULL if nparams == 0

Definition at line 8716 of file expr.c.

References SCIP_ExprTree::blkmem, BMScopyMemoryArray, BMSduplicateBlockMemoryArray, BMSfreeBlockMemoryArrayNull, BMSreallocBlockMemoryArray, SCIP_ExprTree::nparams, NULL, SCIP_ExprTree::params, SCIP_ALLOC, and SCIP_OKAY.

Referenced by generateConvexConcaveUnderestimator(), initSepaData(), and SCIPnlrowChgExprtreeParams().

void SCIPexprtreeGetVarsUsage ( SCIP_EXPRTREE tree,
int *  varsusage 
)

gives the number of usages for each variable in the expression tree

Parameters
treeexpression tree
varsusagearray where to store for each variable how often it is used in the tree

Definition at line 8747 of file expr.c.

References BMSclearMemoryArray, NULL, SCIP_ExprTree::nvars, SCIP_ExprTree::root, and SCIPexprGetVarsUsage().

SCIP_RETCODE SCIPexprtreeSimplify ( SCIP_EXPRTREE tree,
SCIP_MESSAGEHDLR messagehdlr,
SCIP_Real  eps,
int  maxexpansionexponent,
int *  nlinvars,
int *  linidxs,
SCIP_Real lincoefs 
)

aims at simplifying an expression and splitting of a linear expression if linear variables are split off, expression interpreter data, if stored in the tree, is freed

aims at simplifying an expression and splitting of a linear expression

If linear variables are split off, expression interpreter data, if stored in the tree, is freed.

Parameters
treeexpression tree
messagehdlrmessage handler
epsthreshold, under which positive values are treat as 0
maxexpansionexponentmaximal exponent for which we still expand non-monomial polynomials
nlinvarsbuffer to store number of linear variables in linear part, or NULL if linear part should not be separated
linidxsarray to store indices of variables in expression tree which belong to linear part, or NULL
lincoefsarray to store coefficients of linear part, or NULL

Definition at line 8766 of file expr.c.

References SCIP_ExprTree::blkmem, BMSallocMemoryArray, BMSfreeMemoryArray, EPSZ, NULL, SCIP_ExprTree::nvars, SCIP_ExprTree::root, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPexprSimplify(), SCIPexprtreeEval(), SCIPexprtreeFreeInterpreterData(), SCIPexprtreeGetNVars(), SCIPgetRandomReal(), and SCIPrelDiff().

SCIP_RETCODE SCIPexprtreeAddExpr ( SCIP_EXPRTREE tree,
SCIP_EXPR expr,
SCIP_Bool  copyexpr 
)

adds an expression to the root expression of the tree the root is replaced with an SCIP_EXPR_PLUS expression which has the previous root and the given expression as children

adds an expression to the root expression of the tree

The root is replaced with an SCIP_EXPR_PLUS expression which has the previous root and the given expression (or a copy of it) as children.

Parameters
treeexpression tree
exprexpression to add to tree
copyexprwhether expression should be copied

Definition at line 8817 of file expr.c.

References SCIP_ExprTree::blkmem, NULL, SCIP_ExprTree::root, SCIP_CALL, SCIP_EXPR_PLUS, SCIP_OKAY, SCIPexprCopyDeep(), SCIPexprCreate(), and SCIPexprtreeFreeInterpreterData().

Referenced by SCIPexprgraphGetSumTrees().

SCIP_RETCODE SCIPexprtreeCheckCurvature ( SCIP_EXPRTREE tree,
SCIP_Real  infinity,
SCIP_INTERVAL varbounds,
SCIP_EXPRCURV curv,
SCIP_INTERVAL bounds 
)

tries to determine the curvature type of an expression tree w.r.t. given variable domains

Parameters
treeexpression tree
infinityvalue for infinity
varboundsdomains of variables
curvbuffer to store curvature of expression
boundsbuffer to store bounds on expression, or NULL if not needed

Definition at line 8840 of file expr.c.

References NULL, SCIP_ExprTree::params, SCIP_ExprTree::root, SCIP_CALL, SCIP_OKAY, and SCIPexprCheckCurvature().

Referenced by checkCurvature().

SCIP_RETCODE SCIPexprtreeSubstituteVars ( SCIP_EXPRTREE tree,
SCIP_EXPR **  substexprs 
)

substitutes variables (SCIP_EXPR_VARIDX) in an expression tree by expressions A variable with index i is replaced by a copy of substexprs[i], if that latter is not NULL if substexprs[i] == NULL, then the variable expression i is not touched

substitutes variables (SCIP_EXPR_VARIDX) in an expression tree by expressions

A variable with index i is replaced by a copy of substexprs[i], if that latter is not NULL. If substexprs[i] == NULL, then the variable expression i is not touched.

Parameters
treeexpression tree
substexprsarray of substitute expressions; single entries can be NULL

Definition at line 8866 of file expr.c.

References SCIP_ExprTree::blkmem, SCIP_Expr::data, NULL, SCIP_Expr::op, SCIP_ExprTree::root, SCIP_CALL, SCIP_EXPR_VARIDX, SCIP_OKAY, SCIPexprCopyDeep(), SCIPexprFreeDeep(), SCIPexprSubstituteVars(), and SCIPexprtreeFreeInterpreterData().

Referenced by generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), initSepaData(), removeFixedVariables(), and SCIPexprtreeRemoveFixedVars().

void SCIPquadelemSort ( SCIP_QUADELEM quadelems,
int  nquadelems 
)

sorts an array of quadratic elements The elements are sorted such that the first index is increasing and such that among elements with the same first index, the second index is increasing. For elements with same first and second index, the order is not defined.

Parameters
quadelemsarray of quadratic elements
nquadelemsnumber of quadratic elements

Definition at line 9030 of file expr.c.

References quadelemsQuickSort().

Referenced by createConstraint(), exprgraphFindParentByOperator(), nlrowSortQuadElem(), quadraticdataSort(), SCIPnlpiOracleChgQuadCoefs(), and SCIPnlpiOracleDelVarSet().

SCIP_Bool SCIPquadelemSortedFind ( SCIP_QUADELEM quadelems,
int  idx1,
int  idx2,
int  nquadelems,
int *  pos 
)

Finds an index pair in a sorted array of quadratic elements. If (idx1,idx2) is found in quadelems, then returns TRUE and stores position of quadratic element in *pos. If (idx1,idx2) is not found in quadelems, then returns FALSE and stores position where a quadratic element with these indices would be inserted in *pos. Assumes that idx1 <= idx2.

Parameters
quadelemsarray of quadratic elements
idx1index of first variable in element to search for
idx2index of second variable in element to search for
nquadelemsnumber of quadratic elements in array
posbuffer to store position of found quadratic element or position where it would be inserted, or NULL

Definition at line 9055 of file expr.c.

References FALSE, NULL, and TRUE.

Referenced by nlrowSearchQuadElem(), and SCIPnlpiOracleChgQuadCoefs().

void SCIPquadelemSqueeze ( SCIP_QUADELEM quadelems,
int  nquadelems,
int *  nquadelemsnew 
)

Adds quadratic elements with same index and removes elements with coefficient 0.0. Assumes that elements have been sorted before.

Parameters
quadelemsarray of quadratic elements
nquadelemsnumber of quadratic elements
nquadelemsnewpointer to store new (reduced) number of quadratic elements

Definition at line 9107 of file expr.c.

References SCIP_QuadElement::coef, NULL, and QUADELEMS_ISBETTER.

Referenced by createConstraint(), and SCIPnlpiOracleChgQuadCoefs().

void SCIPexprgraphCaptureNode ( SCIP_EXPRGRAPHNODE node)

captures node, i.e., increases number of uses

Parameters
nodeexpression graph node to capture

Definition at line 12711 of file expr.c.

References SCIP_ExprGraphNode::nuses, and SCIPdebugMessage.

Referenced by exprgraphNodeRemoveParent(), reformReplaceNode(), SCIPcreateConsNonlinear2(), SCIPexprgraphAddExprtreeSum(), and SCIPexprgraphNodeSplitOffLinear().

SCIP_Bool SCIPexprgraphIsNodeEnabled ( SCIP_EXPRGRAPHNODE node)

returns whether a node is currently enabled

Parameters
nodeexpression graph node to enable

Definition at line 12723 of file expr.c.

References SCIP_ExprGraphNode::enabled, and NULL.

Referenced by reformulate().

int SCIPexprgraphGetNodeNChildren ( SCIP_EXPRGRAPHNODE node)

gets number of children of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 12733 of file expr.c.

References SCIP_ExprGraphNode::nchildren, and NULL.

Referenced by reformEnsureChildrenMinCurvature(), reformMonomial(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_NONLINCONSUPGD(), and splitOffLinearPart().

SCIP_EXPRGRAPHNODE** SCIPexprgraphGetNodeChildren ( SCIP_EXPRGRAPHNODE node)

gets children of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 12743 of file expr.c.

References SCIP_ExprGraphNode::children, and NULL.

Referenced by reformEnsureChildrenMinCurvature(), reformMonomial(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

int SCIPexprgraphGetNodeNParents ( SCIP_EXPRGRAPHNODE node)

gets number of parents of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 12753 of file expr.c.

References SCIP_ExprGraphNode::nparents, and NULL.

Referenced by reformMonomial(), reformReplaceNode(), and reformulate().

SCIP_EXPRGRAPHNODE** SCIPexprgraphGetNodeParents ( SCIP_EXPRGRAPHNODE node)

gets parents of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 12763 of file expr.c.

References NULL, and SCIP_ExprGraphNode::parents.

Referenced by reformMonomial().

int SCIPexprgraphGetNodeDepth ( SCIP_EXPRGRAPHNODE node)

gets depth of node in expression graph

Parameters
nodeexpression graph node

Definition at line 12773 of file expr.c.

References SCIP_ExprGraphNode::depth, and NULL.

Referenced by reformEnsureChildrenMinCurvature(), reformNode2Var(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

int SCIPexprgraphGetNodePosition ( SCIP_EXPRGRAPHNODE node)

gets position of node in expression graph at its depth level

Parameters
nodeexpression graph node

Definition at line 12783 of file expr.c.

References NULL, and SCIP_ExprGraphNode::pos.

Referenced by reformEnsureChildrenMinCurvature(), reformNode2Var(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

SCIP_EXPROP SCIPexprgraphGetNodeOperator ( SCIP_EXPRGRAPHNODE node)

gets operator of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 12793 of file expr.c.

References NULL, and SCIP_ExprGraphNode::op.

Referenced by reformEnsureChildrenMinCurvature(), reformMonomial(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_NONLINCONSUPGD(), and SCIPexprgraphNodePolynomialAddMonomials().

int SCIPexprgraphGetNodeOperatorIndex ( SCIP_EXPRGRAPHNODE node)

gives index belonging to a SCIP_EXPR_VARIDX or SCIP_EXPR_PARAM operand

Parameters
nodeexpression graph node

Definition at line 12803 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, SCIP_EXPR_PARAM, and SCIP_EXPR_VARIDX.

SCIP_Real SCIPexprgraphGetNodeOperatorReal ( SCIP_EXPRGRAPHNODE node)

gives real belonging to a SCIP_EXPR_CONST operand

Parameters
nodeexpression graph node

Definition at line 12814 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_CONST.

void* SCIPexprgraphGetNodeVar ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node 
)

gives variable belonging to a SCIP_EXPR_VARIDX expression

Parameters
exprgraphexpression graph
nodeexpression graph node

Definition at line 12825 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::op, SCIP_EXPR_VARIDX, and SCIP_ExprGraph::vars.

Referenced by SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

SCIP_Real SCIPexprgraphGetNodeRealPowerExponent ( SCIP_EXPRGRAPHNODE node)

gives exponent belonging to a SCIP_EXPR_REALPOWER expression

Parameters
nodeexpression graph node

Definition at line 12840 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_REALPOWER.

Referenced by reformMonomial(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

int SCIPexprgraphGetNodeIntPowerExponent ( SCIP_EXPRGRAPHNODE node)

gives exponent belonging to a SCIP_EXPR_INTPOWER expression

Parameters
nodeexpression graph node

Definition at line 12851 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_INTPOWER.

Referenced by reformMonomial(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

SCIP_Real SCIPexprgraphGetNodeSignPowerExponent ( SCIP_EXPRGRAPHNODE node)

gives exponent belonging to a SCIP_EXPR_SIGNPOWER expression

Parameters
nodeexpression graph node

Definition at line 12862 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_SIGNPOWER.

Referenced by reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

SCIP_Real* SCIPexprgraphGetNodeLinearCoefs ( SCIP_EXPRGRAPHNODE node)

gives linear coefficients belonging to a SCIP_EXPR_LINEAR expression

Parameters
nodeexpression graph node

Definition at line 12873 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, SCIP_EXPR_LINEAR, and SCIP_Real.

Referenced by SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

SCIP_Real SCIPexprgraphGetNodeLinearConstant ( SCIP_EXPRGRAPHNODE node)

gives constant belonging to a SCIP_EXPR_LINEAR expression

Parameters
nodeexpression graph node

Definition at line 12884 of file expr.c.

References SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::nchildren, NULL, SCIP_ExprGraphNode::op, SCIP_EXPR_LINEAR, and SCIP_Real.

Referenced by SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

SCIP_Real SCIPexprgraphGetNodeQuadraticConstant ( SCIP_EXPRGRAPHNODE node)

gives constant belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
nodeexpression graph node

Definition at line 12896 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_QUADRATIC.

Referenced by SCIP_DECL_NONLINCONSUPGD().

SCIP_Real* SCIPexprgraphGetNodeQuadraticLinearCoefs ( SCIP_EXPRGRAPHNODE node)

gives linear coefficients belonging to a SCIP_EXPR_QUADRATIC expression, or NULL if all coefficients are 0.0

Parameters
nodeexpression graph node

Definition at line 12908 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_QUADRATIC.

Referenced by SCIP_DECL_NONLINCONSUPGD().

SCIP_QUADELEM* SCIPexprgraphGetNodeQuadraticQuadElements ( SCIP_EXPRGRAPHNODE node)

gives quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
nodeexpression graph node

Definition at line 12920 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_QUADRATIC.

Referenced by SCIP_DECL_NONLINCONSUPGD().

int SCIPexprgraphGetNodeQuadraticNQuadElements ( SCIP_EXPRGRAPHNODE node)

gives number of quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
nodeexpression graph node

Definition at line 12932 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_QUADRATIC.

Referenced by SCIP_DECL_NONLINCONSUPGD().

SCIP_EXPRDATA_MONOMIAL** SCIPexprgraphGetNodePolynomialMonomials ( SCIP_EXPRGRAPHNODE node)

gives the monomials belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
nodeexpression graph node

Definition at line 12944 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_POLYNOMIAL.

Referenced by reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

int SCIPexprgraphGetNodePolynomialNMonomials ( SCIP_EXPRGRAPHNODE node)

gives the number of monomials belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
nodeexpression graph node

Definition at line 12956 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_POLYNOMIAL.

Referenced by reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

SCIP_Real SCIPexprgraphGetNodePolynomialConstant ( SCIP_EXPRGRAPHNODE node)

gives the constant belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
nodeexpression graph node

Definition at line 12968 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_POLYNOMIAL.

Referenced by reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

SCIP_RETCODE SCIPexprgraphGetNodePolynomialMonomialCurvature ( SCIP_EXPRGRAPHNODE node,
int  monomialidx,
SCIP_Real  infinity,
SCIP_EXPRCURV curv 
)

gives the curvature of a single monomial belonging to a SCIP_EXPR_POLYNOMIAL expression

gives the curvature of a single monomial belonging to a SCIP_EXPR_POLYNOMIAL expression

Assumes that curvature of children and bounds of children and node itself are valid.

Parameters
nodeexpression graph node
monomialidxindex of monomial
infinityvalue for infinity in interval arithmetics
curvbuffer to store monomial curvature

Definition at line 12983 of file expr.c.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprData_Monomial::childidxs, SCIP_ExprGraphNode::children, SCIP_ExprData_Monomial::coef, SCIP_ExprGraphNode::curv, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Monomial::nfactors, NULL, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::pos, SCIP_ALLOC, SCIP_EXPR_POLYNOMIAL, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_EXPRCURV_LINEAR, SCIP_EXPRESSION_MAXCHILDEST, SCIP_OKAY, SCIPexprcurvMonomial(), SCIPexprcurvMultiply(), and SCIPintervalIsEmpty().

Referenced by reformulate().

SCIP_USEREXPRDATA* SCIPexprgraphGetNodeUserData ( SCIP_EXPRGRAPHNODE node)

gives the user data belonging to a SCIP_EXPR_USER expression

Definition at line 13061 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_USER.

SCIP_Bool SCIPexprgraphHasNodeUserEstimator ( SCIP_EXPRGRAPHNODE node)

indicates whether a user expression has the estimator callback defined

Definition at line 13073 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_USER.

SCIP_INTERVAL SCIPexprgraphGetNodeBounds ( SCIP_EXPRGRAPHNODE node)

gets bounds of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 13085 of file expr.c.

References SCIP_ExprGraphNode::bounds, and NULL.

Referenced by propagateBounds(), propagateBoundsCons(), propagateConstraintSides(), reformEnsureChildrenMinCurvature(), reformMonomial(), reformNode2Var(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

SCIP_Real SCIPexprgraphGetNodeVal ( SCIP_EXPRGRAPHNODE node)

gets value of expression associated to node from last evaluation call

Parameters
nodeexpression graph node

Definition at line 13095 of file expr.c.

References NULL, and SCIP_ExprGraphNode::value.

Referenced by computeViolation(), reformMonomial(), reformNode2Var(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_NONLINCONSUPGD(), and SCIPexprgraphSimplify().

SCIP_EXPRCURV SCIPexprgraphGetNodeCurvature ( SCIP_EXPRGRAPHNODE node)

gets curvature of expression associated to node from last curvature check call

Parameters
nodeexpression graph node

Definition at line 13105 of file expr.c.

References SCIP_ExprGraphNode::curv, and NULL.

Referenced by reformEnsureChildrenMinCurvature(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().

SCIP_RETCODE SCIPexprgraphCreateNodeLinear ( BMS_BLKMEM blkmem,
SCIP_EXPRGRAPHNODE **  node,
int  ncoefs,
SCIP_Real coefs,
SCIP_Real  constant 
)

creates an expression graph node for a linear expression

Parameters
blkmemblock memory
nodebuffer to store expression graph node
ncoefsnumber of coefficients
coefscoefficients of linear expression
constantconstant of linear expression

Definition at line 13198 of file expr.c.

References BMSallocBlockMemoryArray, BMScopyMemoryArray, exprgraphCreateNode(), NULL, SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_LINEAR, SCIP_OKAY, and SCIP_Real.

Referenced by reformulate(), and SCIP_DECL_EXPRGRAPHNODEREFORM().

SCIP_RETCODE SCIPexprgraphCreateNodeQuadratic ( BMS_BLKMEM blkmem,
SCIP_EXPRGRAPHNODE **  node,
int  nchildren,
SCIP_Real lincoefs,
int  nquadelems,
SCIP_QUADELEM quadelems,
SCIP_Real  constant 
)

creates an expression graph node for a quadratic expression

Parameters
blkmemblock memory
nodebuffer to store expression graph node
nchildrennumber of children
lincoefslinear coefficients for children, or NULL
nquadelemsnumber of quadratic elements
quadelemsquadratic elements, or NULL if nquadelems == 0
constantconstant

Definition at line 13224 of file expr.c.

References exprgraphCreateNode(), NULL, quadraticdataCreate(), SCIP_CALL, SCIP_EXPR_QUADRATIC, and SCIP_OKAY.

Referenced by reformulate().

SCIP_RETCODE SCIPexprgraphCreateNodePolynomial ( BMS_BLKMEM blkmem,
SCIP_EXPRGRAPHNODE **  node,
int  nmonomials,
SCIP_EXPRDATA_MONOMIAL **  monomials,
SCIP_Real  constant,
SCIP_Bool  copymonomials 
)

creates an expression graph node for a polynomial expression

Parameters
blkmemblock memory
nodebuffer to store expression graph node
nmonomialsnumber of monomials
monomialsmonomials
constantconstant of polynomial
copymonomialswhether to copy monomials or to assume ownership

Definition at line 13250 of file expr.c.

References exprgraphCreateNode(), NULL, polynomialdataCreate(), SCIP_CALL, SCIP_EXPR_POLYNOMIAL, and SCIP_OKAY.

Referenced by reformulate().

SCIP_RETCODE SCIPexprgraphNodePolynomialAddMonomials ( BMS_BLKMEM blkmem,
SCIP_EXPRGRAPHNODE node,
int  nmonomials,
SCIP_EXPRDATA_MONOMIAL **  monomials,
SCIP_Bool  copymonomials 
)

adds monomials to an expression graph node that is a polynomial expression

Parameters
blkmemblock memory
nodestore expression graph node with polynomial operator
nmonomialsnumber of monomials
monomialsmonomials
copymonomialswhether to copy monomials or to assume ownership

Definition at line 13275 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, polynomialdataAddMonomials(), SCIP_CALL, SCIP_EXPR_POLYNOMIAL, SCIP_OKAY, and SCIPexprgraphGetNodeOperator().

SCIP_RETCODE SCIPexprgraphCreateNodeUser ( BMS_BLKMEM blkmem,
SCIP_EXPRGRAPHNODE **  node,
SCIP_USEREXPRDATA data,
SCIP_EXPRINTCAPABILITY  evalcapability,
SCIP_DECL_USEREXPREVAL((*eval))  ,
SCIP_DECL_USEREXPRINTEVAL((*inteval))  ,
SCIP_DECL_USEREXPRCURV((*curv))  ,
SCIP_DECL_USEREXPRPROP((*prop))  ,
SCIP_DECL_USEREXPRESTIMATE((*estimate))  ,
SCIP_DECL_USEREXPRCOPYDATA((*copydata))  ,
SCIP_DECL_USEREXPRFREEDATA((*freedata))   
)

creates an expression graph node for a user expression

Parameters
blkmemblock memory
nodebuffer to store expression graph node
datauser data for expression, node assumes ownership
evalcapabilityevaluation capability

Definition at line 13294 of file expr.c.

References BMSallocBlockMemory, eval(), SCIP_ExprData_User::evalcapability, exprgraphCreateNode(), NULL, SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_USER, SCIP_EXPRINTCAPABILITY_FUNCVALUE, SCIP_EXPRINTCAPABILITY_INTFUNCVALUE, SCIP_OKAY, and SCIP_ExprData_User::userdata.

SCIP_RETCODE SCIPexprgraphNodeSplitOffLinear ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE **  node,
int  linvarssize,
int *  nlinvars,
void **  linvars,
SCIP_Real lincoefs,
SCIP_Real constant 
)

given a node of an expression graph, splitup a linear part which variables are not used somewhere else in the same expression E.g., if the expression is 1 + x + y + y^2, one gets 1 + x and the node remains at y + y^2. If the node is a linear expression, it may be freed. If it is not linear, the node may change, i.e., the remaining nonlinear part may be stored in a new node. It is assumed that the user had captured the node. It is assumed that the expression graph has been simplified before.

Parameters
exprgraphexpression graph
nodeexpression graph node where to splitup linear part
linvarssizelength of linvars and lincoefs arrays
nlinvarsbuffer to store length of linear term that have been splitup
linvarsbuffer to store variables of linear part
lincoefsbuffer to store coefficients of linear part
constantbuffer to store constant part

Definition at line 13346 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSclearMemoryArray, BMSfreeBlockMemoryArray, BMSreallocBlockMemoryArray, SCIP_ExprData_Monomial::childidxs, SCIP_ExprGraphNode::children, SCIP_ExprData_Monomial::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprData_Monomial::exponents, exprgraphCreateNode(), exprgraphNodeGetVarsUsage(), exprgraphNodeRemoveParent(), exprgraphNodeRemovePolynomialNullChildren(), FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Polynomial::monomials, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraph::needvarboundprop, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::op, polynomialdataMergeMonomials(), SCIP_ExprData_Quadratic::quadelems, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_ABS, SCIP_EXPR_CONST, SCIP_EXPR_COS, SCIP_EXPR_DIV, SCIP_EXPR_EXP, SCIP_EXPR_INTPOWER, SCIP_EXPR_LINEAR, SCIP_EXPR_LOG, SCIP_EXPR_MAX, SCIP_EXPR_MIN, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SIGN, SCIP_EXPR_SIGNPOWER, SCIP_EXPR_SIN, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_EXPR_TAN, SCIP_EXPR_USER, SCIP_EXPR_VARIDX, SCIP_EXPRBOUNDSTATUS_CHILDTIGHTENED, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIP_REAL_MAX, SCIPdebugMessage, SCIPexprgraphAddNode(), SCIPexprgraphCaptureNode(), SCIPexprgraphReleaseNode(), SCIPexpropGetName(), SCIPintervalSetEntire(), SCIP_ExprData_Quadratic::sorted, SCIP_ExprData_Polynomial::sorted, TRUE, and SCIP_ExprGraph::vars.

Referenced by splitOffLinearPart().

SCIP_RETCODE SCIPexprgraphMoveNodeParents ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE **  srcnode,
SCIP_EXPRGRAPHNODE targetnode 
)

moves parents from a one node to another node in other words, replaces the child srcnode by targetnode in all parents of srcnode srcnode may be freed, if not captured it is assumes that targetnode represents the same expression as srcnode

moves parents from a one node to another node

In other words, replaces the child srcnode by targetnode in all parents of srcnode. srcnode may be freed, if not captured. It is assumed that targetnode represents the same expression as srcnode.

Parameters
exprgraphexpression graph
srcnodenode which parents to move
targetnodenode where to move parents to

Definition at line 14158 of file expr.c.

References SCIP_ExprGraphNode::depth, exprgraphMoveNode(), exprgraphNodeReplaceChild(), NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by reformReplaceNode(), SCIPexprgraphReplaceVarByLinearSum(), and SCIPexprgraphSimplify().

SCIP_RETCODE SCIPexprgraphReleaseNode ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE **  node 
)

releases node, i.e., decreases number of uses node is freed if no parents and no other uses children are recursively released if they have no other parents nodes that are removed are also freed if node correspond to a variable, then the variable is removed from the expression graph similar for constants

releases node, i.e., decreases number of uses

node is freed if no parents and no other uses. Children are recursively released if they have no other parents. Nodes that are removed are also freed. If node correspond to a variable, then the variable is removed from the expression graph; similarly for constants.

Parameters
exprgraphexpression graph
nodeexpression graph node to release

Definition at line 14190 of file expr.c.

References SCIP_ExprGraph::blkmem, SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssorted, SCIP_ExprGraphNode::depth, SCIP_ExprGraph::depth, exprgraphFindConstNodePos(), exprgraphNodeRemoveParent(), exprgraphRemoveVar(), SCIP_ExprGraph::nconsts, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, NULL, SCIP_ExprGraphNode::pos, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_VARIDX, SCIP_OKAY, SCIPdebugMessage, SCIPexprgraphFreeNode(), and SCIPexpropGetName().

Referenced by exprgraphNodeRemoveParent(), reformReplaceNode(), SCIP_DECL_CONSDEACTIVE(), and SCIPexprgraphNodeSplitOffLinear().

void SCIPexprgraphFreeNode ( BMS_BLKMEM blkmem,
SCIP_EXPRGRAPHNODE **  node 
)

frees a node of an expression graph

Parameters
blkmemblock memory
nodepointer to expression graph node that should be freed

Definition at line 14280 of file expr.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, and NULL.

Referenced by SCIPexprgraphReleaseNode().

void SCIPexprgraphEnableNode ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node 
)

enables a node and recursively all its children in an expression graph

Parameters
exprgraphexpression graph
nodeexpression graph node to enable

Definition at line 14305 of file expr.c.

References SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraph::needvarboundprop, NULL, SCIP_ExprGraphNode::pos, SCIP_REAL_MAX, SCIPdebugMessage, SCIPexprgraphEnableNode(), SCIPintervalSetEntire(), and TRUE.

Referenced by SCIP_DECL_CONSENABLE(), and SCIPexprgraphEnableNode().

void SCIPexprgraphDisableNode ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node 
)

disables a node and recursively all children which have no enabled parents in an expression graph

Parameters
exprgraphexpression graph
nodeexpression graph node to enable

Definition at line 14332 of file expr.c.

References SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, FALSE, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::nuses, SCIP_ExprGraphNode::parents, SCIP_ExprGraphNode::pos, SCIPdebugMessage, SCIPexprgraphDisableNode(), and TRUE.

Referenced by SCIP_DECL_CONSDISABLE(), and SCIPexprgraphDisableNode().

SCIP_Bool SCIPexprgraphHasNodeSibling ( SCIP_EXPRGRAPHNODE node)

returns whether the node has siblings in the expression graph

Parameters
nodeexpression graph node

Definition at line 14363 of file expr.c.

References FALSE, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::parents, and TRUE.

Referenced by reformulate(), and SCIP_DECL_EXPRGRAPHNODEREFORM().

SCIP_Bool SCIPexprgraphAreAllNodeChildrenVars ( SCIP_EXPRGRAPHNODE node)

returns whether all children of an expression graph node are variable nodes gives TRUE for nodes without children

returns whether all children of an expression graph node are variable nodes

Returns TRUE for nodes without children.

Parameters
nodeexpression graph node

Definition at line 14382 of file expr.c.

References SCIP_ExprGraphNode::children, FALSE, SCIP_ExprGraphNode::nchildren, NULL, SCIP_ExprGraphNode::op, SCIP_EXPR_VARIDX, and TRUE.

Referenced by SCIP_DECL_NONLINCONSUPGD().

SCIP_Bool SCIPexprgraphHasNodeNonlinearAncestor ( SCIP_EXPRGRAPHNODE node)
void SCIPexprgraphPrintNode ( SCIP_EXPRGRAPHNODE node,
SCIP_MESSAGEHDLR messagehdlr,
FILE *  file 
)

prints an expression graph node

Parameters
nodeexpression graph node
messagehdlrmessage handler
filefile to print to, or NULL for stdout

Definition at line 14435 of file expr.c.

References exprgraphPrintNodeExpression(), FALSE, and NULL.

Referenced by reformulate().

void SCIPexprgraphTightenNodeBounds ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
SCIP_INTERVAL  nodebounds,
SCIP_Real  minstrength,
SCIP_Real  infinity,
SCIP_Bool cutoff 
)

tightens the bounds in a node of the graph preparation for reverse propagation sets bound status to SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENTRECENT if tightening is strong enough and not cutoff

tightens the bounds in a node of the graph

Preparation for reverse propagation. Sets bound status to SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENTRECENT if tightening is strong enough and not cutoff.

Parameters
exprgraphexpression graph
nodenode in expression graph with no parents
nodeboundsnew bounds for node
minstrengthminimal required relative bound strengthening in a node to trigger a propagation into children nodes (set to negative value if propagation should always be triggered)
infinityvalue for infinity in interval arithmetics
cutoffbuffer to store whether a node's bounds were propagated to an empty interval

Definition at line 14451 of file expr.c.

References SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, FALSE, SCIP_Interval::inf, isLbBetter(), isUbBetter(), NULL, SCIP_ExprGraphNode::pos, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENT, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENTFORCE, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENTRECENT, SCIPdebugMessage, SCIPdebugPrintf, SCIPintervalIntersect(), SCIPintervalIsEmpty(), SCIP_Interval::sup, and TRUE.

Referenced by exprgraphNodePropagateBounds(), propagateBoundsCons(), propagateConstraintSides(), and reformNode2Var().

SCIP_RETCODE SCIPexprgraphUpdateNodeBoundsCurvature ( SCIP_EXPRGRAPHNODE node,
SCIP_Real  infinity,
SCIP_Real  minstrength,
SCIP_Bool  clearreverseprop 
)

ensures that bounds and curvature information in a node is uptodate assumes that bounds and curvature in children are uptodate

ensures that bounds and curvature information in a node is uptodate

Assumes that bounds and curvature in children are uptodate.

Parameters
nodeexpression graph node
infinityvalue for infinity in interval arithmetics
minstrengthminimal required relative bound strengthening to trigger a bound recalculation in parent nodes
clearreversepropwhether to reset bound tightenings from reverse propagation

Definition at line 14513 of file expr.c.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::curv, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, SCIP_Interval::inf, isLbBetter(), isUbBetter(), SCIP_ExprGraphNode::nchildren, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::parents, SCIP_ExprGraphNode::pos, SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_PARAM, SCIP_EXPR_VARIDX, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_CHILDTIGHTENED, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENT, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_EXPRCURV_LINEAR, SCIP_EXPRESSION_MAXCHILDEST, SCIP_OKAY, SCIPdebugMessage, SCIPexpropGetName(), SCIPintervalIntersect(), SCIPintervalIsEmpty(), and SCIP_Interval::sup.

Referenced by reformEnsureChildrenMinCurvature(), reformMonomial(), reformulate(), and SCIPexprgraphCheckCurvature().

int SCIPexprgraphGetDepth ( SCIP_EXPRGRAPH exprgraph)

get current maximal depth of expression graph

Parameters
exprgraphexpression graph

Definition at line 14663 of file expr.c.

References SCIP_ExprGraph::depth, and NULL.

Referenced by reformulate().

int* SCIPexprgraphGetNNodes ( SCIP_EXPRGRAPH exprgraph)

gets array with number of nodes at each depth of expression graph

Parameters
exprgraphexpression graph

Definition at line 14673 of file expr.c.

References SCIP_ExprGraph::nnodes, and NULL.

Referenced by reformulate().

SCIP_EXPRGRAPHNODE*** SCIPexprgraphGetNodes ( SCIP_EXPRGRAPH exprgraph)

gets nodes of expression graph, one array per depth

Parameters
exprgraphexpression graph

Definition at line 14683 of file expr.c.

References SCIP_ExprGraph::nodes, and NULL.

Referenced by reformulate().

int SCIPexprgraphGetNVars ( SCIP_EXPRGRAPH exprgraph)

gets number of variables in expression graph

Parameters
exprgraphpointer to expression graph that should be freed

Definition at line 14693 of file expr.c.

References NULL, and SCIP_ExprGraph::nvars.

Referenced by computeViolations(), presolveUpgrade(), propagateBounds(), propagateConstraintSides(), reformulate(), removeFixedNonlinearVariables(), SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSFREE(), SCIP_DECL_CONSGETNVARS(), and SCIP_DECL_CONSGETVARS().

void** SCIPexprgraphGetVars ( SCIP_EXPRGRAPH exprgraph)

gets array of variables in expression graph

Parameters
exprgraphpointer to expression graph that should be freed

Definition at line 14703 of file expr.c.

References NULL, and SCIP_ExprGraph::vars.

Referenced by computeViolations(), presolveUpgrade(), propagateBounds(), propagateConstraintSides(), reformulate(), removeFixedNonlinearVariables(), SCIP_DECL_CONSCHECK(), and SCIP_DECL_CONSGETVARS().

SCIP_EXPRGRAPHNODE** SCIPexprgraphGetVarNodes ( SCIP_EXPRGRAPH exprgraph)

gets array of expression graph nodes corresponding to variables

Parameters
exprgraphpointer to expression graph that should be freed

Definition at line 14713 of file expr.c.

References NULL, and SCIP_ExprGraph::varnodes.

Referenced by propagateBounds(), and propagateConstraintSides().

void SCIPexprgraphSetVarNodeValue ( SCIP_EXPRGRAPHNODE varnode,
SCIP_Real  value 
)

sets value for a single variable given as expression graph node

Parameters
varnodeexpression graph node corresponding to variable
valuenew value for variable

Definition at line 14723 of file expr.c.

References NULL, SCIP_ExprGraphNode::op, SCIP_EXPR_VARIDX, and SCIP_ExprGraphNode::value.

Referenced by reformMonomial(), reformNode2Var(), reformulate(), and SCIP_DECL_EXPRGRAPHNODEREFORM().

void SCIPexprgraphSetVarsBounds ( SCIP_EXPRGRAPH exprgraph,
SCIP_INTERVAL varbounds 
)

sets bounds for variables

Parameters
exprgraphexpression graph
varboundsnew bounds for variables

Definition at line 14735 of file expr.c.

References BMScopyMemoryArray, NULL, SCIP_ExprGraph::nvars, and SCIP_ExprGraph::varbounds.

void SCIPexprgraphSetVarBounds ( SCIP_EXPRGRAPH exprgraph,
void *  var,
SCIP_INTERVAL  varbounds 
)

sets bounds for a single variable

Parameters
exprgraphexpression graph
varvariable
varboundsnew bounds of variable

Definition at line 14747 of file expr.c.

References NULL, SCIPhashmapExists(), SCIPhashmapGetImage(), SCIP_ExprGraph::varbounds, SCIP_ExprGraph::varidxs, and SCIP_ExprGraph::vars.

void SCIPexprgraphSetVarNodeBounds ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE varnode,
SCIP_INTERVAL  varbounds 
)

sets bounds for a single variable given as expression graph node

Parameters
exprgraphexpression graph
varnodeexpression graph node corresponding to variable
varboundsnew bounds of variable

Definition at line 14767 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraph::varbounds, and SCIP_ExprGraph::varnodes.

Referenced by SCIP_DECL_EXPRGRAPHVARADDED().

void SCIPexprgraphSetVarNodeLb ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE varnode,
SCIP_Real  lb 
)

sets lower bound for a single variable given as expression graph node

Parameters
exprgraphexpression graph
varnodeexpression graph node corresponding to variable
lbnew lower bound for variable

Definition at line 14787 of file expr.c.

References SCIP_ExprGraphNode::data, SCIP_Interval::inf, NULL, SCIP_ExprGraph::varbounds, and SCIP_ExprGraph::varnodes.

Referenced by SCIP_DECL_EVENTEXEC().

void SCIPexprgraphSetVarNodeUb ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE varnode,
SCIP_Real  ub 
)

sets upper bound for a single variable given as expression graph node

Parameters
exprgraphexpression graph
varnodeexpression graph node corresponding to variable
ubnew upper bound for variable

Definition at line 14807 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_Interval::sup, SCIP_ExprGraph::varbounds, and SCIP_ExprGraph::varnodes.

Referenced by SCIP_DECL_EVENTEXEC().

SCIP_INTERVAL* SCIPexprgraphGetVarsBounds ( SCIP_EXPRGRAPH exprgraph)

gets bounds that are stored for all variables

Parameters
exprgraphexpression graph

Definition at line 14827 of file expr.c.

References SCIP_ExprGraph::varbounds.

SCIP_RETCODE SCIPexprgraphCreate ( BMS_BLKMEM blkmem,
SCIP_EXPRGRAPH **  exprgraph,
int  varssizeinit,
int  depthinit,
SCIP_DECL_EXPRGRAPHVARADDED((*exprgraphvaradded))  ,
SCIP_DECL_EXPRGRAPHVARREMOVE((*exprgraphvarremove))  ,
SCIP_DECL_EXPRGRAPHVARCHGIDX((*exprgraphvarchgidx))  ,
void *  userdata 
)

creates an empty expression graph

Parameters
blkmemblock memory
exprgraphbuffer to store pointer to expression graph
varssizeinitminimal initial size for variables array, or -1 to choose automatically
depthinitminimal initial depth of expression graph, or -1 to choose automatically
userdatauser data to pass to callback functions

Definition at line 14835 of file expr.c.

References BMSallocBlockMemory, BMSclearMemory, ensureBlockMemoryArraySize3, exprgraphEnsureDepth(), MAX, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPcalcHashtableSize(), SCIPhashmapCreate(), and TRUE.

Referenced by SCIPincludeConshdlrBivariate(), and SCIPincludeConshdlrNonlinear().

SCIP_RETCODE SCIPexprgraphFree ( SCIP_EXPRGRAPH **  exprgraph)

frees an expression graph

Parameters
exprgraphpointer to expression graph that should be freed

Definition at line 14874 of file expr.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, NULL, SCIP_OKAY, and SCIPhashmapFree().

Referenced by SCIP_DECL_CONSFREE().

SCIP_RETCODE SCIPexprgraphAddNode ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
int  mindepth,
int  nchildren,
SCIP_EXPRGRAPHNODE **  children 
)

adds an expression graph node to an expression graph expression graph assumes ownership of node children are notified about new parent depth will be chosen to be the maximum of mindepth and the depth of all children plus one

adds an expression graph node to an expression graph

Expression graph assumes ownership of node. Children are notified about new parent. Depth will be chosen to be the maximum of mindepth and the depth of all children plus one.

Parameters
exprgraphexpression graph
nodeexpression graph node to add
mindepthminimal depth in expression graph where to add node, e.g., 0 or smaller to choose automatically
nchildrennumber of children
childrenchildren nodes, or NULL if no children

Definition at line 14923 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSduplicateBlockMemoryArray, SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprGraph::depth, ensureBlockMemoryArraySize, exprgraphEnsureDepth(), exprgraphNodeAddParent(), exprgraphNodeEval(), MAX, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraph::needvarboundprop, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, SCIP_ExprGraph::nodessize, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::pos, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_VARIDX, SCIP_EXPRBOUNDSTATUS_CHILDTIGHTENED, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_INVALID, SCIP_OKAY, SCIP_REAL_MAX, SCIPintervalSet(), SCIPintervalSetEntire(), TRUE, and SCIP_ExprGraphNode::value.

Referenced by exprgraphAddExpr(), reformMonomial(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIPexprgraphAddConst(), SCIPexprgraphAddExprtreeSum(), SCIPexprgraphAddVars(), and SCIPexprgraphNodeSplitOffLinear().

SCIP_RETCODE SCIPexprgraphAddVars ( SCIP_EXPRGRAPH exprgraph,
int  nvars,
void **  vars,
SCIP_EXPRGRAPHNODE **  varnodes 
)

adds variables to an expression graph, if not existing yet also already existing nodes are enabled

adds variables to an expression graph, if not existing yet

Also already existing nodes are enabled.

Parameters
exprgraphexpression graph
nvarsnumber of variables to add
varsvariables to add
varnodesarray to store nodes corresponding to variables, or NULL if not of interest

Definition at line 15007 of file expr.c.

References SCIP_ExprGraph::blkmem, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprGraph::depth, SCIP_ExprGraphNode::enabled, ensureBlockMemoryArraySize, ensureBlockMemoryArraySize3, exprgraphCreateNode(), SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, SCIP_ExprGraph::nodessize, NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::pos, SCIP_CALL, SCIP_EXPR_VARIDX, SCIP_OKAY, SCIP_REAL_MAX, SCIPdebugMessage, SCIPexprgraphAddNode(), SCIPexprgraphFindVarNode(), SCIPhashmapExists(), SCIPhashmapInsert(), SCIPintervalSetEntire(), TRUE, SCIP_ExprGraph::userdata, SCIP_ExprGraph::varbounds, SCIP_ExprGraph::varidxs, SCIP_ExprGraph::varnodes, SCIP_ExprGraph::vars, and SCIP_ExprGraph::varssize.

Referenced by exprgraphAddExpr(), reformMonomial(), reformNode2Var(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIPexprgraphReplaceVarByLinearSum().

SCIP_RETCODE SCIPexprgraphAddConst ( SCIP_EXPRGRAPH exprgraph,
SCIP_Real  constant,
SCIP_EXPRGRAPHNODE **  constnode 
)

adds a constant to an expression graph, if not existing yet also already existing nodes are enabled

adds a constant to an expression graph, if not existing yet

Also already existing nodes are enabled.

Parameters
exprgraphexpression graph
constantconstant to add
constnodebuffer to store pointer to expression graph node corresponding to constant

Definition at line 15080 of file expr.c.

References SCIP_ExprGraph::blkmem, SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssize, SCIP_ExprGraph::constssorted, SCIP_ExprGraphNode::depth, ensureBlockMemoryArraySize, exprgraphCreateNode(), SCIP_ExprGraph::nconsts, SCIP_ExprGraph::nnodes, NULL, SCIP_CALL, SCIP_EXPR_CONST, SCIP_OKAY, SCIPdebugMessage, SCIPexprgraphAddNode(), SCIPexprgraphFindConstNode(), and TRUE.

Referenced by exprgraphAddExpr().

SCIP_RETCODE SCIPexprgraphAddExprtreeSum ( SCIP_EXPRGRAPH exprgraph,
int  nexprtrees,
SCIP_EXPRTREE **  exprtrees,
SCIP_Real coefs,
SCIP_EXPRGRAPHNODE **  rootnode,
SCIP_Bool rootnodeisnew 
)

adds sum of expression trees into expression graph node will also be captured

adds sum of expression trees into expression graph

node will also be captured.

Note
Parameters will be converted into constants
Parameters
exprgraphexpression graph
nexprtreesnumber of expression trees to add
exprtreesexpression trees that should be added
coefscoefficients of expression trees, or NULL if all 1.0
rootnodebuffer to store expression graph node corresponding to root of expression tree
rootnodeisnewbuffer to indicate whether the node in *rootnode has been newly created for this expression tree (otherwise, expression tree was already in graph)

Definition at line 15127 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArray, SCIP_ExprGraphNode::depth, exprgraphAddExpr(), exprgraphCreateNode(), exprgraphFindParentByOperator(), FALSE, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_PLUS, SCIP_EXPR_SUM, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPexprgraphAddNode(), SCIPexprgraphCaptureNode(), and TRUE.

Referenced by SCIP_DECL_CONSACTIVE().

SCIP_RETCODE SCIPexprgraphReplaceVarByLinearSum ( SCIP_EXPRGRAPH exprgraph,
void *  var,
int  ncoefs,
SCIP_Real coefs,
void **  vars,
SCIP_Real  constant 
)

replaces variable in expression graph by a linear sum of variables variables will be added if not in the graph yet

replaces variable in expression graph by a linear sum of variables

Variables will be added if not in the graph yet.

Parameters
exprgraphexpression graph
varvariable to replace
ncoefsnumber of coefficients in linear term
coefscoefficients in linear term, or NULL if ncoefs == 0
varsvariables in linear term
constantconstant offset

Definition at line 15267 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprGraphNode::children, SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssize, SCIP_ExprGraph::constssorted, SCIP_ExprGraphNode::data, ensureBlockMemoryArraySize, ensureBlockMemoryArraySize3, exprgraphMoveNode(), exprgraphNodeAddParent(), exprgraphRemoveVar(), FALSE, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraph::nconsts, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::nuses, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::parents, SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_LINEAR, SCIP_EXPR_SUM, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIP_REAL_MAX, SCIPdebugMessage, SCIPexprgraphAddVars(), SCIPexprgraphFindConstNode(), SCIPexprgraphFindVarNode(), SCIPexprgraphMoveNodeParents(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashmapInsert(), SCIPintervalSet(), SCIPintervalSetEntire(), SCIP_ExprGraphNode::simplified, SCIP_ExprGraph::userdata, SCIP_ExprGraphNode::value, SCIP_ExprGraph::varbounds, SCIP_ExprGraph::varidxs, SCIP_ExprGraph::varnodes, SCIP_ExprGraph::vars, and SCIP_ExprGraph::varssize.

Referenced by removeFixedNonlinearVariables().

SCIP_Bool SCIPexprgraphFindVarNode ( SCIP_EXPRGRAPH exprgraph,
void *  var,
SCIP_EXPRGRAPHNODE **  varnode 
)

finds expression graph node corresponding to a variable

Parameters
exprgraphexpression graph
varvariable to search for
varnodebuffer to store node corresponding to variable, if found, or NULL if not found

Definition at line 15439 of file expr.c.

References FALSE, NULL, SCIP_EXPR_VARIDX, SCIPhashmapExists(), SCIPhashmapGetImage(), TRUE, SCIP_ExprGraph::varidxs, and SCIP_ExprGraph::varnodes.

Referenced by SCIPexprgraphAddVars(), and SCIPexprgraphReplaceVarByLinearSum().

SCIP_Bool SCIPexprgraphFindConstNode ( SCIP_EXPRGRAPH exprgraph,
SCIP_Real  constant,
SCIP_EXPRGRAPHNODE **  constnode 
)

finds expression graph node corresponding to a constant

Parameters
exprgraphexpression graph
constantconstant to search for
constnodebuffer to store node corresponding to constant, if found, or NULL if not found

Definition at line 15468 of file expr.c.

References SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssorted, SCIP_ExprGraphNode::data, exprgraphSortConstNodes(), FALSE, SCIP_ExprGraph::nconsts, NULL, SCIP_EXPR_CONST, and TRUE.

Referenced by SCIPexprgraphAddConst(), SCIPexprgraphReplaceVarByLinearSum(), and SCIPexprgraphSimplify().

SCIP_RETCODE SCIPexprgraphPrintDot ( SCIP_EXPRGRAPH exprgraph,
SCIP_MESSAGEHDLR messagehdlr,
FILE *  file,
const char **  varnames 
)

prints an expression graph in dot format

Parameters
exprgraphexpression graph
messagehdlrmessage handler
filefile to print to, or NULL for stdout
varnamesvariable names, or NULL for generic names

Definition at line 15516 of file expr.c.

References SCIP_ExprGraph::depth, exprgraphPrintNodeDot(), SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, SCIP_ExprGraphNode::nparents, NULL, SCIP_OKAY, and SCIPmessageFPrintInfo().

Referenced by propagateBounds(), propagateConstraintSides(), SCIP_DECL_CONSINIT(), and SCIPexprgraphSimplify().

SCIP_RETCODE SCIPexprgraphEval ( SCIP_EXPRGRAPH exprgraph,
SCIP_Real varvals 
)

evaluates nodes of expression graph for given values of variables

Parameters
exprgraphexpression graph
varvalsvalues for variables

Definition at line 15565 of file expr.c.

References SCIP_ExprGraph::depth, exprgraphNodeEval(), SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, NULL, SCIP_ExprGraph::nvars, SCIP_CALL, and SCIP_OKAY.

Referenced by computeViolations(), presolveUpgrade(), reformulate(), SCIP_DECL_CONSCHECK(), and SCIPexprgraphSimplify().

SCIP_RETCODE SCIPexprgraphPropagateVarBounds ( SCIP_EXPRGRAPH exprgraph,
SCIP_Real  infinity,
SCIP_Bool  clearreverseprop,
SCIP_Bool domainerror 
)

propagates bound changes in variables forward through the expression graph

Parameters
exprgraphexpression graph
infinityvalue for infinity in interval arithmetics
clearreversepropwhether to reset bound tightenings from reverse propagation
domainerrorbuffer to store whether a node with empty bounds has been found, propagation is interrupted in this case

Definition at line 15586 of file expr.c.

References SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::depth, SCIP_ExprGraph::depth, exprgraphNodeUpdateBounds(), exprgraphUpdateVarNodeBounds(), FALSE, SCIP_ExprGraph::needvarboundprop, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, NULL, SCIP_ExprGraphNode::pos, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPintervalIsEmpty(), and TRUE.

Referenced by propagateBounds(), reformulate(), and SCIP_DECL_CONSPRESOL().

void SCIPexprgraphPropagateNodeBounds ( SCIP_EXPRGRAPH exprgraph,
SCIP_Real  infinity,
SCIP_Real  minstrength,
SCIP_Bool cutoff 
)

propagates bound changes in nodes backward through the graph new bounds are not stored in varbounds, but only in nodes corresponding to variables NOTE: it is assumed that SCIPexprgraphPropagateVarBounds was called before if variable bounds were relaxed

propagates bound changes in nodes backward through the graph

New bounds are not stored in varbounds, but only in nodes corresponding to variables. NOTE: it is assumed that SCIPexprgraphPropagateVarBounds was called before if variable bounds were relaxed.

Parameters
exprgraphexpression graph
infinityvalue for infinity in interval arithmetics
minstrengthminimal required relative bound strengthening in a node to trigger a propagation into children nodes
cutoffbuffer to store whether a node's bounds were propagated to an empty interval

Definition at line 15640 of file expr.c.

References SCIP_ExprGraph::depth, exprgraphNodePropagateBounds(), FALSE, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, and NULL.

Referenced by propagateBounds(), and propagateConstraintSides().

SCIP_RETCODE SCIPexprgraphCheckCurvature ( SCIP_EXPRGRAPH exprgraph,
SCIP_Real  infinity,
SCIP_Bool  clearreverseprop 
)

updates curvature information in expression graph nodes w.r.t. currently stored variable bounds implies update of bounds in expression graph

updates curvature information in expression graph nodes w.r.t. currently stored variable bounds

Implies update of bounds in expression graph.

Parameters
exprgraphexpression graph
infinityvalue for infinity in interval arithmetics
clearreversepropwhether to reset bound tightenings from reverse propagation

Definition at line 15672 of file expr.c.

References SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::curv, SCIP_ExprGraph::depth, exprgraphUpdateVarNodeBounds(), SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIPerrorMessage, SCIPexprgraphUpdateNodeBoundsCurvature(), and SCIPintervalIsEmpty().

SCIP_RETCODE SCIPexprgraphSimplify ( SCIP_EXPRGRAPH exprgraph,
SCIP_MESSAGEHDLR messagehdlr,
SCIP_Real  eps,
int  maxexpansionexponent,
SCIP_Bool havechange,
SCIP_Bool domainerror 
)

aims at simplifying an expression graph a domain error can occur when variables were fixed to values for which a parent expression is not defined (e.g., 0^(-1) or log(-1))

aims at simplifying an expression graph

A domain error can occur when variables were fixed to values for which a parent expression is not defined (e.g., 0^(-1) or log(-1)).

Parameters
exprgraphexpression graph
messagehdlrmessage handler
epsthreshold, under which positive values are treat as 0
maxexpansionexponentmaximal exponent for which we still expand non-monomial polynomials
havechangebuffer to indicate whether the graph has been modified
domainerrorbuffer to indicate whether a domain error has been encountered, i.e., some expressions turned into NaN

Definition at line 15715 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocMemoryArray, BMSfreeBlockMemoryArrayNull, BMSfreeMemoryArray, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::data, SCIP_ExprGraph::depth, ensureBlockMemoryArraySize, EPSZ, exprgraphMoveNode(), exprgraphNodeEval(), exprgraphNodeReplaceChild(), exprgraphNodeSimplify(), exprUnconvertPolynomial(), FALSE, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::nuses, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::parents, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_SUM, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPexprgraphEval(), SCIPexprgraphFindConstNode(), SCIPexprgraphGetNodeVal(), SCIPexprgraphMoveNodeParents(), SCIPexprgraphPrintDot(), SCIPgetRandomReal(), SCIPhashmapCreate(), SCIPhashmapExists(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPhashmapInsert(), SCIPisFinite, SCIPrelDiff(), SCIP_ExprGraphNode::simplified, TRUE, and SCIP_ExprGraphNode::value.

Referenced by SCIP_DECL_CONSEXITPRE(), and SCIP_DECL_CONSPRESOL().

SCIP_RETCODE SCIPexprgraphGetTree ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE rootnode,
SCIP_EXPRTREE **  exprtree 
)

creates an expression tree from a given node in an expression graph

Parameters
exprgraphexpression graph
rootnodeexpression graph node that should represent root of expression tree
exprtreebuffer to store pointer to created expression tree

Definition at line 15974 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_ExprGraphNode::depth, exprgraphNodeCreateExpr(), NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::pos, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPexprtreeCreate(), and SCIP_ExprGraph::vars.

Referenced by createNlRow(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSPRINT(), SCIPexprgraphGetSeparableTrees(), SCIPexprgraphGetSumTrees(), and SCIPwriteGms().

SCIP_RETCODE SCIPexprgraphGetSeparableTrees ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
int  exprtreessize,
int *  nexprtrees,
SCIP_EXPRTREE **  exprtrees,
SCIP_Real exprtreecoefs 
)

creates a sum of expression trees with pairwise disjoint variables from a given node in an expression graph Giving SCIPexprgraphGetNodeNChildren() for exprtreesize is always sufficient.

Parameters
exprgraphexpression graph
nodeexpression graph node which represents expression to get
exprtreessizelength of exprtrees and exprtreecoefs arrays, need to be at least one
nexprtreesbuffer to store number of expression trees
exprtreesarray where to store expression trees
exprtreecoefsarray where to store coefficients of expression trees

Definition at line 16027 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, SCIP_ExprData_Monomial::childidxs, SCIP_ExprGraphNode::children, SCIP_ExprData_Monomial::coef, SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprData_Monomial::exponents, exprgraphNodeCheckSeparabilityComponent(), exprgraphNodeCreateExpr(), FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, MAX, MIN, SCIP_ExprData_Polynomial::monomials, SCIP_ExprGraphNode::nchildren, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::pos, SCIP_ExprData_Quadratic::quadelems, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_EXPR_CONST, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_QUADRATIC, SCIP_EXPR_SUM, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIPexprCreate(), SCIPexprCreateLinear(), SCIPexprCreateMonomial(), SCIPexprCreatePolynomial(), SCIPexprCreateQuadratic(), SCIPexprgraphGetTree(), SCIPexprtreeCreate(), TRUE, SCIP_ExprTree::vars, and SCIP_ExprGraph::vars.

void SCIPexprgraphGetSubtreeVarsUsage ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
int *  varsusage 
)

returns how often expression graph variables are used in a subtree of the expression graph

Parameters
exprgraphexpression graph
noderoot node of expression graph subtree
varsusagearray where to count usage of variables, length must be at least the number of variables in the graph

Definition at line 16461 of file expr.c.

References BMSclearMemoryArray, exprgraphNodeGetVarsUsage(), NULL, and SCIP_ExprGraph::nvars.

Referenced by SCIP_DECL_CONSGETNVARS(), and SCIP_DECL_CONSGETVARS().

int SCIPexprgraphGetSumTreesNSummands ( SCIP_EXPRGRAPHNODE node)

gives the number of summands which the expression of an expression graph node consists of

Parameters
nodeexpression graph node

Definition at line 16477 of file expr.c.

References SCIP_ExprGraphNode::data, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprGraphNode::nchildren, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprGraphNode::op, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_QUADRATIC, and SCIP_EXPR_SUM.

Referenced by SCIP_DECL_CONSEXITPRE().

SCIP_RETCODE SCIPexprgraphGetSumTrees ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
int  exprtreessize,
int *  nexprtrees,
SCIP_EXPRTREE **  exprtrees,
SCIP_Real exprtreecoefs 
)

creates a sum of expression trees, possibly sharing variables, from a given node in an expression graph

Parameters
exprgraphexpression graph
nodeexpression graph node which represents expression to get
exprtreessizelength of exprtrees and exptreecoefs arrays, should be at least SCIPexprgraphGetSumTreesNSummands()
nexprtreesbuffer to store number of expression trees
exprtreesarray where to store expression trees
exprtreecoefsarray where to store coefficients of expression trees

Definition at line 16513 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_ExprData_Monomial::childidxs, SCIP_ExprGraphNode::children, SCIP_ExprData_Monomial::coef, SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, EPSISINT, SCIP_ExprData_Monomial::exponents, exprgraphNodeCreateExpr(), FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Polynomial::monomials, SCIP_ExprGraphNode::nchildren, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::pos, SCIP_ExprData_Quadratic::quadelems, SCIP_ALLOC, SCIP_CALL, SCIP_ERROR, SCIP_EXPR_CONST, SCIP_EXPR_INTPOWER, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIPexprCreate(), SCIPexprCreateMonomial(), SCIPexprCreatePolynomial(), SCIPexprgraphGetTree(), SCIPexprtreeAddExpr(), SCIPexprtreeCreate(), SCIP_ExprTree::vars, and SCIP_ExprGraph::vars.

Referenced by SCIP_DECL_CONSEXITPRE().