Scippy

SCIP

Solving Constraint Integer Programs

expr.c File Reference

Detailed Description

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

Author
Stefan Vigerske
Thorsten Gellermann
Ingmar Vierhaus (exprparse)

Definition in file expr.c.

#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include "nlpi/pub_expr.h"
#include "nlpi/struct_expr.h"
#include "nlpi/exprinterpret.h"
#include "scip/intervalarith.h"
#include "scip/pub_misc.h"
#include "scip/misc.h"
#include "scip/pub_message.h"

Go to the source code of this file.

Macros

#define SCIP_EXPRESSION_MAXCHILDEST   16
 
#define SIGN(x)   ((x) >= 0.0 ? 1.0 : -1.0)
 
#define ensureBlockMemoryArraySize(blkmem, array1, cursize, minsize)
 
#define ensureBlockMemoryArraySize3(blkmem, array1, array2, array3, cursize, minsize)
 

Functions

Miscellaneous private methods
static int calcGrowSize (int num)
 
static SCIP_DECL_SORTPTRCOMP (exprgraphnodecomp)
 
static SCIP_Bool isLbBetter (SCIP_Real minstrength, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
 
static SCIP_Bool isUbBetter (SCIP_Real minstrength, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
 
Quadratic expression data private methods
static SCIP_RETCODE quadraticdataCreate (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_QUADRATIC **quadraticdata, SCIP_Real constant, int nchildren, SCIP_Real *lincoefs, int nquadelems, SCIP_QUADELEM *quadelems)
 
static void quadraticdataSort (SCIP_EXPRDATA_QUADRATIC *quadraticdata)
 
Polynomial expression data private methods
static SCIP_DECL_SORTPTRCOMP (monomialdataCompare)
 
static SCIP_RETCODE monomialdataEnsureFactorsSize (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_MONOMIAL *monomialdata, int minsize)
 
static SCIP_RETCODE polynomialdataCreate (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_POLYNOMIAL **polynomialdata, int nmonomials, SCIP_EXPRDATA_MONOMIAL **monomials, SCIP_Real constant, SCIP_Bool copymonomials)
 
static SCIP_RETCODE polynomialdataCopy (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_POLYNOMIAL **polynomialdata, SCIP_EXPRDATA_POLYNOMIAL *sourcepolynomialdata)
 
static void polynomialdataFree (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_POLYNOMIAL **polynomialdata)
 
static SCIP_RETCODE polynomialdataEnsureMonomialsSize (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_POLYNOMIAL *polynomialdata, int minsize)
 
static SCIP_RETCODE polynomialdataAddMonomials (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_POLYNOMIAL *polynomialdata, int nmonomials, SCIP_EXPRDATA_MONOMIAL **monomials, SCIP_Bool copymonomials)
 
static void polynomialdataSortMonomials (SCIP_EXPRDATA_POLYNOMIAL *polynomialdata)
 
static void polynomialdataMergeMonomials (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_POLYNOMIAL *polynomialdata, SCIP_Real eps, SCIP_Bool mergefactors)
 
static void polynomialdataMultiplyByConstant (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_POLYNOMIAL *polynomialdata, SCIP_Real factor)
 
static SCIP_RETCODE polynomialdataMultiplyByMonomial (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_POLYNOMIAL *polynomialdata, SCIP_EXPRDATA_MONOMIAL *factor, int *childmap)
 
static SCIP_RETCODE polynomialdataMultiplyByPolynomial (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_POLYNOMIAL *polynomialdata, SCIP_EXPRDATA_POLYNOMIAL *factordata, int *childmap)
 
static SCIP_RETCODE polynomialdataPower (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_POLYNOMIAL *polynomialdata, int exponent)
 
static void polynomialdataApplyChildmap (SCIP_EXPRDATA_POLYNOMIAL *polynomialdata, int *childmap)
 
static SCIP_RETCODE polynomialdataExpandMonomialFactor (BMS_BLKMEM *blkmem, SCIP_MESSAGEHDLR *messagehdlr, SCIP_EXPRDATA_POLYNOMIAL *polynomialdata, int monomialpos, int factorpos, SCIP_EXPRDATA_POLYNOMIAL *factorpolynomial, int *childmap, int maxexpansionexponent, SCIP_Bool *success)
 
Expression operand methods
const char * SCIPexpropGetName (SCIP_EXPROP op)
 
int SCIPexpropGetNChildren (SCIP_EXPROP op)
 
Expressions private methods
static SCIP_RETCODE exprCreate (BMS_BLKMEM *blkmem, SCIP_EXPR **expr, SCIP_EXPROP op, int nchildren, SCIP_EXPR **children, SCIP_EXPROPDATA opdata)
 
static SCIP_RETCODE exprConvertToPolynomial (BMS_BLKMEM *blkmem, SCIP_EXPROP *op, SCIP_EXPROPDATA *data, int nchildren)
 
static SCIP_RETCODE exprUnconvertPolynomial (BMS_BLKMEM *blkmem, SCIP_EXPROP *op, SCIP_EXPROPDATA *data, int nchildren, void **children)
 
static SCIP_RETCODE exprsimplifyAddChildren (BMS_BLKMEM *blkmem, SCIP_EXPR *expr, int nexprs, SCIP_EXPR **exprs, SCIP_Bool comparechildren, SCIP_Real eps, int *childmap)
 
static SCIP_RETCODE exprsimplifyConvertToPolynomials (BMS_BLKMEM *blkmem, SCIP_EXPR *expr)
 
static SCIP_RETCODE exprsimplifyRemoveDuplicatePolynomialChildren (BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_Real eps)
 
static SCIP_RETCODE exprsimplifyRemovePolynomialNullChildren (BMS_BLKMEM *blkmem, SCIP_EXPR *expr)
 
static SCIP_RETCODE exprsimplifyRemovePolynomialUnusedChildren (BMS_BLKMEM *blkmem, SCIP_EXPR *expr)
 
static SCIP_RETCODE exprsimplifyFlattenPolynomials (BMS_BLKMEM *blkmem, SCIP_MESSAGEHDLR *messagehdlr, SCIP_EXPR *expr, SCIP_Real eps, int maxexpansionexponent)
 
static SCIP_RETCODE exprsimplifySeparateLinearFromPolynomial (BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_Real eps, int nvars, int *nlinvars, int *linidxs, SCIP_Real *lincoefs)
 
static SCIP_RETCODE exprsimplifyUnconvertPolynomials (BMS_BLKMEM *blkmem, SCIP_EXPR *expr)
 
static SCIP_DECL_HASHGETKEY (exprparseVarTableGetKey)
 
static SCIP_RETCODE exprparseReadVariable (BMS_BLKMEM *blkmem, const char **str, SCIP_EXPR **expr, int *nvars, int **varnames, int *varnameslength, SCIP_HASHTABLE *vartable, SCIP_Real coefficient, const char *varnameendptr)
 
static SCIP_RETCODE exprparseFindClosingParenthesis (const char *str, const char **endptr, int length)
 
static SCIP_RETCODE exprparseFindSeparatingComma (const char *str, const char **endptr, int length)
 
static SCIP_RETCODE exprParse (BMS_BLKMEM *blkmem, SCIP_MESSAGEHDLR *messagehdlr, SCIP_EXPR **expr, const char *str, int length, const char *lastchar, int *nvars, int **varnames, int *varnameslength, SCIP_HASHTABLE *vartable, int recursiondepth)
 
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_Bool SCIPexprAreMonomialsEqual (SCIP_EXPRDATA_MONOMIAL *monomial1, SCIP_EXPRDATA_MONOMIAL *monomial2, SCIP_Real eps)
 
void SCIPexprChgMonomialCoef (SCIP_EXPRDATA_MONOMIAL *monomial, SCIP_Real newcoef)
 
SCIP_RETCODE SCIPexprAddMonomialFactors (BMS_BLKMEM *blkmem, SCIP_EXPRDATA_MONOMIAL *monomial, int nfactors, int *childidxs, SCIP_Real *exponents)
 
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 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_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_DECL_USEREXPRPRINT((*print)))
 
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)
 
static SCIP_RETCODE doCheckCurvature (SCIP_EXPR *expr, SCIP_Real infinity, SCIP_INTERVAL *varbounds, SCIP_INTERVAL *childbounds, SCIP_Real *param, SCIP_EXPRCURV *curv, SCIP_EXPRCURV *childcurv, SCIP_INTERVAL *bounds)
 
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, int varnameslength)
 
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)
 
Expression graph node private methods
static SCIP_RETCODE exprgraphNodeAddParent (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE *node, SCIP_EXPRGRAPHNODE *parent)
 
static void exprgraphNodeSortParents (SCIP_EXPRGRAPHNODE *node)
 
static SCIP_RETCODE exprgraphNodeRemoveParent (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE **node, SCIP_EXPRGRAPHNODE *parent)
 
static SCIP_Bool exprgraphNodeIsParent (SCIP_EXPRGRAPHNODE *node, SCIP_EXPRGRAPHNODE *parent)
 
static SCIP_RETCODE exprgraphNodeAddChildren (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE *node, int nexprs, SCIP_EXPRGRAPHNODE **exprs, int *childmap)
 
static SCIP_RETCODE exprgraphNodeReplaceChild (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, SCIP_EXPRGRAPHNODE **oldchild, SCIP_EXPRGRAPHNODE *newchild)
 
static SCIP_DECL_SORTPTRCOMP (exprgraphConstNodeComp)
 
static void exprgraphSortConstNodes (SCIP_EXPRGRAPH *exprgraph)
 
static SCIP_Bool exprgraphFindConstNodePos (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, int *pos)
 
static SCIP_RETCODE exprgraphCreateNode (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, SCIP_EXPROP op, SCIP_EXPROPDATA opdata)
 
static void exprgraphPrintNodeExpression (SCIP_EXPRGRAPHNODE *node, SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char **varnames, SCIP_Bool printchildrenbounds)
 
static void exprgraphPrintNodeDot (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char **varnames)
 
static SCIP_RETCODE exprgraphNodeEval (SCIP_EXPRGRAPHNODE *node, SCIP_Real *varvals)
 
static SCIP_RETCODE exprgraphNodeEvalWithChildren (SCIP_EXPRGRAPHNODE *node, SCIP_Real *varvals)
 
static SCIP_RETCODE exprgraphNodeUpdateBounds (SCIP_EXPRGRAPHNODE *node, SCIP_Real infinity, SCIP_Real minstrength, SCIP_Bool parenttightenisinvalid)
 
static void exprgraphNodePropagateBounds (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, SCIP_Real infinity, SCIP_Real minstrength, SCIP_Bool *cutoff)
 
static SCIP_RETCODE exprgraphNodeRemovePolynomialDuplicateChildren (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node)
 
static SCIP_RETCODE exprgraphNodeRemovePolynomialNullChildren (BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE *node)
 
static SCIP_RETCODE exprgraphNodeSimplify (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Real eps, int maxexpansionexponent, SCIP_Bool *havechange)
 
static SCIP_RETCODE exprgraphNodeCreateExpr (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, SCIP_EXPR **expr, int *nexprvars, int *varidx)
 
static void exprgraphNodeGetVarsUsage (SCIP_EXPRGRAPHNODE *node, int *varsusage)
 
static void exprgraphNodeCheckSeparabilityComponent (SCIP_EXPRGRAPHNODE *node, int *compnr, int nchildcomps, int *childcomps, int nvars, int *varcomps)
 
Expression graph private methods
static SCIP_RETCODE exprgraphEnsureDepth (SCIP_EXPRGRAPH *exprgraph, int mindepth)
 
static SCIP_RETCODE exprgraphRemoveVar (SCIP_EXPRGRAPH *exprgraph, int varidx)
 
static SCIP_RETCODE exprgraphMoveNode (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, int newdepth)
 
static SCIP_RETCODE exprgraphFindParentByOperator (SCIP_EXPRGRAPH *exprgraph, int nchildren, SCIP_EXPRGRAPHNODE **children, SCIP_EXPROP op, SCIP_EXPROPDATA opdata, SCIP_EXPR **exprchildren, SCIP_EXPRGRAPHNODE **parent)
 
static SCIP_RETCODE exprgraphAddExpr (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPR *expr, void **vars, SCIP_Real *params, SCIP_EXPRGRAPHNODE **exprnode, SCIP_Bool *exprnodeisnew)
 
static void exprgraphUpdateVarNodeBounds (SCIP_EXPRGRAPH *exprgraph, SCIP_Bool *clearreverseprop, SCIP_Bool *boundchanged)
 
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_DECL_USEREXPRPRINT((*print)))
 
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)
 

Expression curvature methods

static const char * curvnames [4]
 
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 private methods

#define exprcurvSin   exprcurvDefault
 
#define exprcurvCos   exprcurvDefault
 
#define exprevalIntTan   exprevalIntDefault
 
#define exprcurvTan   exprcurvDefault
 
#define EXPROPEMPTY   {NULL, -1, NULL, NULL, NULL, NULL, NULL}
 
static struct exprOpTableElement exprOpTable []
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntDefault)
 
static SCIP_DECL_EXPRCURV (exprcurvDefault)
 
static SCIP_DECL_EXPREVAL (exprevalVar)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntVar)
 
static SCIP_DECL_EXPRCURV (exprcurvVar)
 
static SCIP_DECL_EXPREVAL (exprevalConst)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntConst)
 
static SCIP_DECL_EXPRCURV (exprcurvConst)
 
static SCIP_DECL_EXPREVAL (exprevalParam)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntParam)
 
static SCIP_DECL_EXPRCURV (exprcurvParam)
 
static SCIP_DECL_EXPREVAL (exprevalPlus)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntPlus)
 
static SCIP_DECL_EXPRCURV (exprcurvPlus)
 
static SCIP_DECL_EXPREVAL (exprevalMinus)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntMinus)
 
static SCIP_DECL_EXPRCURV (exprcurvMinus)
 
static SCIP_DECL_EXPREVAL (exprevalMult)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntMult)
 
static SCIP_DECL_EXPRCURV (exprcurvMult)
 
static SCIP_DECL_EXPREVAL (exprevalDiv)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntDiv)
 
static SCIP_DECL_EXPRCURV (exprcurvDiv)
 
static SCIP_DECL_EXPREVAL (exprevalSquare)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntSquare)
 
static SCIP_DECL_EXPRCURV (exprcurvSquare)
 
static SCIP_DECL_EXPREVAL (exprevalSquareRoot)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntSquareRoot)
 
static SCIP_DECL_EXPRCURV (exprcurvSquareRoot)
 
static SCIP_DECL_EXPREVAL (exprevalRealPower)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntRealPower)
 
static SCIP_DECL_EXPRCURV (exprcurvRealPower)
 
static SCIP_DECL_EXPREVAL (exprevalIntPower)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntIntPower)
 
static SCIP_DECL_EXPRCURV (exprcurvIntPower)
 
static SCIP_DECL_EXPREVAL (exprevalSignPower)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntSignPower)
 
static SCIP_DECL_EXPRCURV (exprcurvSignPower)
 
static SCIP_DECL_EXPREVAL (exprevalExp)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntExp)
 
static SCIP_DECL_EXPRCURV (exprcurvExp)
 
static SCIP_DECL_EXPREVAL (exprevalLog)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntLog)
 
static SCIP_DECL_EXPRCURV (exprcurvLog)
 
static SCIP_DECL_EXPREVAL (exprevalSin)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntSin)
 
static SCIP_DECL_EXPREVAL (exprevalCos)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntCos)
 
static SCIP_DECL_EXPREVAL (exprevalTan)
 
static SCIP_DECL_EXPREVAL (exprevalMin)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntMin)
 
static SCIP_DECL_EXPRCURV (exprcurvMin)
 
static SCIP_DECL_EXPREVAL (exprevalMax)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntMax)
 
static SCIP_DECL_EXPRCURV (exprcurvMax)
 
static SCIP_DECL_EXPREVAL (exprevalAbs)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntAbs)
 
static SCIP_DECL_EXPRCURV (exprcurvAbs)
 
static SCIP_DECL_EXPREVAL (exprevalSign)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntSign)
 
static SCIP_DECL_EXPRCURV (exprcurvSign)
 
static SCIP_DECL_EXPREVAL (exprevalSum)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntSum)
 
static SCIP_DECL_EXPRCURV (exprcurvSum)
 
static SCIP_DECL_EXPREVAL (exprevalProduct)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntProduct)
 
static SCIP_DECL_EXPRCURV (exprcurvProduct)
 
static SCIP_DECL_EXPREVAL (exprevalLinear)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntLinear)
 
static SCIP_DECL_EXPRCURV (exprcurvLinear)
 
static SCIP_DECL_EXPRCOPYDATA (exprCopyDataLinear)
 
static SCIP_DECL_EXPRFREEDATA (exprFreeDataLinear)
 
static SCIP_DECL_EXPREVAL (exprevalQuadratic)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntQuadratic)
 
static SCIP_DECL_EXPRCURV (exprcurvQuadratic)
 
static SCIP_DECL_EXPRCOPYDATA (exprCopyDataQuadratic)
 
static SCIP_DECL_EXPRFREEDATA (exprFreeDataQuadratic)
 
static SCIP_DECL_EXPREVAL (exprevalPolynomial)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntPolynomial)
 
static SCIP_DECL_EXPRCURV (exprcurvPolynomial)
 
static SCIP_DECL_EXPRCOPYDATA (exprCopyDataPolynomial)
 
static SCIP_DECL_EXPRFREEDATA (exprFreeDataPolynomial)
 
static SCIP_DECL_EXPREVAL (exprevalUser)
 
static SCIP_DECL_EXPRINTEVAL (exprevalIntUser)
 
static SCIP_DECL_EXPRCURV (exprcurvUser)
 
static SCIP_DECL_EXPRCOPYDATA (exprCopyDataUser)
 
static SCIP_DECL_EXPRFREEDATA (exprFreeDataUser)
 

Quadratic element methods

#define QUADELEMS_ISBETTER(a, b)   ( ((a).idx1 < (b).idx1) || ((a).idx1 == (b).idx1 && (a).idx2 < (b).idx2) )
 
#define QUADELEMS_SWAP(x, y)
 
static void quadelemsQuickSort (SCIP_QUADELEM *elems, int start, int end)
 
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)
 

Macro Definition Documentation

◆ SCIP_EXPRESSION_MAXCHILDEST

#define SCIP_EXPRESSION_MAXCHILDEST   16

◆ SIGN

#define SIGN (   x)    ((x) >= 0.0 ? 1.0 : -1.0)

sign of a value (-1 or +1)

0.0 has sign +1

Definition at line 46 of file expr.c.

Referenced by SCIP_DECL_EXPREVAL().

◆ ensureBlockMemoryArraySize

#define ensureBlockMemoryArraySize (   blkmem,
  array1,
  cursize,
  minsize 
)
Value:
do { \
int __newsize; \
assert((blkmem) != NULL); \
if( *(cursize) >= (minsize) ) \
break; \
__newsize = calcGrowSize(minsize); \
assert(__newsize >= (minsize)); \
SCIP_ALLOC( BMSreallocBlockMemoryArray(blkmem, array1, *(cursize), __newsize) ); \
*(cursize) = __newsize; \
} while( FALSE )
#define NULL
Definition: def.h:253
#define FALSE
Definition: def.h:73
static int calcGrowSize(int num)
Definition: expr.c:106
#define BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum)
Definition: memory.h:447

ensures that a block memory array has at least a given size

if cursize is 0, then *array1 can be NULL

Definition at line 52 of file expr.c.

Referenced by exprgraphMoveNode(), exprgraphNodeAddParent(), exprgraphNodeSimplify(), polynomialdataEnsureMonomialsSize(), SCIPexprgraphAddConst(), SCIPexprgraphAddNode(), SCIPexprgraphAddVars(), SCIPexprgraphReplaceVarByLinearSum(), and SCIPexprgraphSimplify().

◆ ensureBlockMemoryArraySize3

#define ensureBlockMemoryArraySize3 (   blkmem,
  array1,
  array2,
  array3,
  cursize,
  minsize 
)
Value:
do { \
int __newsize; \
assert((blkmem) != NULL); \
if( *(cursize) >= (minsize) ) \
break; \
__newsize = calcGrowSize(minsize); \
assert(__newsize >= (minsize)); \
SCIP_ALLOC( BMSreallocBlockMemoryArray(blkmem, array1, *(cursize), __newsize) ); \
SCIP_ALLOC( BMSreallocBlockMemoryArray(blkmem, array2, *(cursize), __newsize) ); \
SCIP_ALLOC( BMSreallocBlockMemoryArray(blkmem, array3, *(cursize), __newsize) ); \
*(cursize) = __newsize; \
} while( FALSE )
#define NULL
Definition: def.h:253
#define FALSE
Definition: def.h:73
static int calcGrowSize(int num)
Definition: expr.c:106
#define BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum)
Definition: memory.h:447

ensures that three block memory arrays have at least a given size

if cursize is 0, then arrays can be NULL

Definition at line 87 of file expr.c.

Referenced by exprgraphEnsureDepth(), SCIPexprgraphAddVars(), SCIPexprgraphCreate(), and SCIPexprgraphReplaceVarByLinearSum().

◆ exprcurvSin

#define exprcurvSin   exprcurvDefault

Definition at line 2078 of file expr.c.

◆ exprcurvCos

#define exprcurvCos   exprcurvDefault

Definition at line 2106 of file expr.c.

◆ exprevalIntTan

#define exprevalIntTan   exprevalIntDefault

Definition at line 2121 of file expr.c.

◆ exprcurvTan

#define exprcurvTan   exprcurvDefault

Definition at line 2124 of file expr.c.

◆ EXPROPEMPTY

#define EXPROPEMPTY   {NULL, -1, NULL, NULL, NULL, NULL, NULL}

Definition at line 3213 of file expr.c.

◆ QUADELEMS_ISBETTER

#define QUADELEMS_ISBETTER (   a,
  b 
)    ( ((a).idx1 < (b).idx1) || ((a).idx1 == (b).idx1 && (a).idx2 < (b).idx2) )

comparing two quadratic elements

a is better than b if index1 of a is smaller than index1 of b or index1 of both is equal but index2 of a is smaller than index2 of b

Definition at line 9090 of file expr.c.

Referenced by quadelemsQuickSort(), and SCIPquadelemSqueeze().

◆ QUADELEMS_SWAP

#define QUADELEMS_SWAP (   x,
  y 
)
Value:
{ \
SCIP_QUADELEM temp = x; \
x = y; \
y = temp; \
}
SCIP_VAR ** x
Definition: circlepacking.c:54
SCIP_VAR ** y
Definition: circlepacking.c:55

swaps two quadratic elements

Definition at line 9093 of file expr.c.

Referenced by quadelemsQuickSort().

Function Documentation

◆ calcGrowSize()

static int calcGrowSize ( int  num)
static

calculate memory size for dynamically allocated arrays (copied from scip/set.c)

Parameters
numminimum number of entries to store

Definition at line 106 of file expr.c.

Referenced by exprsimplifyFlattenPolynomials(), and monomialdataEnsureFactorsSize().

◆ SCIP_DECL_SORTPTRCOMP() [1/3]

static SCIP_DECL_SORTPTRCOMP ( exprgraphnodecomp  )
static

expression graph nodes comparison to use in sorting methods

The nodes need to have been added to the expression graph (depth,pos >= 0). The better node is the one with the lower depth and lower position, if depth is equal.

Definition at line 126 of file expr.c.

References SCIP_ExprGraphNode::depth, NULL, and SCIP_ExprGraphNode::pos.

◆ isLbBetter()

static SCIP_Bool isLbBetter ( SCIP_Real  minstrength,
SCIP_Real  newlb,
SCIP_Real  oldlb,
SCIP_Real  oldub 
)
static

checks if a given new lower bound is tighter (w.r.t. given bound strengthening epsilon) than the old one (copied from scip/set.c)

Parameters
minstrengthminimal relative improvement required to be a better bound
newlbnew lower bound
oldlbold lower bound
oldubold upper bound

Definition at line 149 of file expr.c.

References eps, EPSGT, FALSE, MAX, MIN, REALABS, and SCIP_Real.

Referenced by exprgraphNodeUpdateBounds(), exprgraphUpdateVarNodeBounds(), SCIPexprgraphTightenNodeBounds(), and SCIPexprgraphUpdateNodeBoundsCurvature().

◆ isUbBetter()

static SCIP_Bool isUbBetter ( SCIP_Real  minstrength,
SCIP_Real  newub,
SCIP_Real  oldlb,
SCIP_Real  oldub 
)
static

checks if a given new upper bound is tighter (w.r.t. given bound strengthening epsilon) than the old one (copied from scip/set.c)

Parameters
minstrengthminimal relative improvement required to be a better bound
newubnew upper bound
oldlbold lower bound
oldubold upper bound

Definition at line 169 of file expr.c.

References eps, EPSLT, FALSE, MAX, MIN, REALABS, and SCIP_Real.

Referenced by exprgraphNodeUpdateBounds(), exprgraphUpdateVarNodeBounds(), SCIPexprgraphTightenNodeBounds(), and SCIPexprgraphUpdateNodeBoundsCurvature().

◆ SCIPexprcurvAdd()

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 205 of file expr.c.

Referenced by checkCurvature(), and SCIP_DECL_EXPRCURV().

◆ SCIPexprcurvNegate()

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 214 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().

◆ 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 240 of file expr.c.

References SCIP_EXPRCURV_LINEAR, and SCIPexprcurvNegate().

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

◆ SCIPexprcurvPower()

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 253 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().

◆ SCIPexprcurvMonomial()

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

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 361 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().

◆ SCIPexprcurvGetName()

const char* SCIPexprcurvGetName ( SCIP_EXPRCURV  curv)

gives name as string for a curvature

Parameters
curvcurvature

Definition at line 474 of file expr.c.

References curvnames, and SCIP_EXPRCURV_LINEAR.

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

◆ quadraticdataCreate()

static SCIP_RETCODE quadraticdataCreate ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_QUADRATIC **  quadraticdata,
SCIP_Real  constant,
int  nchildren,
SCIP_Real lincoefs,
int  nquadelems,
SCIP_QUADELEM quadelems 
)
static

creates SCIP_EXPRDATA_QUADRATIC data structure from given quadratic elements

Parameters
blkmemblock memory data structure
quadraticdatabuffer to store pointer to quadratic data
constantconstant
nchildrennumber of children
lincoefslinear coefficients of children, or NULL if all 0.0
nquadelemsnumber of quadratic elements
quadelemsquadratic elements

Definition at line 490 of file expr.c.

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

Referenced by SCIP_DECL_EXPRCOPYDATA(), SCIPexprCreateQuadratic(), and SCIPexprgraphCreateNodeQuadratic().

◆ quadraticdataSort()

static void quadraticdataSort ( SCIP_EXPRDATA_QUADRATIC quadraticdata)
static

sorts quadratic elements in a SCIP_EXPRDATA_QUADRATIC data structure

Parameters
quadraticdataquadratic data

Definition at line 528 of file expr.c.

References SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprData_Quadratic::quadelems, SCIPquadelemSort(), SCIP_ExprData_Quadratic::sorted, and TRUE.

Referenced by SCIP_DECL_EXPRINTEVAL(), SCIPexprGetMaxDegree(), and SCIPexprSortQuadElems().

◆ SCIP_DECL_SORTPTRCOMP() [2/3]

static SCIP_DECL_SORTPTRCOMP ( monomialdataCompare  )
static

compares two monomials

gives 0 if monomials are equal

Definition at line 564 of file expr.c.

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

◆ monomialdataEnsureFactorsSize()

static SCIP_RETCODE monomialdataEnsureFactorsSize ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_MONOMIAL monomialdata,
int  minsize 
)
static

ensures that the factors arrays of a monomial have at least a given size

Parameters
blkmemblock memory data structure
monomialdatamonomial data
minsizeminimal size of factors arrays

Definition at line 603 of file expr.c.

References BMSreallocBlockMemoryArray, calcGrowSize(), SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Monomial::factorssize, NULL, SCIP_ALLOC, and SCIP_OKAY.

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

◆ polynomialdataCreate()

static SCIP_RETCODE polynomialdataCreate ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_POLYNOMIAL **  polynomialdata,
int  nmonomials,
SCIP_EXPRDATA_MONOMIAL **  monomials,
SCIP_Real  constant,
SCIP_Bool  copymonomials 
)
static

creates SCIP_EXPRDATA_POLYNOMIAL data structure from given monomials

Parameters
blkmemblock memory data structure
polynomialdatabuffer to store pointer to polynomial data
nmonomialsnumber of monomials
monomialsmonomials
constantconstant part
copymonomialswhether to copy monomials, or copy only given pointers, in which case polynomialdata assumes ownership of monomial structure

Definition at line 628 of file expr.c.

References BMSallocBlockMemory, BMSallocBlockMemoryArray, BMSduplicateBlockMemoryArray, SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Monomial::nfactors, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, and SCIPexprCreateMonomial().

Referenced by exprConvertToPolynomial(), exprsimplifyFlattenPolynomials(), SCIPexprCreatePolynomial(), and SCIPexprgraphCreateNodePolynomial().

◆ polynomialdataCopy()

static SCIP_RETCODE polynomialdataCopy ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_POLYNOMIAL **  polynomialdata,
SCIP_EXPRDATA_POLYNOMIAL sourcepolynomialdata 
)
static

creates a copy of a SCIP_EXPRDATA_POLYNOMIAL data structure

Parameters
blkmemblock memory data structure
polynomialdatabuffer to store pointer to polynomial data
sourcepolynomialdatapolynomial data to copy

Definition at line 675 of file expr.c.

References BMSallocBlockMemoryArray, BMSduplicateBlockMemory, SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPexprCreateMonomial(), and SCIP_ExprData_Monomial::sorted.

Referenced by polynomialdataExpandMonomialFactor(), polynomialdataPower(), and SCIP_DECL_EXPRCOPYDATA().

◆ polynomialdataFree()

static void polynomialdataFree ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_POLYNOMIAL **  polynomialdata 
)
static

frees a SCIP_EXPRDATA_POLYNOMIAL data structure

Parameters
blkmemblock memory data structure
polynomialdatapointer to polynomial data to free

Definition at line 712 of file expr.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, NULL, and SCIPexprFreeMonomial().

Referenced by exprgraphNodeSimplify(), exprsimplifyFlattenPolynomials(), exprUnconvertPolynomial(), polynomialdataExpandMonomialFactor(), polynomialdataPower(), and SCIP_DECL_EXPRFREEDATA().

◆ polynomialdataEnsureMonomialsSize()

static SCIP_RETCODE polynomialdataEnsureMonomialsSize ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_POLYNOMIAL polynomialdata,
int  minsize 
)
static

ensures that the monomials array of a polynomial has at least a given size

Parameters
blkmemblock memory data structure
polynomialdatapolynomial data
minsizeminimal size of monomials array

Definition at line 741 of file expr.c.

References ensureBlockMemoryArraySize, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Polynomial::monomialssize, NULL, and SCIP_OKAY.

Referenced by exprConvertToPolynomial(), polynomialdataAddMonomials(), polynomialdataMultiplyByMonomial(), and polynomialdataMultiplyByPolynomial().

◆ polynomialdataAddMonomials()

static SCIP_RETCODE polynomialdataAddMonomials ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_POLYNOMIAL polynomialdata,
int  nmonomials,
SCIP_EXPRDATA_MONOMIAL **  monomials,
SCIP_Bool  copymonomials 
)
static

◆ polynomialdataSortMonomials()

static void polynomialdataSortMonomials ( SCIP_EXPRDATA_POLYNOMIAL polynomialdata)
static

ensures that monomials of a polynomial are sorted

Parameters
polynomialdatapolynomial expression

Definition at line 800 of file expr.c.

References SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Polynomial::nmonomials, NULL, SCIPsortPtr(), SCIP_ExprData_Polynomial::sorted, SCIP_ExprData_Monomial::sorted, and TRUE.

Referenced by exprgraphFindParentByOperator(), polynomialdataMergeMonomials(), and SCIPexprSortMonomials().

◆ polynomialdataMergeMonomials()

static void polynomialdataMergeMonomials ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_POLYNOMIAL polynomialdata,
SCIP_Real  eps,
SCIP_Bool  mergefactors 
)
static

merges monomials that differ only in coefficient into a single monomial

Eliminates monomials with coefficient between -eps and eps.

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

Definition at line 833 of file expr.c.

References SCIP_ExprData_Monomial::coef, SCIP_ExprData_Polynomial::constant, EPSZ, FALSE, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, polynomialdataSortMonomials(), SCIPexprFreeMonomial(), SCIPexprMergeMonomialFactors(), and SCIP_ExprData_Polynomial::sorted.

Referenced by exprgraphNodeSimplify(), exprsimplifySeparateLinearFromPolynomial(), exprUnconvertPolynomial(), polynomialdataPower(), SCIPexprgraphNodeSplitOffLinear(), and SCIPexprMergeMonomials().

◆ polynomialdataMultiplyByConstant()

static void polynomialdataMultiplyByConstant ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_POLYNOMIAL polynomialdata,
SCIP_Real  factor 
)
static

multiplies each summand of a polynomial by a given constant

Parameters
blkmemblock memory
polynomialdatapolynomial data
factorconstant factor

Definition at line 925 of file expr.c.

References SCIP_ExprData_Monomial::coef, SCIP_ExprData_Polynomial::constant, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Polynomial::nmonomials, NULL, SCIPexprChgMonomialCoef(), and SCIPexprFreeMonomial().

Referenced by polynomialdataMultiplyByMonomial(), polynomialdataMultiplyByPolynomial(), and SCIPexprMultiplyPolynomialByConstant().

◆ polynomialdataMultiplyByMonomial()

static SCIP_RETCODE polynomialdataMultiplyByMonomial ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_POLYNOMIAL polynomialdata,
SCIP_EXPRDATA_MONOMIAL factor,
int *  childmap 
)
static

◆ polynomialdataMultiplyByPolynomial()

static SCIP_RETCODE polynomialdataMultiplyByPolynomial ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_POLYNOMIAL polynomialdata,
SCIP_EXPRDATA_POLYNOMIAL factordata,
int *  childmap 
)
static

multiplies a polynomial by a polynomial

Factors need to be different.

Parameters
blkmemblock memory
polynomialdatapolynomial data
factordatapolynomial factor data
childmapmap children in factor to children in polynomialdata, or NULL for 1:1

Definition at line 999 of file expr.c.

References SCIP_ExprData_Monomial::coef, SCIP_ExprData_Polynomial::constant, FALSE, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Polynomial::nmonomials, NULL, polynomialdataAddMonomials(), polynomialdataEnsureMonomialsSize(), polynomialdataMultiplyByConstant(), polynomialdataMultiplyByMonomial(), SCIP_CALL, SCIP_OKAY, SCIPexprChgMonomialCoef(), SCIPexprCreateMonomial(), SCIPexprMultiplyMonomialByMonomial(), SCIP_ExprData_Polynomial::sorted, and TRUE.

Referenced by polynomialdataPower(), and SCIPexprMultiplyPolynomialByPolynomial().

◆ polynomialdataPower()

static SCIP_RETCODE polynomialdataPower ( BMS_BLKMEM blkmem,
SCIP_EXPRDATA_POLYNOMIAL polynomialdata,
int  exponent 
)
static

takes a power of a polynomial

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

Parameters
blkmemblock memory
polynomialdatapolynomial data
exponentexponent of power operation

Definition at line 1089 of file expr.c.

References SCIP_ExprData_Polynomial::constant, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Polynomial::nmonomials, NULL, polynomialdataCopy(), polynomialdataFree(), polynomialdataMergeMonomials(), polynomialdataMultiplyByPolynomial(), pow(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPexprFreeMonomial(), SCIPexprMonomialPower(), and TRUE.

Referenced by polynomialdataExpandMonomialFactor(), and SCIPexprPolynomialPower().

◆ polynomialdataApplyChildmap()

static void polynomialdataApplyChildmap ( SCIP_EXPRDATA_POLYNOMIAL polynomialdata,
int *  childmap 
)
static

◆ polynomialdataExpandMonomialFactor()

static SCIP_RETCODE polynomialdataExpandMonomialFactor ( BMS_BLKMEM blkmem,
SCIP_MESSAGEHDLR messagehdlr,
SCIP_EXPRDATA_POLYNOMIAL polynomialdata,
int  monomialpos,
int  factorpos,
SCIP_EXPRDATA_POLYNOMIAL factorpolynomial,
int *  childmap,
int  maxexpansionexponent,
SCIP_Bool success 
)
static

replaces a factor in a monomial by a polynomial and expands the result

Parameters
blkmemblock memory data structure
messagehdlrmessage handler
polynomialdatapolynomial data where to expand a monomial
monomialposposition of monomial which factor to expand
factorposposition of factor in monomial to expand
factorpolynomialpolynomial that should replace factor
childmapmap of child indices in factorpolynomial to children of polynomial
maxexpansionexponentmaximal exponent for which polynomials (with > 1 summands) are expanded
successbuffer to store whether expansion has been done

Definition at line 1188 of file expr.c.

References SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, SCIP_ExprData_Polynomial::constant, EPSFLOOR, EPSISINT, SCIP_ExprData_Monomial::exponents, FALSE, monomialdataEnsureFactorsSize(), SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, polynomialdataAddMonomials(), polynomialdataApplyChildmap(), polynomialdataCopy(), polynomialdataFree(), polynomialdataMultiplyByMonomial(), polynomialdataPower(), pow(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPexprAddMonomialFactors(), SCIPexprFreeMonomial(), SCIPmessagePrintWarning(), SCIP_ExprData_Polynomial::sorted, SCIP_ExprData_Monomial::sorted, and TRUE.

Referenced by exprgraphNodeSimplify(), and exprsimplifyFlattenPolynomials().

◆ SCIP_DECL_EXPRINTEVAL() [1/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntDefault  )
static

a default implementation of expression interval evaluation that always gives a correct result

Definition at line 1410 of file expr.c.

References infinity, SCIP_OKAY, and SCIPintervalSetEntire().

Referenced by SCIP_DECL_EXPRFREEDATA().

◆ SCIP_DECL_EXPRCURV() [1/25]

static SCIP_DECL_EXPRCURV ( exprcurvDefault  )
static

a default implementation of expression curvature check that always gives a correct result

Definition at line 1419 of file expr.c.

References SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.

Referenced by SCIP_DECL_EXPRFREEDATA().

◆ SCIP_DECL_EXPREVAL() [1/27]

static SCIP_DECL_EXPREVAL ( exprevalVar  )
static

point evaluation for EXPR_VAR

Definition at line 1428 of file expr.c.

References NULL, and SCIP_OKAY.

Referenced by SCIP_DECL_EXPRFREEDATA().

◆ SCIP_DECL_EXPRINTEVAL() [2/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntVar  )
static

interval evaluation for EXPR_VAR

Definition at line 1440 of file expr.c.

References NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRCURV() [2/25]

static SCIP_DECL_EXPRCURV ( exprcurvVar  )
static

curvature for EXPR_VAR

Definition at line 1452 of file expr.c.

References NULL, SCIP_EXPRCURV_LINEAR, and SCIP_OKAY.

◆ SCIP_DECL_EXPREVAL() [2/27]

static SCIP_DECL_EXPREVAL ( exprevalConst  )
static

point evaluation for EXPR_CONST

Definition at line 1463 of file expr.c.

References NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [3/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntConst  )
static

interval evaluation for EXPR_CONST

Definition at line 1474 of file expr.c.

References NULL, SCIP_OKAY, and SCIPintervalSet().

◆ SCIP_DECL_EXPRCURV() [3/25]

static SCIP_DECL_EXPRCURV ( exprcurvConst  )
static

curvature for EXPR_CONST

Definition at line 1485 of file expr.c.

References NULL, SCIP_EXPRCURV_LINEAR, and SCIP_OKAY.

◆ SCIP_DECL_EXPREVAL() [3/27]

static SCIP_DECL_EXPREVAL ( exprevalParam  )
static

point evaluation for EXPR_PARAM

Definition at line 1496 of file expr.c.

References NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [4/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntParam  )
static

interval evaluation for EXPR_PARAM

Definition at line 1508 of file expr.c.

References NULL, SCIP_OKAY, and SCIPintervalSet().

◆ SCIP_DECL_EXPRCURV() [4/25]

static SCIP_DECL_EXPRCURV ( exprcurvParam  )
static

curvature for EXPR_PARAM

Definition at line 1520 of file expr.c.

References NULL, SCIP_EXPRCURV_LINEAR, and SCIP_OKAY.

◆ SCIP_DECL_EXPREVAL() [4/27]

static SCIP_DECL_EXPREVAL ( exprevalPlus  )
static

point evaluation for EXPR_PLUS

Definition at line 1531 of file expr.c.

References NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [5/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntPlus  )
static

interval evaluation for EXPR_PLUS

Definition at line 1543 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalAdd().

◆ SCIP_DECL_EXPRCURV() [5/25]

static SCIP_DECL_EXPRCURV ( exprcurvPlus  )
static

curvature for EXPR_PLUS

Definition at line 1555 of file expr.c.

References NULL, SCIP_OKAY, and SCIPexprcurvAdd().

◆ SCIP_DECL_EXPREVAL() [5/27]

static SCIP_DECL_EXPREVAL ( exprevalMinus  )
static

point evaluation for EXPR_MINUS

Definition at line 1567 of file expr.c.

References NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [6/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntMinus  )
static

interval evaluation for EXPR_MINUS

Definition at line 1579 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalSub().

◆ SCIP_DECL_EXPRCURV() [6/25]

static SCIP_DECL_EXPRCURV ( exprcurvMinus  )
static

curvature for EXPR_MINUS

Definition at line 1591 of file expr.c.

References NULL, SCIP_OKAY, SCIPexprcurvAdd(), and SCIPexprcurvNegate().

◆ SCIP_DECL_EXPREVAL() [6/27]

static SCIP_DECL_EXPREVAL ( exprevalMult  )
static

point evaluation for EXPR_MUL

Definition at line 1603 of file expr.c.

References NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [7/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntMult  )
static

interval evaluation for EXPR_MUL

Definition at line 1615 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalMul().

◆ SCIP_DECL_EXPRCURV() [7/25]

static SCIP_DECL_EXPRCURV ( exprcurvMult  )
static

curvature for EXPR_MUL

Definition at line 1627 of file expr.c.

References NULL, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, and SCIPexprcurvMultiply().

◆ SCIP_DECL_EXPREVAL() [7/27]

static SCIP_DECL_EXPREVAL ( exprevalDiv  )
static

point evaluation for EXPR_DIV

Definition at line 1655 of file expr.c.

References NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [8/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntDiv  )
static

interval evaluation for EXPR_DIV

Definition at line 1667 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalDiv().

◆ SCIP_DECL_EXPRCURV() [8/25]

static SCIP_DECL_EXPRCURV ( exprcurvDiv  )
static

curvature for EXPR_DIV

Definition at line 1679 of file expr.c.

References NULL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, and SCIPexprcurvMultiply().

◆ SCIP_DECL_EXPREVAL() [8/27]

static SCIP_DECL_EXPREVAL ( exprevalSquare  )
static

point evaluation for EXPR_SQUARE

Definition at line 1723 of file expr.c.

References NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [9/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntSquare  )
static

interval evaluation for EXPR_SQUARE

Definition at line 1735 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalSquare().

◆ SCIP_DECL_EXPRCURV() [9/25]

static SCIP_DECL_EXPRCURV ( exprcurvSquare  )
static

curvature for EXPR_SQUARE

Definition at line 1747 of file expr.c.

References NULL, SCIP_OKAY, and SCIPexprcurvPower().

◆ SCIP_DECL_EXPREVAL() [9/27]

static SCIP_DECL_EXPREVAL ( exprevalSquareRoot  )
static

point evaluation for EXPR_SQRT

Definition at line 1760 of file expr.c.

References NULL, SCIP_OKAY, and sqrt().

◆ SCIP_DECL_EXPRINTEVAL() [10/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntSquareRoot  )
static

interval evaluation for EXPR_SQRT

Definition at line 1772 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalSquareRoot().

◆ SCIP_DECL_EXPRCURV() [10/25]

static SCIP_DECL_EXPRCURV ( exprcurvSquareRoot  )
static

curvature for EXPR_SQRT

Definition at line 1784 of file expr.c.

References NULL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.

◆ SCIP_DECL_EXPREVAL() [10/27]

static SCIP_DECL_EXPREVAL ( exprevalRealPower  )
static

point evaluation for EXPR_REALPOWER

Definition at line 1803 of file expr.c.

References NULL, pow(), and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [11/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntRealPower  )
static

interval evaluation for EXPR_REALPOWER

Definition at line 1815 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalPowerScalar().

◆ SCIP_DECL_EXPRCURV() [11/25]

static SCIP_DECL_EXPRCURV ( exprcurvRealPower  )
static

curvature for EXPR_REALPOWER

Definition at line 1827 of file expr.c.

References NULL, SCIP_OKAY, and SCIPexprcurvPower().

◆ SCIP_DECL_EXPREVAL() [11/27]

static SCIP_DECL_EXPREVAL ( exprevalIntPower  )
static

point evaluation for EXPR_INTPOWER

Definition at line 1843 of file expr.c.

References NULL, pow(), SCIP_OKAY, and SCIP_Real.

◆ SCIP_DECL_EXPRINTEVAL() [12/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntIntPower  )
static

interval evaluation for EXPR_INTPOWER

Definition at line 1875 of file expr.c.

References infinity, NULL, SCIP_OKAY, SCIP_Real, and SCIPintervalPowerScalar().

◆ SCIP_DECL_EXPRCURV() [12/25]

static SCIP_DECL_EXPRCURV ( exprcurvIntPower  )
static

curvature for EXPR_INTPOWER

Definition at line 1887 of file expr.c.

References NULL, SCIP_OKAY, SCIP_Real, and SCIPexprcurvPower().

◆ SCIP_DECL_EXPREVAL() [12/27]

static SCIP_DECL_EXPREVAL ( exprevalSignPower  )
static

point evaluation for EXPR_SIGNPOWER

Definition at line 1900 of file expr.c.

References NULL, pow(), and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [13/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntSignPower  )
static

interval evaluation for EXPR_SIGNPOWER

Definition at line 1915 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalSignPowerScalar().

◆ SCIP_DECL_EXPRCURV() [13/25]

static SCIP_DECL_EXPRCURV ( exprcurvSignPower  )
static

curvature for EXPR_SIGNPOWER

Definition at line 1927 of file expr.c.

References NULL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIPexprcurvNegate(), SCIPexprcurvPower(), and SCIPintervalSetBounds().

◆ SCIP_DECL_EXPREVAL() [13/27]

static SCIP_DECL_EXPREVAL ( exprevalExp  )
static

point evaluation for EXPR_EXP

Definition at line 1970 of file expr.c.

References exp(), NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [14/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntExp  )
static

interval evaluation for EXPR_EXP

Definition at line 1982 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalExp().

◆ SCIP_DECL_EXPRCURV() [14/25]

static SCIP_DECL_EXPRCURV ( exprcurvExp  )
static

curvature for EXPR_EXP

Definition at line 1994 of file expr.c.

References NULL, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.

◆ SCIP_DECL_EXPREVAL() [14/27]

static SCIP_DECL_EXPREVAL ( exprevalLog  )
static

point evaluation for EXPR_LOG

Definition at line 2012 of file expr.c.

References log(), NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [15/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntLog  )
static

interval evaluation for EXPR_LOG

Definition at line 2024 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalLog().

◆ SCIP_DECL_EXPRCURV() [15/25]

static SCIP_DECL_EXPRCURV ( exprcurvLog  )
static

curvature for EXPR_LOG

Definition at line 2036 of file expr.c.

References NULL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.

◆ SCIP_DECL_EXPREVAL() [15/27]

static SCIP_DECL_EXPREVAL ( exprevalSin  )
static

point evaluation for EXPR_SIN

Definition at line 2054 of file expr.c.

References NULL, SCIP_OKAY, and sin().

◆ SCIP_DECL_EXPRINTEVAL() [16/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntSin  )
static

interval evaluation for EXPR_SIN

Definition at line 2066 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalSin().

◆ SCIP_DECL_EXPREVAL() [16/27]

static SCIP_DECL_EXPREVAL ( exprevalCos  )
static

point evaluation for EXPR_COS

Definition at line 2082 of file expr.c.

References cos(), NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [17/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntCos  )
static

interval evaluation for EXPR_COS

Definition at line 2094 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalCos().

◆ SCIP_DECL_EXPREVAL() [17/27]

static SCIP_DECL_EXPREVAL ( exprevalTan  )
static

point evaluation for EXPR_TAN

Definition at line 2110 of file expr.c.

References NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPREVAL() [18/27]

static SCIP_DECL_EXPREVAL ( exprevalMin  )
static

point evaluation for EXPR_MIN

Definition at line 2165 of file expr.c.

References MIN, NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [18/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntMin  )
static

interval evaluation for EXPR_MIN

Definition at line 2177 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalMin().

◆ SCIP_DECL_EXPRCURV() [16/25]

static SCIP_DECL_EXPRCURV ( exprcurvMin  )
static

curvature for EXPR_MIN

Definition at line 2189 of file expr.c.

References NULL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.

◆ SCIP_DECL_EXPREVAL() [19/27]

static SCIP_DECL_EXPREVAL ( exprevalMax  )
static

point evaluation for EXPR_MAX

Definition at line 2208 of file expr.c.

References MAX, NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [19/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntMax  )
static

interval evaluation for EXPR_MAX

Definition at line 2220 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalMax().

◆ SCIP_DECL_EXPRCURV() [17/25]

static SCIP_DECL_EXPRCURV ( exprcurvMax  )
static

curvature for EXPR_MAX

Definition at line 2232 of file expr.c.

References NULL, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.

◆ SCIP_DECL_EXPREVAL() [20/27]

static SCIP_DECL_EXPREVAL ( exprevalAbs  )
static

point evaluation for EXPR_ABS

Definition at line 2250 of file expr.c.

References ABS, NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [20/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntAbs  )
static

interval evaluation for EXPR_ABS

Definition at line 2262 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalAbs().

◆ SCIP_DECL_EXPRCURV() [18/25]

static SCIP_DECL_EXPRCURV ( exprcurvAbs  )
static

curvature for EXPR_ABS

Definition at line 2274 of file expr.c.

References NULL, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, and SCIPexprcurvMultiply().

◆ SCIP_DECL_EXPREVAL() [21/27]

static SCIP_DECL_EXPREVAL ( exprevalSign  )
static

point evaluation for EXPR_SIGN

Definition at line 2299 of file expr.c.

References NULL, SCIP_OKAY, and SIGN.

◆ SCIP_DECL_EXPRINTEVAL() [21/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntSign  )
static

interval evaluation for EXPR_SIGN

Definition at line 2311 of file expr.c.

References infinity, NULL, SCIP_OKAY, and SCIPintervalSign().

◆ SCIP_DECL_EXPRCURV() [19/25]

static SCIP_DECL_EXPRCURV ( exprcurvSign  )
static

curvature for EXPR_SIGN

Definition at line 2323 of file expr.c.

References NULL, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.

◆ SCIP_DECL_EXPREVAL() [22/27]

static SCIP_DECL_EXPREVAL ( exprevalSum  )
static

point evaluation for EXPR_SUM

Definition at line 2339 of file expr.c.

References NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [22/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntSum  )
static

interval evaluation for EXPR_SUM

Definition at line 2355 of file expr.c.

References infinity, NULL, SCIP_OKAY, SCIPintervalAdd(), and SCIPintervalSet().

◆ SCIP_DECL_EXPRCURV() [20/25]

static SCIP_DECL_EXPRCURV ( exprcurvSum  )
static

curvature for EXPR_SUM

Definition at line 2372 of file expr.c.

References NULL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, and SCIPexprcurvAdd().

◆ SCIP_DECL_EXPREVAL() [23/27]

static SCIP_DECL_EXPREVAL ( exprevalProduct  )
static

point evaluation for EXPR_PRODUCT

Definition at line 2389 of file expr.c.

References NULL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRINTEVAL() [23/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntProduct  )
static

interval evaluation for EXPR_PRODUCT

Definition at line 2405 of file expr.c.

References infinity, NULL, SCIP_OKAY, SCIPintervalMul(), and SCIPintervalSet().

◆ SCIP_DECL_EXPRCURV() [21/25]

static SCIP_DECL_EXPRCURV ( exprcurvProduct  )
static

curvature for EXPR_PRODUCT

Definition at line 2422 of file expr.c.

References FALSE, NULL, SCIP_Bool, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPexprcurvMultiply(), and TRUE.

◆ SCIP_DECL_EXPREVAL() [24/27]

static SCIP_DECL_EXPREVAL ( exprevalLinear  )
static

point evaluation for EXPR_LINEAR

Definition at line 2466 of file expr.c.

References NULL, SCIP_OKAY, and SCIP_Real.

◆ SCIP_DECL_EXPRINTEVAL() [24/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntLinear  )
static

interval evaluation for EXPR_LINEAR

Definition at line 2488 of file expr.c.

References infinity, NULL, SCIP_OKAY, SCIP_Real, SCIPintervalAddScalar(), and SCIPintervalScalprodScalars().

◆ SCIP_DECL_EXPRCURV() [22/25]

static SCIP_DECL_EXPRCURV ( exprcurvLinear  )
static

curvature for EXPR_LINEAR

Definition at line 2502 of file expr.c.

References NULL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIP_Real, SCIPexprcurvAdd(), and SCIPexprcurvMultiply().

◆ SCIP_DECL_EXPRCOPYDATA() [1/4]

static SCIP_DECL_EXPRCOPYDATA ( exprCopyDataLinear  )
static

expression data copy for EXPR_LINEAR

Definition at line 2523 of file expr.c.

References BMSduplicateBlockMemoryArray, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIP_Real.

Referenced by SCIP_DECL_EXPRFREEDATA().

◆ SCIP_DECL_EXPRFREEDATA() [1/4]

static SCIP_DECL_EXPRFREEDATA ( exprFreeDataLinear  )
static

expression data free for EXPR_LINEAR

Definition at line 2541 of file expr.c.

References BMSfreeBlockMemoryArray, NULL, and SCIP_Real.

Referenced by SCIP_DECL_EXPRFREEDATA().

◆ SCIP_DECL_EXPREVAL() [25/27]

static SCIP_DECL_EXPREVAL ( exprevalQuadratic  )
static

◆ SCIP_DECL_EXPRINTEVAL() [25/27]

◆ SCIP_DECL_EXPRCURV() [23/25]

◆ SCIP_DECL_EXPRCOPYDATA() [2/4]

static SCIP_DECL_EXPRCOPYDATA ( exprCopyDataQuadratic  )
static

◆ SCIP_DECL_EXPRFREEDATA() [2/4]

static SCIP_DECL_EXPRFREEDATA ( exprFreeDataQuadratic  )
static

◆ SCIP_DECL_EXPREVAL() [26/27]

◆ SCIP_DECL_EXPRINTEVAL() [26/27]

◆ SCIP_DECL_EXPRCURV() [24/25]

◆ SCIP_DECL_EXPRCOPYDATA() [3/4]

static SCIP_DECL_EXPRCOPYDATA ( exprCopyDataPolynomial  )
static

expression data copy for EXPR_POLYNOMIAL

Definition at line 3058 of file expr.c.

References NULL, polynomialdataCopy(), SCIP_CALL, and SCIP_OKAY.

◆ SCIP_DECL_EXPRFREEDATA() [3/4]

static SCIP_DECL_EXPRFREEDATA ( exprFreeDataPolynomial  )
static

expression data free for EXPR_POLYNOMIAL

Definition at line 3078 of file expr.c.

References NULL, and polynomialdataFree().

◆ SCIP_DECL_EXPREVAL() [27/27]

static SCIP_DECL_EXPREVAL ( exprevalUser  )
static

point evaluation for user expression

Definition at line 3092 of file expr.c.

References NULL, SCIP_CALL, SCIP_OKAY, and SCIP_ExprData_User::userdata.

◆ SCIP_DECL_EXPRINTEVAL() [27/27]

static SCIP_DECL_EXPRINTEVAL ( exprevalIntUser  )
static

interval evaluation for user expression

Definition at line 3105 of file expr.c.

References infinity, NULL, SCIP_CALL, SCIP_OKAY, SCIPintervalSetEntire(), and SCIP_ExprData_User::userdata.

◆ SCIP_DECL_EXPRCURV() [25/25]

static SCIP_DECL_EXPRCURV ( exprcurvUser  )
static

curvature check for user expression

Definition at line 3126 of file expr.c.

References infinity, NULL, SCIP_CALL, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, and SCIP_ExprData_User::userdata.

◆ SCIP_DECL_EXPRCOPYDATA() [4/4]

static SCIP_DECL_EXPRCOPYDATA ( exprCopyDataUser  )
static

data copy for user expression

Definition at line 3147 of file expr.c.

References BMSduplicateBlockMemory, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, and SCIP_ExprData_User::userdata.

◆ SCIP_DECL_EXPRFREEDATA() [4/4]

static SCIP_DECL_EXPRFREEDATA ( exprFreeDataUser  )
static

◆ SCIPexpropGetName()

const char* SCIPexpropGetName ( SCIP_EXPROP  op)

◆ SCIPexpropGetNChildren()

int SCIPexpropGetNChildren ( SCIP_EXPROP  op)

gives the number of children of a simple operand

Parameters
opexpression operand

Definition at line 3274 of file expr.c.

References SCIP_EXPR_LAST.

◆ exprCreate()

static SCIP_RETCODE exprCreate ( BMS_BLKMEM blkmem,
SCIP_EXPR **  expr,
SCIP_EXPROP  op,
int  nchildren,
SCIP_EXPR **  children,
SCIP_EXPROPDATA  opdata 
)
static

creates an expression

Note, that the expression is allocated but for the children only the pointer is copied.

Parameters
blkmemblock memory data structure
exprpointer to buffer for expression address
opoperand of expression
nchildrennumber of children
childrenchildren
opdataoperand data

Definition at line 3293 of file expr.c.

References BMSallocBlockMemory, SCIP_Expr::data, NULL, SCIP_ALLOC, and SCIP_OKAY.

Referenced by SCIPexprCreate(), SCIPexprCreateLinear(), SCIPexprCreatePolynomial(), SCIPexprCreateQuadratic(), and SCIPexprCreateUser().

◆ exprConvertToPolynomial()

static SCIP_RETCODE exprConvertToPolynomial ( BMS_BLKMEM blkmem,
SCIP_EXPROP op,
SCIP_EXPROPDATA data,
int  nchildren 
)
static

tries to convert a given (operator,operatordata) pair into a polynomial operator with corresponding data

Does not do this for constants. If conversion is not possible or operator is already polynomial, *op and *data are left untouched.

Parameters
blkmemblock memory
oppointer to expression operator
datapointer to expression data
nchildrennumber of children of operator

Definition at line 3324 of file expr.c.

References SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, EPSISINT, FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, monomialdataEnsureFactorsSize(), SCIP_ExprData_Polynomial::monomialssize, SCIP_ExprData_Quadratic::nquadelems, NULL, polynomialdataAddMonomials(), polynomialdataCreate(), polynomialdataEnsureMonomialsSize(), SCIP_ExprData_Quadratic::quadelems, 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_OKAY, SCIP_Real, SCIPexprAddMonomialFactors(), SCIPexprCreateMonomial(), SCIPexprFreeMonomial(), and TRUE.

Referenced by exprgraphNodeSimplify(), and exprsimplifyConvertToPolynomials().

◆ exprUnconvertPolynomial()

static SCIP_RETCODE exprUnconvertPolynomial ( BMS_BLKMEM blkmem,
SCIP_EXPROP op,
SCIP_EXPROPDATA data,
int  nchildren,
void **  children 
)
static

◆ exprsimplifyAddChildren()

static SCIP_RETCODE exprsimplifyAddChildren ( BMS_BLKMEM blkmem,
SCIP_EXPR expr,
int  nexprs,
SCIP_EXPR **  exprs,
SCIP_Bool  comparechildren,
SCIP_Real  eps,
int *  childmap 
)
static

adds copies of expressions to the array of children of a sum, product, linear, quadratic, or polynomial expression

For a sum or product expression, this corresponds to add additional summands and factors, resp. For a linear expression, this corresponds to add each expression with coefficient 1.0. For a quadratic or polynomial expression, only the children array may be enlarged, the expression itself remains the same.

Parameters
blkmemblock memory
exprquadratic or polynomial expression
nexprsnumber of expressions to add
exprsexpressions to add
comparechildrenwhether to compare expressions with already existing children (no effect for sum and product)
epswhich epsilon to use when comparing expressions
childmaparray where to store mapping of indices from exprs to children array in expr, or NULL if not of interest

Definition at line 4147 of file expr.c.

References BMSclearMemoryArray, BMSreallocBlockMemoryArray, SCIP_Expr::children, SCIP_Expr::data, FALSE, SCIP_ExprData_Quadratic::lincoefs, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_LINEAR, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_SUM, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIPexprAreEqual(), SCIPexprCopyDeep(), and TRUE.

Referenced by exprsimplifyFlattenPolynomials().

◆ exprsimplifyConvertToPolynomials()

static SCIP_RETCODE exprsimplifyConvertToPolynomials ( BMS_BLKMEM blkmem,
SCIP_EXPR expr 
)
static

converts expressions into polynomials, where possible and obvious

Parameters
blkmemblock memory data structure
exprexpression to convert

Definition at line 4266 of file expr.c.

References SCIP_Expr::children, SCIP_Expr::data, exprConvertToPolynomial(), SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_CALL, and SCIP_OKAY.

Referenced by SCIPexprSimplify().

◆ exprsimplifyRemoveDuplicatePolynomialChildren()

static SCIP_RETCODE exprsimplifyRemoveDuplicatePolynomialChildren ( BMS_BLKMEM blkmem,
SCIP_EXPR expr,
SCIP_Real  eps 
)
static

removes duplicate children in a polynomial expression

Leaves NULL's in children array.

Parameters
blkmemblock memory data structure
exprexpression
epsthreshold for zero

Definition at line 4290 of file expr.c.

References BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_Expr::children, SCIP_Expr::data, FALSE, SCIP_Expr::nchildren, NULL, polynomialdataApplyChildmap(), SCIP_ALLOC, SCIP_Bool, SCIP_EXPR_POLYNOMIAL, SCIP_OKAY, SCIPexprAreEqual(), SCIPexprFreeDeep(), SCIPexprGetOperator(), and TRUE.

Referenced by exprsimplifyFlattenPolynomials().

◆ exprsimplifyRemovePolynomialNullChildren()

static SCIP_RETCODE exprsimplifyRemovePolynomialNullChildren ( BMS_BLKMEM blkmem,
SCIP_EXPR expr 
)
static

eliminates NULL's in children array and shrinks it to actual size

Parameters
blkmemblock memory data structure
exprexpression

Definition at line 4344 of file expr.c.

References BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, BMSreallocBlockMemoryArray, SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, polynomialdataApplyChildmap(), SCIP_ALLOC, SCIP_EXPR_POLYNOMIAL, SCIP_OKAY, and SCIPexprGetOperator().

Referenced by exprsimplifyFlattenPolynomials(), and exprsimplifySeparateLinearFromPolynomial().

◆ exprsimplifyRemovePolynomialUnusedChildren()

static SCIP_RETCODE exprsimplifyRemovePolynomialUnusedChildren ( BMS_BLKMEM blkmem,
SCIP_EXPR expr 
)
static

◆ exprsimplifyFlattenPolynomials()

static SCIP_RETCODE exprsimplifyFlattenPolynomials ( BMS_BLKMEM blkmem,
SCIP_MESSAGEHDLR messagehdlr,
SCIP_EXPR expr,
SCIP_Real  eps,
int  maxexpansionexponent 
)
static

flattens polynomials in polynomials, check for constants in non-polynomials expressions

exprsimplifyConvertToPolynomials should have been called before to eliminate simple polynomial operands.

Parameters
blkmemblock memory data structure
messagehdlrmessage handler
exprexpression
epsthreshold, under which values are treat as 0
maxexpansionexponentmaximal exponent for which we still expand non-monomial polynomials

Definition at line 4461 of file expr.c.

References BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, BMSreallocBlockMemoryArray, calcGrowSize(), SCIP_ExprData_Monomial::childidxs, SCIP_Expr::children, SCIP_ExprData_Monomial::coef, SCIP_ExprData_Polynomial::constant, SCIP_Expr::data, EPSISINT, SCIP_ExprData_Monomial::exponents, exprsimplifyAddChildren(), exprsimplifyRemoveDuplicatePolynomialChildren(), exprsimplifyRemovePolynomialNullChildren(), exprsimplifyRemovePolynomialUnusedChildren(), FALSE, SCIP_ExprData_Polynomial::monomials, SCIP_Expr::nchildren, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, SCIP_Expr::op, polynomialdataCreate(), polynomialdataExpandMonomialFactor(), polynomialdataFree(), pow(), 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_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_OKAY, SCIP_Real, SCIPdebug, SCIPdebugMessage, SCIPdebugPrintf, SCIPexprEval(), SCIPexprFindMonomialFactor(), SCIPexprFreeDeep(), SCIPexprGetNChildren(), SCIPexprGetNMonomials(), SCIPexprGetOperator(), SCIPexprGetOpReal(), SCIPexprMergeMonomials(), SCIPexprPrint(), SCIPmessagePrintWarning(), SCIP_ExprData_Polynomial::sorted, SCIP_ExprData_Monomial::sorted, and TRUE.

Referenced by SCIPexprSimplify().

◆ exprsimplifySeparateLinearFromPolynomial()

static SCIP_RETCODE exprsimplifySeparateLinearFromPolynomial ( BMS_BLKMEM blkmem,
SCIP_EXPR expr,
SCIP_Real  eps,
int  nvars,
int *  nlinvars,
int *  linidxs,
SCIP_Real lincoefs 
)
static

separates linear monomials from an expression, if it is a polynomial expression

Separates only those linear terms whose variable is not used otherwise in the expression.

Parameters
blkmemblock memory data structure
exprexpression
epsthreshold, under which positive values are treat as 0
nvarsnumber of variables in expression
nlinvarsbuffer to store number of linear variables in linear part
linidxsarray to store indices of variables in expression tree which belong to linear part
lincoefsarray to store coefficients of linear part

Definition at line 4790 of file expr.c.

References BMSallocBlockMemoryArray, BMSclearMemoryArray, BMSfreeBlockMemoryArray, SCIP_ExprData_Monomial::childidxs, SCIP_Expr::children, SCIP_ExprData_Monomial::coef, SCIP_Expr::data, SCIP_ExprData_Monomial::exponents, exprsimplifyRemovePolynomialNullChildren(), FALSE, SCIP_ExprData_Polynomial::monomials, SCIP_Expr::nchildren, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, polynomialdataMergeMonomials(), SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_VARIDX, SCIP_OKAY, SCIPexprFreeDeep(), SCIPexprGetNChildren(), SCIPexprGetOperator(), SCIPexprGetOpIndex(), and SCIPexprGetVarsUsage().

Referenced by SCIPexprSimplify().

◆ exprsimplifyUnconvertPolynomials()

static SCIP_RETCODE exprsimplifyUnconvertPolynomials ( BMS_BLKMEM blkmem,
SCIP_EXPR expr 
)
static

converts polynomial expressions back into simpler expressions, where possible

Parameters
blkmemblock memory data structure
exprexpression to convert back

Definition at line 4891 of file expr.c.

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

Referenced by SCIPexprSimplify().

◆ SCIP_DECL_HASHGETKEY()

static SCIP_DECL_HASHGETKEY ( exprparseVarTableGetKey  )
static

Definition at line 4915 of file expr.c.

◆ exprparseReadVariable()

static SCIP_RETCODE exprparseReadVariable ( BMS_BLKMEM blkmem,
const char **  str,
SCIP_EXPR **  expr,
int *  nvars,
int **  varnames,
int *  varnameslength,
SCIP_HASHTABLE vartable,
SCIP_Real  coefficient,
const char *  varnameendptr 
)
static

parses a variable name from a string and creates corresponding expression

Creates a new variable index if variable not seen before, updates varnames and vartable structures.

Parameters
blkmemblock memory data structure
strpointer to the string to be parsed
exprbuffer to store pointer to created expression
nvarsrunning number of encountered variables so far
varnamespointer to buffer to store new variable names
varnameslengthpointer to length of the varnames buffer array
vartablehash table for variable names and corresponding expression index
coefficientcoefficient to be used when creating the expression
varnameendptrif a <varname> should be parsed, set this to NULL. Then, str points to the '<' else, str should point to the first letter of the varname, and varnameendptr should point one char behind the last char of the variable name

Definition at line 4925 of file expr.c.

References NULL, SCIP_CALL, SCIP_EXPR_VARIDX, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_READERROR, SCIP_VARTYPE_BINARY_CHAR, SCIP_VARTYPE_CONTINUOUS_CHAR, SCIP_VARTYPE_IMPLINT_CHAR, SCIP_VARTYPE_INTEGER_CHAR, SCIPerrorMessage, SCIPexprCreate(), SCIPexprCreateLinear(), SCIPhashtableInsert(), SCIPhashtableRetrieve(), and SCIPstrncpy().

Referenced by exprParse().

◆ exprparseFindClosingParenthesis()

static SCIP_RETCODE exprparseFindClosingParenthesis ( const char *  str,
const char **  endptr,
int  length 
)
static

if str[0] points to an opening parenthesis, this function sets endptr to point to the matching closing bracket in str

Searches for at most length characters.

Parameters
strpointer to the string to be parsed
endptrpointer to point to the closing parenthesis
lengthlength of the string to be parsed

Definition at line 5026 of file expr.c.

References SCIP_OKAY, SCIP_READERROR, and SCIPerrorMessage.

Referenced by exprParse().

◆ exprparseFindSeparatingComma()

static SCIP_RETCODE exprparseFindSeparatingComma ( const char *  str,
const char **  endptr,
int  length 
)
static

this function sets endptr to point to the next separating comma in str

That is, for a given string like "x+f(x,y),z", endptr will point to the comma before "z"

Searches for at most length characters.

Parameters
strpointer to the string to be parsed
endptrpointer to point to the comma
lengthlength of the string to be parsed

Definition at line 5065 of file expr.c.

References SCIP_OKAY, SCIP_READERROR, and SCIPerrorMessage.

Referenced by exprParse().

◆ exprParse()

static SCIP_RETCODE exprParse ( BMS_BLKMEM blkmem,
SCIP_MESSAGEHDLR messagehdlr,
SCIP_EXPR **  expr,
const char *  str,
int  length,
const char *  lastchar,
int *  nvars,
int **  varnames,
int *  varnameslength,
SCIP_HASHTABLE vartable,
int  recursiondepth 
)
static

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
lengthlength of the string to be parsed
lastcharpointer to the last char of str that should be parsed
nvarsrunning number of encountered variables so far
varnamespointer to buffer to store new variable names
varnameslengthpointer to length of the varnames buffer array
vartablehash table for variable names and corresponding expression index
recursiondepthcurrent recursion depth

Definition at line 5097 of file expr.c.

References EPSISINT, exprparseFindClosingParenthesis(), exprparseFindSeparatingComma(), exprparseReadVariable(), NULL, number, SCIP_CALL, SCIP_EXPR_ABS, SCIP_EXPR_CONST, SCIP_EXPR_COS, SCIP_EXPR_DIV, SCIP_EXPR_EXP, SCIP_EXPR_INTPOWER, SCIP_EXPR_LOG, SCIP_EXPR_MAX, SCIP_EXPR_MIN, SCIP_EXPR_MUL, SCIP_EXPR_REALPOWER, SCIP_EXPR_SIGNPOWER, SCIP_EXPR_SIN, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_TAN, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPdebug, SCIPdebugMessage, SCIPerrorMessage, SCIPexprAdd(), SCIPexprCreate(), SCIPexprFreeDeep(), SCIPexprFreeShallow(), SCIPexprGetOperator(), SCIPexprGetOpReal(), SCIPexprMulConstant(), SCIPexprPrint(), SCIPmessagePrintInfo(), SCIPstrToIntValue(), and SCIPstrToRealValue().

Referenced by SCIPexprParse().

◆ SCIPexprGetOperator()

◆ SCIPexprGetNChildren()

◆ SCIPexprGetChildren()

SCIP_EXPR** SCIPexprGetChildren ( SCIP_EXPR expr)

gives pointer to array with children of an expression

Parameters
exprexpression

Definition at line 5714 of file expr.c.

References SCIP_Expr::children, and NULL.

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

◆ SCIPexprGetOpIndex()

int SCIPexprGetOpIndex ( SCIP_EXPR expr)

gives index belonging to a SCIP_EXPR_VARIDX or SCIP_EXPR_PARAM operand

Parameters
exprexpression

Definition at line 5724 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().

◆ SCIPexprGetOpReal()

SCIP_Real SCIPexprGetOpReal ( SCIP_EXPR expr)

gives real belonging to a SCIP_EXPR_CONST operand

Parameters
exprexpression

Definition at line 5735 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().

◆ SCIPexprGetOpData()

void* SCIPexprGetOpData ( SCIP_EXPR expr)

gives void* belonging to a complex operand

Parameters
exprexpression

Definition at line 5746 of file expr.c.

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

◆ SCIPexprGetRealPowerExponent()

SCIP_Real SCIPexprGetRealPowerExponent ( SCIP_EXPR expr)

gives exponent belonging to a SCIP_EXPR_REALPOWER expression

Parameters
exprexpression

Definition at line 5757 of file expr.c.

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

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

◆ SCIPexprGetIntPowerExponent()

int SCIPexprGetIntPowerExponent ( SCIP_EXPR expr)

gives exponent belonging to a SCIP_EXPR_INTPOWER expression

Parameters
exprexpression

Definition at line 5768 of file expr.c.

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

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

◆ SCIPexprGetSignPowerExponent()

SCIP_Real SCIPexprGetSignPowerExponent ( SCIP_EXPR expr)

gives exponent belonging to a SCIP_EXPR_SIGNPOWER expression

Parameters
exprexpression

Definition at line 5779 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().

◆ SCIPexprGetLinearCoefs()

SCIP_Real* SCIPexprGetLinearCoefs ( SCIP_EXPR expr)

gives linear coefficients belonging to a SCIP_EXPR_LINEAR expression

Parameters
exprexpression

Definition at line 5790 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().

◆ SCIPexprGetLinearConstant()

SCIP_Real SCIPexprGetLinearConstant ( SCIP_EXPR expr)

gives constant belonging to a SCIP_EXPR_LINEAR expression

Parameters
exprexpression

Definition at line 5803 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().

◆ SCIPexprGetQuadElements()

SCIP_QUADELEM* SCIPexprGetQuadElements ( SCIP_EXPR expr)

gives quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
exprquadratic expression

Definition at line 5816 of file expr.c.

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

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

◆ SCIPexprGetQuadConstant()

SCIP_Real SCIPexprGetQuadConstant ( SCIP_EXPR expr)

gives constant belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
exprquadratic expression

Definition at line 5828 of file expr.c.

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

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

◆ SCIPexprGetQuadLinearCoefs()

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 5841 of file expr.c.

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

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

◆ SCIPexprGetNQuadElements()

int SCIPexprGetNQuadElements ( SCIP_EXPR expr)

gives number of quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
exprquadratic expression

Definition at line 5853 of file expr.c.

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

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

◆ SCIPexprGetMonomials()

SCIP_EXPRDATA_MONOMIAL** SCIPexprGetMonomials ( SCIP_EXPR expr)

gives the monomials belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
exprexpression

Definition at line 5865 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().

◆ SCIPexprGetNMonomials()

int SCIPexprGetNMonomials ( SCIP_EXPR expr)

gives the number of monomials belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
exprexpression

Definition at line 5877 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().

◆ SCIPexprGetPolynomialConstant()

SCIP_Real SCIPexprGetPolynomialConstant ( SCIP_EXPR expr)

gives the constant belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
exprexpression

Definition at line 5889 of file expr.c.

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

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

◆ SCIPexprGetMonomialCoef()

SCIP_Real SCIPexprGetMonomialCoef ( SCIP_EXPRDATA_MONOMIAL monomial)

gets coefficient of a monomial

Parameters
monomialmonomial

Definition at line 5901 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().

◆ SCIPexprGetMonomialNFactors()

int SCIPexprGetMonomialNFactors ( SCIP_EXPRDATA_MONOMIAL monomial)

gets number of factors of a monomial

Parameters
monomialmonomial

Definition at line 5911 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().

◆ SCIPexprGetMonomialChildIndices()

int* SCIPexprGetMonomialChildIndices ( SCIP_EXPRDATA_MONOMIAL monomial)

gets indices of children corresponding to factors of a monomial

Parameters
monomialmonomial

Definition at line 5921 of file expr.c.

References SCIP_ExprData_Monomial::childidxs, and NULL.

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

◆ SCIPexprGetMonomialExponents()

SCIP_Real* SCIPexprGetMonomialExponents ( SCIP_EXPRDATA_MONOMIAL monomial)

gets exponents in factors of a monomial

Parameters
monomialmonomial

Definition at line 5931 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().

◆ SCIPexprGetUserData()

SCIP_USEREXPRDATA* SCIPexprGetUserData ( SCIP_EXPR expr)

gets user data of a user expression

Definition at line 5941 of file expr.c.

References SCIP_Expr::data, and NULL.

◆ SCIPexprHasUserEstimator()

SCIP_Bool SCIPexprHasUserEstimator ( SCIP_EXPR expr)

indicates whether a user expression has the estimator callback defined

Definition at line 5952 of file expr.c.

References SCIP_Expr::data, and NULL.

Referenced by addUserEstimator().

◆ SCIPexprGetUserEvalCapability()

SCIP_EXPRINTCAPABILITY SCIPexprGetUserEvalCapability ( SCIP_EXPR expr)

gives the evaluation capability of a user expression

Definition at line 5963 of file expr.c.

References SCIP_Expr::data, and NULL.

Referenced by analyzeTree().

◆ SCIPexprCreate()

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 5974 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(), SCIPwritePip(), and setupProblem().

◆ SCIPexprCopyDeep()

SCIP_RETCODE SCIPexprCopyDeep ( BMS_BLKMEM blkmem,
SCIP_EXPR **  targetexpr,
SCIP_EXPR sourceexpr 
)

◆ SCIPexprFreeDeep()

◆ SCIPexprFreeShallow()

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 6222 of file expr.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, and NULL.

Referenced by exprParse(), and SCIPexprAdd().

◆ 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.

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 6247 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().

◆ SCIPexprMulConstant()

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 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 6405 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().

◆ SCIPexprCreateLinear()

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 6503 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(), SCIPexprtreeRemoveFixedVars(), and setupProblem().

◆ SCIPexprAddToLinear()

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 6540 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().

◆ SCIPexprCreateQuadratic()

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 6585 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().

◆ SCIPexprSortQuadElems()

void SCIPexprSortQuadElems ( SCIP_EXPR expr)

ensures that quadratic elements of a quadratic expression are sorted

Parameters
exprquadratic expression

Definition at line 6621 of file expr.c.

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

Referenced by eval(), and SCIPexprAreEqual().

◆ SCIPexprCreatePolynomial()

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 6633 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(), SCIPexprgraphGetSumTrees(), and setupProblem().

◆ SCIPexprAddMonomials()

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 6668 of file expr.c.

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

◆ SCIPexprChgPolynomialConstant()

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 6690 of file expr.c.

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

◆ SCIPexprMultiplyPolynomialByConstant()

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 6703 of file expr.c.

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

◆ SCIPexprMultiplyPolynomialByMonomial()

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 6717 of file expr.c.

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

◆ SCIPexprMultiplyPolynomialByPolynomial()

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. 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 6740 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().

◆ SCIPexprPolynomialPower()

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

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 6786 of file expr.c.

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

◆ SCIPexprMergeMonomials()

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.

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

Definition at line 6806 of file expr.c.

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

Referenced by exprsimplifyFlattenPolynomials().

◆ SCIPexprAreMonomialsEqual()

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 6821 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().

◆ SCIPexprChgMonomialCoef()

void SCIPexprChgMonomialCoef ( SCIP_EXPRDATA_MONOMIAL monomial,
SCIP_Real  newcoef 
)

changes coefficient of monomial

Parameters
monomialmonomial
newcoefnew coefficient

Definition at line 6852 of file expr.c.

References SCIP_ExprData_Monomial::coef, and NULL.

Referenced by polynomialdataMultiplyByConstant(), and polynomialdataMultiplyByPolynomial().

◆ SCIPexprAddMonomialFactors()

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 6863 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().

◆ SCIPexprMultiplyMonomialByMonomial()

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 6892 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().

◆ SCIPexprMonomialPower()

void SCIPexprMonomialPower ( SCIP_EXPRDATA_MONOMIAL monomial,
int  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 6927 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().

◆ SCIPexprMergeMonomialFactors()

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.

Parameters
monomialmonomial
epsthreshold under which numbers are treated as 0.0

Definition at line 6957 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 exprgraphNodeSimplify(), and polynomialdataMergeMonomials().

◆ SCIPexprSortMonomials()

void SCIPexprSortMonomials ( SCIP_EXPR expr)

ensures that monomials of a polynomial are sorted

Parameters
exprpolynomial expression

Definition at line 7024 of file expr.c.

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

Referenced by SCIPexprAreEqual().

◆ SCIPexprCreateMonomial()

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 7036 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(), SCIPexprgraphGetSumTrees(), and setupProblem().

◆ SCIPexprFreeMonomial()

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 7093 of file expr.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, and NULL.

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

◆ SCIPexprSortMonomialFactors()

void SCIPexprSortMonomialFactors ( SCIP_EXPRDATA_MONOMIAL monomial)

◆ SCIPexprFindMonomialFactor()

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.

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

Definition at line 7137 of file expr.c.

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

Referenced by exprgraphNodeSimplify(), and exprsimplifyFlattenPolynomials().

◆ SCIPexprCreateUser()

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_DECL_USEREXPRPRINT((*print))   
)

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 7154 of file expr.c.

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

Referenced by exprgraphNodeCreateExpr().

◆ SCIPexprHasParam()

SCIP_Bool SCIPexprHasParam ( SCIP_EXPR expr)

indicates whether the expression contains a SCIP_EXPR_PARAM

Parameters
exprexpression

Definition at line 7214 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().

◆ SCIPexprGetMaxDegree()

◆ SCIPexprGetVarsUsage()

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 7558 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().

◆ SCIPexprAreEqual()

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

◆ SCIPexprSimplify()

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.

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 7796 of file expr.c.

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

Referenced by SCIPexprtreeSimplify().

◆ SCIPexprEvalShallow()

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 7848 of file expr.c.

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

◆ SCIPexprEval()

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 7867 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().

◆ SCIPexprEvalIntShallow()

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 7908 of file expr.c.

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

◆ SCIPexprEvalInt()

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 7928 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().

◆ SCIPexprEvalUser()

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 7970 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().

◆ SCIPexprEvalIntUser()

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 7993 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().

◆ doCheckCurvature()

static SCIP_RETCODE doCheckCurvature ( SCIP_EXPR expr,
SCIP_Real  infinity,
SCIP_INTERVAL varbounds,
SCIP_INTERVAL childbounds,
SCIP_Real param,
SCIP_EXPRCURV curv,
SCIP_EXPRCURV childcurv,
SCIP_INTERVAL bounds 
)
static

internal curvature check method

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

Definition at line 8027 of file expr.c.

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

Referenced by SCIPexprCheckCurvature().

◆ SCIPexprCheckCurvature()

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 8063 of file expr.c.

References BMSallocMemoryArray, BMSfreeMemoryArrayNull, doCheckCurvature(), SCIP_Expr::nchildren, NULL, SCIP_ALLOC, SCIP_ALLOC_TERMINATE, SCIP_EXPRESSION_MAXCHILDEST, and SCIP_OKAY.

Referenced by doCheckCurvature(), and SCIPexprtreeCheckCurvature().

◆ SCIPexprEstimateUser()

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 8108 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().

◆ SCIPexprSubstituteVars()

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 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 8146 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().

◆ SCIPexprReindexVars()

void SCIPexprReindexVars ( SCIP_EXPR expr,
int *  newindices 
)

updates variable indices in expression tree

Parameters
exprexpression to update
newindicesnew indices of variables

Definition at line 8184 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().

◆ SCIPexprReindexParams()

void SCIPexprReindexParams ( SCIP_EXPR expr,
int *  newindices 
)

updates parameter indices in expression tree

Parameters
exprexpression to update
newindicesnew indices of variables

Definition at line 8205 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().

◆ SCIPexprPrint()

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 8226 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_MAXSTRLEN, SCIP_Real, SCIPABORT, SCIPerrorMessage, SCIPexprPrint(), SCIPmessageFPrintInfo(), SCIPsnprintf(), and SCIP_ExprData_User::userdata.

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

◆ SCIPexprParse()

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

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)
varnameslengthlength of the varnames buffer array

Definition at line 8539 of file expr.c.

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

Referenced by SCIP_DECL_CONSPARSE().

◆ SCIPexprtreeGetRoot()

◆ SCIPexprtreeGetNVars()

int SCIPexprtreeGetNVars ( SCIP_EXPRTREE tree)

returns number of variables in expression tree

Parameters
treeexpression tree

Definition at line 8613 of file expr.c.

References NULL, and SCIP_ExprTree::nvars.

Referenced by addConcaveEstimatorBivariate(), addConcaveEstimatorMultivariate(), addConcaveEstimatorUnivariate(), addIntervalGradientEstimator(), addLinearization(), addUserEstimator(), checkCurvature(), computeGradient(), computeViolation(), consdataAddExprtrees(), createConstraint(), evalFunctionGradient(), evalFunctionValue(), freeConstraint(), generateConvexConcaveUnderestimator(), generateCut(), getLinearAndQuadraticCoefs(), hessLagAddExprtree(), hessLagSparsitySetNzFlagForExprtree(), nlpAddNlRows(), nlpSetupNlpiIndices(), nlrowCalcActivityBounds(), nlrowExprtreeChanged(), nlrowRemoveFixedExprtreeVars(), printFunction(), printRowNl(), processNlRow(), readObjective(), registerBranchingVariables(), registerLargeRelaxValueVariableForBranching(), removeFixedVariables(), replaceViolatedByLinearConstraints(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSENFOPS(), SCIP_DECL_CONSEXITPRE(), SCIP_DECL_CONSGETNVARS(), SCIP_DECL_CONSGETVARS(), SCIP_DECL_CONSINITLP(), SCIPcreateConsBivariate(), SCIPcreateNlpiProb(), 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().

◆ SCIPexprtreeGetNParams()

int SCIPexprtreeGetNParams ( SCIP_EXPRTREE tree)

returns number of parameters in expression tree

Parameters
treeexpression tree

Definition at line 8623 of file expr.c.

References SCIP_ExprTree::nparams, and NULL.

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

◆ SCIPexprtreeGetParamVals()

SCIP_Real* SCIPexprtreeGetParamVals ( SCIP_EXPRTREE tree)

returns values of parameters or NULL if none

Parameters
treeexpression tree

Definition at line 8633 of file expr.c.

References NULL, and SCIP_ExprTree::params.

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

◆ SCIPexprtreeSetParamVal()

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 8643 of file expr.c.

References NULL, and SCIP_ExprTree::params.

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

◆ SCIPexprtreeGetInterpreterData()

◆ SCIPexprtreeSetInterpreterData()

void SCIPexprtreeSetInterpreterData ( SCIP_EXPRTREE tree,
SCIP_EXPRINTDATA interpreterdata 
)

sets data of expression tree interpreter

Parameters
treeexpression tree
interpreterdataexpression interpreter data

Definition at line 8668 of file expr.c.

References SCIP_ExprTree::interpreterdata, and NULL.

Referenced by SCIPexprintCompile().

◆ SCIPexprtreeFreeInterpreterData()

SCIP_RETCODE SCIPexprtreeFreeInterpreterData ( SCIP_EXPRTREE tree)

frees data of expression tree interpreter, if any

Parameters
treeexpression tree

Definition at line 8681 of file expr.c.

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

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

◆ SCIPexprtreeHasParam()

SCIP_Bool SCIPexprtreeHasParam ( SCIP_EXPRTREE tree)

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

Parameters
treeexpression tree

Definition at line 8695 of file expr.c.

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

◆ SCIPexprtreeGetMaxDegree()

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 8711 of file expr.c.

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

Referenced by SCIPwriteGms().

◆ SCIPexprtreeEval()

◆ SCIPexprtreeEvalInt()

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 8740 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().

◆ SCIPexprtreePrint()

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 8757 of file expr.c.

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

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

◆ SCIPexprtreeCreate()

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 8772 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(), SCIPwritePip(), and setupProblem().

◆ SCIPexprtreeCopy()

◆ SCIPexprtreeFree()

◆ SCIPexprtreeSetParams()

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 8877 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().

◆ SCIPexprtreeGetVarsUsage()

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 8908 of file expr.c.

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

◆ SCIPexprtreeSimplify()

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.

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 8927 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(), SCIPrandomCreate(), SCIPrandomFree(), SCIPrandomGetReal(), and SCIPrelDiff().

◆ SCIPexprtreeAddExpr()

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 (or a copy of it) as children. If no root existed yet, then the root is set to the given expression (or a copy of it).

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

Definition at line 8982 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().

◆ SCIPexprtreeCheckCurvature()

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 9011 of file expr.c.

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

Referenced by checkCurvature().

◆ SCIPexprtreeSubstituteVars()

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.

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

Definition at line 9046 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().

◆ quadelemsQuickSort()

static void quadelemsQuickSort ( SCIP_QUADELEM elems,
int  start,
int  end 
)
static

quicksort an array of quadratic elements; pivot is the medial element (taken from scip/sorttpl.c)

Parameters
elemsarray to be sorted
startstarting index
endending index

Definition at line 9102 of file expr.c.

References h, QUADELEMS_ISBETTER, and QUADELEMS_SWAP.

Referenced by SCIPquadelemSort().

◆ SCIPquadelemSort()

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 9212 of file expr.c.

References quadelemsQuickSort().

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

◆ SCIPquadelemSortedFind()

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 9237 of file expr.c.

References FALSE, NULL, and TRUE.

Referenced by nlrowSearchQuadElem(), and SCIPnlpiOracleChgQuadCoefs().

◆ SCIPquadelemSqueeze()

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 9289 of file expr.c.

References SCIP_QuadElement::coef, NULL, and QUADELEMS_ISBETTER.

Referenced by createConstraint(), and SCIPnlpiOracleChgQuadCoefs().

◆ exprgraphNodeAddParent()

static SCIP_RETCODE exprgraphNodeAddParent ( BMS_BLKMEM blkmem,
SCIP_EXPRGRAPHNODE node,
SCIP_EXPRGRAPHNODE parent 
)
static

adds a parent to an expression graph node

Parameters
blkmemblock memory
nodeexpression graph node where to add a parent
parentparent node

Definition at line 9345 of file expr.c.

References SCIP_ExprGraphNode::depth, ensureBlockMemoryArraySize, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::parents, SCIP_ExprGraphNode::parentssize, SCIP_ExprGraphNode::parentssorted, SCIP_ExprGraphNode::pos, and SCIP_OKAY.

Referenced by exprgraphNodeAddChildren(), exprgraphNodeReplaceChild(), SCIPexprgraphAddNode(), and SCIPexprgraphReplaceVarByLinearSum().

◆ exprgraphNodeSortParents()

static void exprgraphNodeSortParents ( SCIP_EXPRGRAPHNODE node)
static

ensures that array of parents in a node is sorted

Parameters
nodeexpression graph node

Definition at line 9374 of file expr.c.

References SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::parents, SCIP_ExprGraphNode::parentssorted, SCIPsortPtr(), and TRUE.

Referenced by exprgraphNodeIsParent(), and exprgraphNodeRemoveParent().

◆ exprgraphNodeRemoveParent()

static SCIP_RETCODE exprgraphNodeRemoveParent ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE **  node,
SCIP_EXPRGRAPHNODE parent 
)
static

removes a parent from an expression graph node

If the node is not used and has no other parents, then it is freed.

Parameters
exprgraphexpression graph
nodeexpression graph node where to remove a parent, *node will be set to NULL
parentparent node to remove

Definition at line 9400 of file expr.c.

References SCIP_ExprGraphNode::depth, exprgraphNodeSortParents(), SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::nuses, SCIP_ExprGraphNode::pos, SCIP_CALL, SCIP_OKAY, SCIPexprgraphCaptureNode(), SCIPexprgraphReleaseNode(), and SCIPsortedvecFindPtr().

Referenced by exprgraphNodeRemovePolynomialDuplicateChildren(), exprgraphNodeReplaceChild(), exprgraphNodeSimplify(), SCIPexprgraphNodeSplitOffLinear(), and SCIPexprgraphReleaseNode().

◆ exprgraphNodeIsParent()

static SCIP_Bool exprgraphNodeIsParent ( SCIP_EXPRGRAPHNODE node,
SCIP_EXPRGRAPHNODE parent 
)
static

checks if a node is parent of a node

Parameters
nodeexpression graph node
parentparent to look for

Definition at line 9451 of file expr.c.

References SCIP_ExprGraphNode::depth, exprgraphNodeSortParents(), FALSE, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::parents, and SCIPsortedvecFindPtr().

Referenced by exprgraphFindParentByOperator(), and exprgraphNodeRemovePolynomialDuplicateChildren().

◆ exprgraphNodeAddChildren()

static SCIP_RETCODE exprgraphNodeAddChildren ( BMS_BLKMEM blkmem,
SCIP_EXPRGRAPHNODE node,
int  nexprs,
SCIP_EXPRGRAPHNODE **  exprs,
int *  childmap 
)
static

adds expression graph nodes to the array of children of a sum, product, linear, quadratic, or polynomial expression

For a sum or product expression, this corresponds to add additional summands and factors, resp. For a linear expression, this corresponds to add each expression with coefficient 1.0. For a quadratic or polynomial expression, only the children array may be enlarged, the expression itself remains the same.

It is assumed that node and all exprs are in the expression graph already. It is assumed that all expressions that are added have lower depth than node.

Parameters
blkmemblock memory
nodeexpression graph node
nexprsnumber of children to add
exprschildren nodes to add
childmaparray where to store mapping of indices from exprs to children array in node, or NULL if not of interest

Definition at line 9482 of file expr.c.

References BMSclearMemoryArray, BMSreallocBlockMemoryArray, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, exprgraphNodeAddParent(), FALSE, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprGraphNode::nchildren, NULL, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::pos, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_LINEAR, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_SUM, SCIP_OKAY, SCIP_Real, SCIP_ExprGraphNode::simplified, and TRUE.

Referenced by exprgraphNodeSimplify().

◆ exprgraphNodeReplaceChild()

static SCIP_RETCODE exprgraphNodeReplaceChild ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
SCIP_EXPRGRAPHNODE **  oldchild,
SCIP_EXPRGRAPHNODE newchild 
)
static

replaces a child node by another node

Assumes that both nodes represent the same expression. If this node was the last parent of oldchild and oldchild is not in use, then it is freed. newchild must have deeper depth than node.

Parameters
exprgraphexpression graph
nodepointer to expression graph node
oldchildchild node that should be replaced, it may be freed
newchildnode that should take position of oldchild

Definition at line 9583 of file expr.c.

References SCIP_ExprGraph::blkmem, exprgraphNodeAddParent(), exprgraphNodeRemoveParent(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.

Referenced by SCIPexprgraphMoveNodeParents(), and SCIPexprgraphSimplify().

◆ SCIP_DECL_SORTPTRCOMP() [3/3]

static SCIP_DECL_SORTPTRCOMP ( exprgraphConstNodeComp  )
static

comparison of SCIP_EXPRGRAPHNODE's that are of type SCIP_EXPR_CONST

A node is larger than another node, if their corresponding constants are related that way.

Definition at line 9633 of file expr.c.

References NULL, and SCIP_EXPR_CONST.

◆ exprgraphSortConstNodes()

static void exprgraphSortConstNodes ( SCIP_EXPRGRAPH exprgraph)
static

sort array of nodes that holds constants

Parameters
exprgraphexpression graph

Definition at line 9652 of file expr.c.

References SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssorted, SCIP_ExprGraph::nconsts, NULL, SCIPsortPtr(), and TRUE.

Referenced by exprgraphFindConstNodePos(), and SCIPexprgraphFindConstNode().

◆ exprgraphFindConstNodePos()

static SCIP_Bool exprgraphFindConstNodePos ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
int *  pos 
)
static

finds position of expression graph node corresponding to a constant in constnodes array

Parameters
exprgraphexpression graph
nodenode to search for
posbuffer to store position of node, if found

Definition at line 9668 of file expr.c.

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

Referenced by SCIPexprgraphReleaseNode().

◆ exprgraphCreateNode()

◆ exprgraphPrintNodeExpression()

static void exprgraphPrintNodeExpression ( SCIP_EXPRGRAPHNODE node,
SCIP_MESSAGEHDLR messagehdlr,
FILE *  file,
const char **  varnames,
SCIP_Bool  printchildrenbounds 
)
static

prints the expression corresponding to a node (not recursively)

< gaussian error function (1 operand)

< imaginary part of gaussian error function (1 operand)

Parameters
nodenode of expression graph
messagehdlrmessage handler
filefile to print to, or NULL for stdout
varnamesvariable names, or NULL for generic names
printchildrenboundswhether to print bounds of children

Definition at line 9767 of file expr.c.

References SCIP_ExprGraphNode::bounds, 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_ExprData_Monomial::exponents, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_Interval::inf, 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_ExprGraphNode::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_VARIDX, SCIP_Real, SCIPABORT, SCIPexpropGetName(), SCIPmessageFPrintInfo(), and SCIP_Interval::sup.

Referenced by exprgraphNodeSimplify(), exprgraphPrintNodeDot(), and SCIPexprgraphPrintNode().

◆ exprgraphPrintNodeDot()

static void exprgraphPrintNodeDot ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
SCIP_MESSAGEHDLR messagehdlr,
FILE *  file,
const char **  varnames 
)
static

prints a node of an expression graph

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

Definition at line 10023 of file expr.c.

References SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, exprgraphPrintNodeExpression(), FALSE, SCIP_Interval::inf, SCIP_ExprGraphNode::nchildren, NULL, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::pos, SCIP_EXPR_LAST, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_CHILDTIGHTENED, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENT, SCIP_Real, SCIPmessageFPrintInfo(), and SCIP_Interval::sup.

Referenced by SCIPexprgraphPrintDot().

◆ exprgraphNodeEval()

static SCIP_RETCODE exprgraphNodeEval ( SCIP_EXPRGRAPHNODE node,
SCIP_Real varvals 
)
static

◆ exprgraphNodeEvalWithChildren()

static SCIP_RETCODE exprgraphNodeEvalWithChildren ( SCIP_EXPRGRAPHNODE node,
SCIP_Real varvals 
)
static

evaluates node including subtree

Parameters
nodeexpression graph node
varvalsvalues for variables

Definition at line 10109 of file expr.c.

References SCIP_ExprGraphNode::children, exprgraphNodeEval(), SCIP_ExprGraphNode::nchildren, NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by exprgraphNodeSimplify().

◆ exprgraphNodeUpdateBounds()

static SCIP_RETCODE exprgraphNodeUpdateBounds ( SCIP_EXPRGRAPHNODE node,
SCIP_Real  infinity,
SCIP_Real  minstrength,
SCIP_Bool  parenttightenisinvalid 
)
static

◆ exprgraphNodePropagateBounds()

static void exprgraphNodePropagateBounds ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
SCIP_Real  infinity,
SCIP_Real  minstrength,
SCIP_Bool cutoff 
)
static

propagate bounds of a node into children by reverting the nodes expression

Parameters
exprgraphexpression graph
nodenode in expression graph with no parents
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 10224 of file expr.c.

References a, b, SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, 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_ExprGraphNode::enabled, SCIP_ExprData_Monomial::exponents, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_Interval::inf, 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_ExprGraphNode::op, SCIP_ExprGraphNode::pos, SCIP_ExprData_Quadratic::quadelems, SCIP_ALLOC_ABORT, SCIP_CALL_ABORT, 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_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENT, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENTFORCE, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENTRECENT, SCIP_Real, SCIPABORT, SCIPdebugMessage, SCIPdebugPrintf, SCIPexprgraphTightenNodeBounds(), SCIPintervalAdd(), SCIPintervalAddScalar(), SCIPintervalDiv(), SCIPintervalExp(), SCIPintervalGetRoundingMode(), SCIPintervalIsEmpty(), SCIPintervalIsEntire(), SCIPintervalLog(), SCIPintervalMul(), SCIPintervalMulScalar(), SCIPintervalNegateReal(), SCIPintervalPowerScalar(), SCIPintervalPowerScalarInverse(), SCIPintervalSet(), SCIPintervalSetBounds(), SCIPintervalSetEntire(), SCIPintervalSetRoundingMode(), SCIPintervalSetRoundingModeDownwards(), SCIPintervalSignPowerScalar(), SCIPintervalSolveBivariateQuadExpressionAllScalar(), SCIPintervalSolveUnivariateQuadExpression(), SCIPintervalSquare(), SCIPintervalSquareRoot(), SCIPintervalSub(), SCIPintervalSubScalar(), SCIP_Interval::sup, TRUE, and SCIP_ExprData_User::userdata.

Referenced by SCIPexprgraphPropagateNodeBounds().

◆ exprgraphNodeRemovePolynomialDuplicateChildren()

static SCIP_RETCODE exprgraphNodeRemovePolynomialDuplicateChildren ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node 
)
static

removes duplicate children in a polynomial expression node

Leaves NULL's in children array.

Parameters
exprgraphexpression graph
nodeexpression graph node

Definition at line 11333 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::data, exprgraphNodeIsParent(), exprgraphNodeRemoveParent(), FALSE, SCIP_ExprGraphNode::nchildren, NULL, SCIP_ExprGraphNode::op, polynomialdataApplyChildmap(), SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_POLYNOMIAL, SCIP_OKAY, and TRUE.

Referenced by exprgraphNodeSimplify().

◆ exprgraphNodeRemovePolynomialNullChildren()

static SCIP_RETCODE exprgraphNodeRemovePolynomialNullChildren ( BMS_BLKMEM blkmem,
SCIP_EXPRGRAPHNODE node 
)
static

eliminates NULL's in children array and shrinks it to actual size

Parameters
blkmemblock memory
nodeexpression graph node

Definition at line 11391 of file expr.c.

References BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, BMSreallocBlockMemoryArray, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::nchildren, NULL, SCIP_ExprGraphNode::op, polynomialdataApplyChildmap(), SCIP_ALLOC, SCIP_EXPR_POLYNOMIAL, and SCIP_OKAY.

Referenced by exprgraphNodeSimplify(), and SCIPexprgraphNodeSplitOffLinear().

◆ exprgraphNodeSimplify()

static SCIP_RETCODE exprgraphNodeSimplify ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
SCIP_MESSAGEHDLR messagehdlr,
SCIP_Real  eps,
int  maxexpansionexponent,
SCIP_Bool havechange 
)
static

aims at simplifying a node in an expression graph, assuming all children have been simplified

Converts node into polynomial, if possible and not constant.

Parameters
exprgraphexpression graph
nodeexpression graph node
messagehdlrmessage handler
epsthreshold, under which positive values are treat as 0
maxexpansionexponentmaximal exponent for which we still expand non-monomial polynomials
havechangeflag to set if the node has been changed

Definition at line 11460 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSclearMemoryArray, BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, SCIP_ExprData_Polynomial::constant, SCIP_ExprGraphNode::depth, ensureBlockMemoryArraySize, EPSISINT, SCIP_ExprData_Monomial::exponents, exprConvertToPolynomial(), exprgraphNodeAddChildren(), exprgraphNodeEvalWithChildren(), exprgraphNodeRemoveParent(), exprgraphNodeRemovePolynomialDuplicateChildren(), exprgraphNodeRemovePolynomialNullChildren(), exprgraphPrintNodeExpression(), FALSE, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, polynomialdataExpandMonomialFactor(), polynomialdataFree(), polynomialdataMergeMonomials(), pow(), SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_POLYNOMIAL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPdebug, SCIPdebugMessage, SCIPdebugPrintf, SCIPexprFindMonomialFactor(), SCIPexprMergeMonomialFactors(), SCIPmessagePrintInfo(), SCIPmessagePrintWarning(), SCIP_ExprData_Polynomial::sorted, SCIP_ExprData_Monomial::sorted, and TRUE.

Referenced by SCIPexprgraphSimplify().

◆ exprgraphNodeCreateExpr()

static SCIP_RETCODE exprgraphNodeCreateExpr ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
SCIP_EXPR **  expr,
int *  nexprvars,
int *  varidx 
)
static

creates an expression from a given node in an expression graph

Assembles mapping of variables from graph to tree.

Parameters
exprgraphexpression graph
nodeexpression graph node which expression should be created
exprbuffer to store pointer to created expression
nexprvarscurrent number of variables in expression
varidxcurrent mapping of variable indices from graph to expression

Definition at line 11790 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSfreeBlockMemoryArrayNull, SCIP_ExprGraphNode::children, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, SCIP_ExprGraphNode::data, SCIP_ExprData_User::evalcapability, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Polynomial::monomials, SCIP_ExprGraphNode::nchildren, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::op, SCIP_ExprData_Quadratic::quadelems, SCIP_ALLOC, SCIP_CALL, SCIP_ERROR, 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_OKAY, SCIP_Real, SCIPerrorMessage, SCIPexprCreate(), SCIPexprCreateLinear(), SCIPexprCreatePolynomial(), SCIPexprCreateQuadratic(), SCIPexprCreateUser(), TRUE, and SCIP_ExprData_User::userdata.

Referenced by SCIPexprgraphGetSeparableTrees(), SCIPexprgraphGetSumTrees(), and SCIPexprgraphGetTree().

◆ exprgraphNodeGetVarsUsage()

static void exprgraphNodeGetVarsUsage ( SCIP_EXPRGRAPHNODE node,
int *  varsusage 
)
static

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

Note
The function does not clear the array first, but only increases already existing counts.
Parameters
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 11977 of file expr.c.

References SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::nchildren, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_VARIDX.

Referenced by SCIPexprgraphGetSubtreeVarsUsage(), and SCIPexprgraphNodeSplitOffLinear().

◆ exprgraphNodeCheckSeparabilityComponent()

static void exprgraphNodeCheckSeparabilityComponent ( SCIP_EXPRGRAPHNODE node,
int *  compnr,
int  nchildcomps,
int *  childcomps,
int  nvars,
int *  varcomps 
)
static

checks whether a node can be put into a component when checking block separability of an expression

If a variable used by node is already in another component, components are merged and component number is updated.

Parameters
nodenode to which we assign a component
compnrcomponent number to assign, may be reduced if variables overlap
nchildcompsnumber of entries for which childcomps have been set already
childcompscomponent numbers of children
nvarsnumber of variables
varcompscomponent numbers of variables

Definition at line 12002 of file expr.c.

References SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::nchildren, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_VARIDX.

Referenced by SCIPexprgraphGetSeparableTrees().

◆ exprgraphEnsureDepth()

static SCIP_RETCODE exprgraphEnsureDepth ( SCIP_EXPRGRAPH exprgraph,
int  mindepth 
)
static

assert that expression graph has at least a given depth

Parameters
exprgraphbuffer to store pointer to expression graph
mindepthminimal depth that should be ensured

Definition at line 12063 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSclearMemoryArray, SCIP_ExprGraph::depth, ensureBlockMemoryArraySize3, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, SCIP_ExprGraph::nodessize, NULL, and SCIP_OKAY.

Referenced by exprgraphMoveNode(), SCIPexprgraphAddNode(), and SCIPexprgraphCreate().

◆ exprgraphRemoveVar()

static SCIP_RETCODE exprgraphRemoveVar ( SCIP_EXPRGRAPH exprgraph,
int  varidx 
)
static

remove a variable from the variables arrays, assuming that its node will be removed or converted next

Parameters
exprgraphexpression graph
varidxvariable index

Definition at line 12090 of file expr.c.

References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraph::nvars, SCIP_CALL, SCIP_OKAY, SCIPhashmapRemove(), SCIPhashmapSetImageInt(), SCIP_ExprGraph::userdata, SCIP_ExprGraph::varbounds, SCIP_ExprGraph::varidxs, SCIP_ExprGraph::varnodes, and SCIP_ExprGraph::vars.

Referenced by SCIPexprgraphReleaseNode(), and SCIPexprgraphReplaceVarByLinearSum().

◆ exprgraphMoveNode()

static SCIP_RETCODE exprgraphMoveNode ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
int  newdepth 
)
static

◆ exprgraphFindParentByOperator()

static SCIP_RETCODE exprgraphFindParentByOperator ( SCIP_EXPRGRAPH exprgraph,
int  nchildren,
SCIP_EXPRGRAPHNODE **  children,
SCIP_EXPROP  op,
SCIP_EXPROPDATA  opdata,
SCIP_EXPR **  exprchildren,
SCIP_EXPRGRAPHNODE **  parent 
)
static

given a list of children, tries to find a common parent that represents a given operator with the same given data

Parameters
exprgraphexpression graph
nchildrennumber of children
childrenchildren which parents to inspect
opoperator
opdataoperator data
exprchildrenchildren of expression to consider when modifying (reordering) operator data, or NULL
parentbuffer to store parent node if any is found, or NULL if none found

Definition at line 12239 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, SCIP_ExprGraphNode::data, exprgraphNodeIsParent(), SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprGraphNode::nparents, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprGraphNode::parents, polynomialdataApplyChildmap(), polynomialdataSortMonomials(), SCIP_ExprData_Quadratic::quadelems, SCIP_ALLOC, SCIP_ERROR, 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_OKAY, SCIP_Real, SCIPdebugMessage, SCIPerrorMessage, SCIPexprAreMonomialsEqual(), SCIPquadelemSort(), SCIPsortPtr(), SCIPsortPtrInt(), SCIPsortPtrPtrInt(), SCIPsortPtrPtrReal(), SCIPsortPtrPtrRealInt(), SCIPsortPtrReal(), SCIPsortPtrRealInt(), SCIP_ExprData_Quadratic::sorted, and TRUE.

Referenced by exprgraphAddExpr(), and SCIPexprgraphAddExprtreeSum().

◆ exprgraphAddExpr()

static SCIP_RETCODE exprgraphAddExpr ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPR expr,
void **  vars,
SCIP_Real params,
SCIP_EXPRGRAPHNODE **  exprnode,
SCIP_Bool exprnodeisnew 
)
static

adds an expression into an expression graph

Enables corresponding nodes.

Parameters
exprgraphexpression graph
exprexpression to add
varsvariables corresponding to VARIDX expressions
paramsparameter values
exprnodebuffer to store expression graph node corresponding to root of this expression
exprnodeisnewbuffer to indicate whether the node in *exprnode has been newly created for this expression (otherwise, expression was already in graph)

Definition at line 12707 of file expr.c.

References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_Expr::children, SCIP_Expr::data, exprgraphCreateNode(), exprgraphFindParentByOperator(), FALSE, SCIP_Expr::nchildren, NULL, SCIP_ExprGraph::nvars, SCIP_Expr::op, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_PARAM, SCIP_EXPR_VARIDX, SCIP_OKAY, SCIPdebugMessage, SCIPexprgraphAddConst(), SCIPexprgraphAddNode(), SCIPexprgraphAddVars(), TRUE, and SCIP_ExprGraph::vars.

Referenced by SCIPexprgraphAddExprtreeSum().

◆ exprgraphUpdateVarNodeBounds()

static void exprgraphUpdateVarNodeBounds ( SCIP_EXPRGRAPH exprgraph,
SCIP_Bool clearreverseprop,
SCIP_Bool boundchanged 
)
static

sets bounds in variable nodes to those stored in exprgraph's varbounds array

Parameters
exprgraphexpression graph
clearreversepropflag to set if we had reset bound tightenings from reverse propagation
boundchangedbuffer to store whether a variables bound has changes, compared to those stored in nodes

Definition at line 12839 of file expr.c.

References SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, FALSE, SCIP_Interval::inf, isLbBetter(), isUbBetter(), MAX, MIN, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::parents, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_CHILDTIGHTENED, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_Real, SCIPdebugMessage, SCIP_Interval::sup, TRUE, SCIP_ExprGraph::varbounds, and SCIP_ExprGraph::varnodes.

Referenced by SCIPexprgraphCheckCurvature(), and SCIPexprgraphPropagateVarBounds().

◆ SCIPexprgraphCaptureNode()

void SCIPexprgraphCaptureNode ( SCIP_EXPRGRAPHNODE node)

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

Parameters
nodeexpression graph node to capture

Definition at line 12952 of file expr.c.

References SCIP_ExprGraphNode::nuses, and SCIPdebugMessage.

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

◆ SCIPexprgraphIsNodeEnabled()

SCIP_Bool SCIPexprgraphIsNodeEnabled ( SCIP_EXPRGRAPHNODE node)

returns whether a node is currently enabled

Parameters
nodeexpression graph node to enable

Definition at line 12964 of file expr.c.

References SCIP_ExprGraphNode::enabled, and NULL.

Referenced by reformulate().

◆ SCIPexprgraphGetNodeNChildren()

int SCIPexprgraphGetNodeNChildren ( SCIP_EXPRGRAPHNODE node)

gets number of children of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 12974 of file expr.c.

References SCIP_ExprGraphNode::nchildren, and NULL.

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

◆ SCIPexprgraphGetNodeChildren()

SCIP_EXPRGRAPHNODE** SCIPexprgraphGetNodeChildren ( SCIP_EXPRGRAPHNODE node)

gets children of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 12984 of file expr.c.

References SCIP_ExprGraphNode::children, and NULL.

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

◆ SCIPexprgraphGetNodeNParents()

int SCIPexprgraphGetNodeNParents ( SCIP_EXPRGRAPHNODE node)

gets number of parents of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 12994 of file expr.c.

References SCIP_ExprGraphNode::nparents, and NULL.

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

◆ SCIPexprgraphGetNodeParents()

SCIP_EXPRGRAPHNODE** SCIPexprgraphGetNodeParents ( SCIP_EXPRGRAPHNODE node)

gets parents of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 13004 of file expr.c.

References NULL, and SCIP_ExprGraphNode::parents.

Referenced by reformMonomial().

◆ SCIPexprgraphGetNodeDepth()

int SCIPexprgraphGetNodeDepth ( SCIP_EXPRGRAPHNODE node)

gets depth of node in expression graph

Parameters
nodeexpression graph node

Definition at line 13014 of file expr.c.

References SCIP_ExprGraphNode::depth, and NULL.

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

◆ SCIPexprgraphGetNodePosition()

int SCIPexprgraphGetNodePosition ( SCIP_EXPRGRAPHNODE node)

gets position of node in expression graph at its depth level

Parameters
nodeexpression graph node

Definition at line 13024 of file expr.c.

References NULL, and SCIP_ExprGraphNode::pos.

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

◆ SCIPexprgraphGetNodeOperator()

SCIP_EXPROP SCIPexprgraphGetNodeOperator ( SCIP_EXPRGRAPHNODE node)

gets operator of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 13034 of file expr.c.

References NULL, and SCIP_ExprGraphNode::op.

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

◆ SCIPexprgraphGetNodeOperatorIndex()

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 13044 of file expr.c.

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

◆ SCIPexprgraphGetNodeOperatorReal()

SCIP_Real SCIPexprgraphGetNodeOperatorReal ( SCIP_EXPRGRAPHNODE node)

gives real belonging to a SCIP_EXPR_CONST operand

Parameters
nodeexpression graph node

Definition at line 13055 of file expr.c.

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

◆ SCIPexprgraphGetNodeVar()

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 13066 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().

◆ SCIPexprgraphGetNodeRealPowerExponent()

SCIP_Real SCIPexprgraphGetNodeRealPowerExponent ( SCIP_EXPRGRAPHNODE node)

gives exponent belonging to a SCIP_EXPR_REALPOWER expression

Parameters
nodeexpression graph node

Definition at line 13081 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().

◆ SCIPexprgraphGetNodeIntPowerExponent()

int SCIPexprgraphGetNodeIntPowerExponent ( SCIP_EXPRGRAPHNODE node)

gives exponent belonging to a SCIP_EXPR_INTPOWER expression

Parameters
nodeexpression graph node

Definition at line 13092 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().

◆ SCIPexprgraphGetNodeSignPowerExponent()

SCIP_Real SCIPexprgraphGetNodeSignPowerExponent ( SCIP_EXPRGRAPHNODE node)

gives exponent belonging to a SCIP_EXPR_SIGNPOWER expression

Parameters
nodeexpression graph node

Definition at line 13103 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().

◆ SCIPexprgraphGetNodeLinearCoefs()

SCIP_Real* SCIPexprgraphGetNodeLinearCoefs ( SCIP_EXPRGRAPHNODE node)

gives linear coefficients belonging to a SCIP_EXPR_LINEAR expression

Parameters
nodeexpression graph node

Definition at line 13114 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().

◆ SCIPexprgraphGetNodeLinearConstant()

SCIP_Real SCIPexprgraphGetNodeLinearConstant ( SCIP_EXPRGRAPHNODE node)

gives constant belonging to a SCIP_EXPR_LINEAR expression

Parameters
nodeexpression graph node

Definition at line 13125 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().

◆ SCIPexprgraphGetNodeQuadraticConstant()

SCIP_Real SCIPexprgraphGetNodeQuadraticConstant ( SCIP_EXPRGRAPHNODE node)

gives constant belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
nodeexpression graph node

Definition at line 13137 of file expr.c.

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

Referenced by SCIP_DECL_NONLINCONSUPGD().

◆ SCIPexprgraphGetNodeQuadraticLinearCoefs()

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 13149 of file expr.c.

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

Referenced by SCIP_DECL_NONLINCONSUPGD().

◆ SCIPexprgraphGetNodeQuadraticQuadElements()

SCIP_QUADELEM* SCIPexprgraphGetNodeQuadraticQuadElements ( SCIP_EXPRGRAPHNODE node)

gives quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
nodeexpression graph node

Definition at line 13161 of file expr.c.

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

Referenced by SCIP_DECL_NONLINCONSUPGD().

◆ SCIPexprgraphGetNodeQuadraticNQuadElements()

int SCIPexprgraphGetNodeQuadraticNQuadElements ( SCIP_EXPRGRAPHNODE node)

gives number of quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression

Parameters
nodeexpression graph node

Definition at line 13173 of file expr.c.

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

Referenced by SCIP_DECL_NONLINCONSUPGD().

◆ SCIPexprgraphGetNodePolynomialMonomials()

SCIP_EXPRDATA_MONOMIAL** SCIPexprgraphGetNodePolynomialMonomials ( SCIP_EXPRGRAPHNODE node)

gives the monomials belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
nodeexpression graph node

Definition at line 13185 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().

◆ SCIPexprgraphGetNodePolynomialNMonomials()

int SCIPexprgraphGetNodePolynomialNMonomials ( SCIP_EXPRGRAPHNODE node)

gives the number of monomials belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
nodeexpression graph node

Definition at line 13197 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().

◆ SCIPexprgraphGetNodePolynomialConstant()

SCIP_Real SCIPexprgraphGetNodePolynomialConstant ( SCIP_EXPRGRAPHNODE node)

gives the constant belonging to a SCIP_EXPR_POLYNOMIAL expression

Parameters
nodeexpression graph node

Definition at line 13209 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().

◆ SCIPexprgraphGetNodePolynomialMonomialCurvature()

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

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 13224 of file expr.c.

References BMSallocMemoryArray, BMSfreeMemoryArrayNull, 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_ALLOC_TERMINATE, SCIP_EXPR_POLYNOMIAL, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_EXPRCURV_LINEAR, SCIP_EXPRESSION_MAXCHILDEST, SCIP_OKAY, SCIPexprcurvMonomial(), SCIPexprcurvMultiply(), and SCIPintervalIsEmpty().

Referenced by reformulate().

◆ SCIPexprgraphGetNodeUserData()

SCIP_USEREXPRDATA* SCIPexprgraphGetNodeUserData ( SCIP_EXPRGRAPHNODE node)

gives the user data belonging to a SCIP_EXPR_USER expression

Definition at line 13304 of file expr.c.

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

◆ SCIPexprgraphHasNodeUserEstimator()

SCIP_Bool SCIPexprgraphHasNodeUserEstimator ( SCIP_EXPRGRAPHNODE node)

indicates whether a user expression has the estimator callback defined

Definition at line 13316 of file expr.c.

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

◆ SCIPexprgraphGetNodeBounds()

SCIP_INTERVAL SCIPexprgraphGetNodeBounds ( SCIP_EXPRGRAPHNODE node)

gets bounds of a node in an expression graph

Parameters
nodeexpression graph node

Definition at line 13328 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().

◆ SCIPexprgraphGetNodeVal()

SCIP_Real SCIPexprgraphGetNodeVal ( SCIP_EXPRGRAPHNODE node)

gets value of expression associated to node from last evaluation call

Parameters
nodeexpression graph node

Definition at line 13338 of file expr.c.

References NULL, and SCIP_ExprGraphNode::value.

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

◆ SCIPexprgraphGetNodeCurvature()

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 13348 of file expr.c.

References SCIP_ExprGraphNode::curv, and NULL.

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

◆ SCIPexprgraphCreateNode()

◆ SCIPexprgraphCreateNodeLinear()

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 13441 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().

◆ SCIPexprgraphCreateNodeQuadratic()

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 13467 of file expr.c.

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

Referenced by reformulate().

◆ SCIPexprgraphCreateNodePolynomial()

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 13493 of file expr.c.

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

Referenced by reformulate().

◆ SCIPexprgraphNodePolynomialAddMonomials()

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 13518 of file expr.c.

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

◆ SCIPexprgraphCreateNodeUser()

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_DECL_USEREXPRPRINT((*print))   
)

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 13537 of file expr.c.

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

◆ SCIPexprgraphNodeSplitOffLinear()

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 13591 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().

◆ SCIPexprgraphMoveNodeParents()

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 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 14403 of file expr.c.

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

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

◆ SCIPexprgraphReleaseNode()

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; similarly for constants.

Parameters
exprgraphexpression graph
nodeexpression graph node to release

Definition at line 14435 of file expr.c.

References SCIP_ExprGraph::blkmem, SCIP_ExprGraphNode::children, SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssorted, SCIP_ExprGraph::depth, exprgraphFindConstNodePos(), exprgraphNodeRemoveParent(), exprgraphRemoveVar(), FALSE, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraph::nconsts, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, NULL, SCIP_ExprGraphNode::parentssorted, 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().

◆ SCIPexprgraphFreeNode()

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 14529 of file expr.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, and NULL.

Referenced by SCIPexprgraphReleaseNode().

◆ SCIPexprgraphEnableNode()

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 14554 of file expr.c.

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

Referenced by SCIP_DECL_CONSENABLE(), and SCIPexprgraphEnableNode().

◆ SCIPexprgraphDisableNode()

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 14581 of file expr.c.

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

Referenced by SCIP_DECL_CONSDISABLE(), and SCIPexprgraphDisableNode().

◆ SCIPexprgraphHasNodeSibling()

SCIP_Bool SCIPexprgraphHasNodeSibling (