|
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
expr.c File Reference Detailed Descriptionmethods for expressions, expression trees, expression graphs, and related 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/pub_message.h"Go to the source code of this file.
Macro Definition Documentation
estimate on maximal number of children Definition at line 39 of file expr.c. Referenced by exprgraphNodeEval(), exprgraphNodeUpdateBounds(), SCIPexprCheckCurvature(), SCIPexprEval(), SCIPexprEvalInt(), SCIPexprgraphGetNodePolynomialMonomialCurvature(), and SCIPexprgraphUpdateNodeBoundsCurvature().
sign of a value (-1 or +1) 0.0 has sign +1 Definition at line 45 of file expr.c. Referenced by SCIP_DECL_EXPREVAL().
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 BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum) Definition: memory.h:390 ensures that a block memory array has at least a given size if cursize is 0, then *array1 can be NULL Definition at line 51 of file expr.c. Referenced by exprgraphMoveNode(), exprgraphNodeAddParent(), exprgraphNodeSimplify(), polynomialdataEnsureMonomialsSize(), SCIPexprgraphAddConst(), SCIPexprgraphAddNode(), SCIPexprgraphAddVars(), SCIPexprgraphReplaceVarByLinearSum(), and SCIPexprgraphSimplify().
Value:
do { \
int __newsize; \
assert((blkmem) != NULL); \
if( *(cursize) >= (minsize) ) \
break; \
__newsize = calcGrowSize(minsize); \
assert(__newsize >= (minsize)); \
SCIP_ALLOC( BMSreallocBlockMemoryArray(blkmem, array3, *(cursize), __newsize) ); \
*(cursize) = __newsize; \
} while( FALSE )
#define BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum) Definition: memory.h:390 ensures that three block memory arrays have at least a given size if cursize is 0, then arrays can be NULL Definition at line 86 of file expr.c. Referenced by exprgraphEnsureDepth(), SCIPexprgraphAddVars(), SCIPexprgraphCreate(), and SCIPexprgraphReplaceVarByLinearSum().
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 8430 of file expr.c. Referenced by quadelemsQuickSort(), and SCIPquadelemSqueeze().
Value:
swaps two quadratic elements Definition at line 8433 of file expr.c. Referenced by quadelemsQuickSort(). Function Documentation
calculate memory size for dynamically allocated arrays (copied from scip/set.c)
Definition at line 105 of file expr.c. Referenced by exprsimplifyFlattenPolynomials(), and monomialdataEnsureFactorsSize().
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)
Definition at line 132 of file expr.c. References EPSGT, FALSE, MAX, MIN, REALABS, and SCIP_Real. Referenced by exprgraphNodeUpdateBounds(), exprgraphUpdateVarNodeBounds(), SCIPexprgraphTightenNodeBounds(), and SCIPexprgraphUpdateNodeBoundsCurvature().
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)
Definition at line 152 of file expr.c. References EPSLT, FALSE, MAX, MIN, REALABS, and SCIP_Real. Referenced by exprgraphNodeUpdateBounds(), exprgraphUpdateVarNodeBounds(), SCIPexprgraphTightenNodeBounds(), and SCIPexprgraphUpdateNodeBoundsCurvature().
gives curvature for a sum of two functions with given curvature
Definition at line 188 of file expr.c. Referenced by checkCurvature(), and SCIP_DECL_EXPRCURV().
gives the curvature for the negation of a function with given curvature
Definition at line 197 of file expr.c. References SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIPABORT, and SCIPerrorMessage. Referenced by reformulate(), SCIP_DECL_EXPRCURV(), SCIPexprcurvMonomial(), and SCIPexprcurvMultiply().
gives curvature for a functions with given curvature multiplied by a constant factor
Definition at line 223 of file expr.c. References SCIP_EXPRCURV_LINEAR, and SCIPexprcurvNegate(). Referenced by checkCurvature(), reformulate(), SCIP_DECL_EXPRCURV(), SCIPexprcurvMonomial(), and SCIPexprgraphGetNodePolynomialMonomialCurvature().
gives curvature for base^exponent for given bounds and curvature of base-function and constant exponent
Definition at line 236 of file expr.c. References EPSISINT, SCIP_Interval::inf, SCIP_Bool, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_Real, SCIPexprcurvPower(), SCIPintervalSetBounds(), sign(), and SCIP_Interval::sup. Referenced by reformulate(), SCIP_DECL_EXPRCURV(), SCIPexprcurvMonomial(), and SCIPexprcurvPower().
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.
Definition at line 344 of file expr.c. References EPSGE, EPSISINT, EPSLE, FALSE, NULL, SCIP_Bool, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_Real, SCIPexprcurvMultiply(), SCIPexprcurvNegate(), SCIPexprcurvPower(), and TRUE. Referenced by SCIP_DECL_EXPRCURV(), and SCIPexprgraphGetNodePolynomialMonomialCurvature().
gives name as string for a curvature
Definition at line 457 of file expr.c. References curvnames, and SCIP_EXPRCURV_LINEAR. Referenced by checkCurvature(), reformEnsureChildrenMinCurvature(), reformulate(), and registerBranchingVariables().
creates SCIP_EXPRDATA_QUADRATIC data structure from given quadratic elements
Definition at line 473 of file expr.c. References BMSallocBlockMemory, BMSduplicateBlockMemoryArray, NULL, SCIP_ALLOC, and SCIP_OKAY. Referenced by SCIP_DECL_EXPRCOPYDATA(), SCIPexprCreateQuadratic(), and SCIPexprgraphCreateNodeQuadratic().
sorts quadratic elements in a SCIP_EXPRDATA_QUADRATIC data structure
Definition at line 511 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().
compares two monomials gives 0 if monomials are equal Definition at line 547 of file expr.c. References SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Monomial::nfactors, NULL, and SCIPexprSortMonomialFactors().
ensures that the factors arrays of a monomial have at least a given size
Definition at line 586 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().
creates SCIP_EXPRDATA_POLYNOMIAL data structure from given monomials
Definition at line 611 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().
creates a copy of a SCIP_EXPRDATA_POLYNOMIAL data structure
Definition at line 658 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().
frees a SCIP_EXPRDATA_POLYNOMIAL data structure
Definition at line 695 of file expr.c. References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, NULL, and SCIPexprFreeMonomial(). Referenced by exprgraphNodeSimplify(), exprsimplifyFlattenPolynomials(), exprUnconvertPolynomial(), polynomialdataExpandMonomialFactor(), polynomialdataPower(), and SCIP_DECL_EXPRFREEDATA().
ensures that the monomials array of a polynomial has at least a given size
Definition at line 724 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().
adds an array of monomials to a polynomial
Definition at line 741 of file expr.c. References BMScopyMemoryArray, SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Polynomial::monomialssize, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, polynomialdataEnsureMonomialsSize(), SCIP_CALL, SCIP_OKAY, SCIPexprCreateMonomial(), and SCIP_ExprData_Polynomial::sorted. Referenced by exprConvertToPolynomial(), polynomialdataExpandMonomialFactor(), polynomialdataMultiplyByPolynomial(), SCIPexprAddMonomials(), and SCIPexprgraphNodePolynomialAddMonomials().
ensures that monomials of a polynomial are sorted
Definition at line 783 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().
merges monomials that differ only in coefficient into a single monomial Eliminates monomials with coefficient between -eps and eps.
Definition at line 816 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().
multiplies each summand of a polynomial by a given constant
Definition at line 908 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().
multiplies each summand of a polynomial by a given monomial
Definition at line 938 of file expr.c. References SCIP_ExprData_Monomial::coef, SCIP_ExprData_Polynomial::constant, FALSE, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, polynomialdataEnsureMonomialsSize(), polynomialdataMultiplyByConstant(), SCIP_CALL, SCIP_OKAY, SCIPexprCreateMonomial(), SCIPexprMultiplyMonomialByMonomial(), and SCIP_ExprData_Polynomial::sorted. Referenced by polynomialdataExpandMonomialFactor(), polynomialdataMultiplyByPolynomial(), and SCIPexprMultiplyPolynomialByMonomial().
multiplies a polynomial by a polynomial Factors need to be different.
Definition at line 982 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().
takes a power of a polynomial Exponent needs to be an integer, polynomial needs to be a monomial, if exponent is negative.
Definition at line 1071 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().
applies a mapping of child indices to the indices used in polynomial monomials
Definition at line 1141 of file expr.c. References SCIP_ExprData_Monomial::childidxs, FALSE, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, SCIP_ExprData_Polynomial::sorted, and SCIP_ExprData_Monomial::sorted. Referenced by exprgraphFindParentByOperator(), exprgraphNodeRemovePolynomialDuplicateChildren(), exprgraphNodeRemovePolynomialNullChildren(), exprsimplifyRemoveDuplicatePolynomialChildren(), exprsimplifyRemovePolynomialNullChildren(), and polynomialdataExpandMonomialFactor().
replaces a factor in a monomial by a polynomial and expands the result
Definition at line 1170 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().
a default implementation of expression interval evaluation that always gives a correct result Definition at line 1392 of file expr.c. References SCIP_OKAY, and SCIPintervalSetEntire().
a default implementation of expression curvature check that always gives a correct result Definition at line 1401 of file expr.c. References SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.
curvature for EXPR_VAR Definition at line 1434 of file expr.c. References NULL, SCIP_EXPRCURV_LINEAR, and SCIP_OKAY.
interval evaluation for EXPR_CONST Definition at line 1456 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalSet().
curvature for EXPR_CONST Definition at line 1467 of file expr.c. References NULL, SCIP_EXPRCURV_LINEAR, and SCIP_OKAY.
interval evaluation for EXPR_PARAM Definition at line 1490 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalSet().
curvature for EXPR_PARAM Definition at line 1502 of file expr.c. References NULL, SCIP_EXPRCURV_LINEAR, and SCIP_OKAY.
interval evaluation for EXPR_PLUS Definition at line 1525 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalAdd().
curvature for EXPR_PLUS Definition at line 1537 of file expr.c. References NULL, SCIP_OKAY, and SCIPexprcurvAdd().
interval evaluation for EXPR_MINUS Definition at line 1561 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalSub().
curvature for EXPR_MINUS Definition at line 1573 of file expr.c. References NULL, SCIP_OKAY, SCIPexprcurvAdd(), and SCIPexprcurvNegate().
interval evaluation for EXPR_MUL Definition at line 1597 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalMul().
curvature for EXPR_MUL Definition at line 1609 of file expr.c. References NULL, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, and SCIPexprcurvMultiply().
interval evaluation for EXPR_DIV Definition at line 1646 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalDiv().
curvature for EXPR_DIV Definition at line 1658 of file expr.c. References NULL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, and SCIPexprcurvMultiply().
interval evaluation for EXPR_SQUARE Definition at line 1714 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalSquare().
curvature for EXPR_SQUARE Definition at line 1726 of file expr.c. References NULL, SCIP_OKAY, and SCIPexprcurvPower().
interval evaluation for EXPR_SQRT Definition at line 1751 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalSquareRoot().
curvature for EXPR_SQRT Definition at line 1763 of file expr.c. References NULL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.
interval evaluation for EXPR_REALPOWER Definition at line 1794 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalPowerScalar().
curvature for EXPR_REALPOWER Definition at line 1806 of file expr.c. References NULL, SCIP_OKAY, and SCIPexprcurvPower().
interval evaluation for EXPR_SIGNPOWER Definition at line 1891 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalSignPowerScalar().
curvature for EXPR_SIGNPOWER Definition at line 1903 of file expr.c. References NULL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIPexprcurvNegate(), SCIPexprcurvPower(), and SCIPintervalSetBounds().
interval evaluation for EXPR_EXP Definition at line 1958 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalExp().
curvature for EXPR_EXP Definition at line 1970 of file expr.c. References NULL, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.
interval evaluation for EXPR_LOG Definition at line 2000 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalLog().
curvature for EXPR_LOG Definition at line 2012 of file expr.c. References NULL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.
interval evaluation for EXPR_SIN Definition at line 2042 of file expr.c. References NULL, SCIP_OKAY, SCIPerrorMessage, and SCIPintervalSetBounds().
interval evaluation for EXPR_COS Definition at line 2071 of file expr.c. References NULL, SCIP_OKAY, SCIPerrorMessage, and SCIPintervalSetBounds().
interval evaluation for EXPR_MIN Definition at line 2155 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalMin().
curvature for EXPR_MIN Definition at line 2167 of file expr.c. References NULL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.
interval evaluation for EXPR_MAX Definition at line 2198 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalMax().
curvature for EXPR_MAX Definition at line 2210 of file expr.c. References NULL, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.
interval evaluation for EXPR_ABS Definition at line 2240 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalAbs().
curvature for EXPR_ABS Definition at line 2252 of file expr.c. References NULL, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, and SCIPexprcurvMultiply().
interval evaluation for EXPR_SIGN Definition at line 2289 of file expr.c. References NULL, SCIP_OKAY, and SCIPintervalSign().
curvature for EXPR_SIGN Definition at line 2301 of file expr.c. References NULL, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, and SCIP_OKAY.
interval evaluation for EXPR_SUM Definition at line 2333 of file expr.c. References NULL, SCIP_OKAY, SCIPintervalAdd(), and SCIPintervalSet().
curvature for EXPR_SUM Definition at line 2350 of file expr.c. References NULL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, and SCIPexprcurvAdd().
interval evaluation for EXPR_PRODUCT Definition at line 2383 of file expr.c. References NULL, SCIP_OKAY, SCIPintervalMul(), and SCIPintervalSet().
curvature for EXPR_PRODUCT Definition at line 2400 of file expr.c. References FALSE, NULL, SCIP_Bool, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPexprcurvMultiply(), and TRUE.
interval evaluation for EXPR_LINEAR Definition at line 2466 of file expr.c. References NULL, SCIP_OKAY, SCIP_Real, SCIPintervalAddScalar(), and SCIPintervalScalprodScalars().
curvature for EXPR_LINEAR Definition at line 2480 of file expr.c. References NULL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIP_Real, SCIPexprcurvAdd(), and SCIPexprcurvMultiply().
expression data copy for EXPR_LINEAR Definition at line 2501 of file expr.c. References BMSduplicateBlockMemoryArray, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIP_Real.
expression data free for EXPR_LINEAR Definition at line 2519 of file expr.c. References BMSfreeBlockMemoryArray, NULL, and SCIP_Real.
point evaluation for EXPR_QUADRATIC Definition at line 2534 of file expr.c. References SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprData_Quadratic::quadelems, SCIP_OKAY, and SCIP_Real.
interval evaluation for EXPR_QUADRATIC Definition at line 2571 of file expr.c. References SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprData_Quadratic::quadelems, quadraticdataSort(), SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPintervalAdd(), SCIPintervalAddScalar(), SCIPintervalMulScalar(), SCIPintervalQuad(), SCIPintervalQuadBivar(), and SCIPintervalSet().
curvature for EXPR_QUADRATIC Definition at line 2698 of file expr.c. References SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprData_Quadratic::quadelems, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPexprcurvAdd(), SCIPexprcurvMultiply(), and SCIPexprcurvPower().
expression data copy for EXPR_QUADRATIC Definition at line 2766 of file expr.c. References SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprData_Quadratic::quadelems, quadraticdataCreate(), SCIP_CALL, and SCIP_OKAY.
expression data free for EXPR_QUADRATIC Definition at line 2784 of file expr.c. References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Quadratic::nquadelems, NULL, and SCIP_ExprData_Quadratic::quadelems.
point evaluation for EXPR_POLYNOMIAL Definition at line 2810 of file expr.c. References SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, SCIP_ExprData_Polynomial::constant, SCIP_ExprData_Monomial::exponents, log(), SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, pow(), SCIP_OKAY, SCIP_Real, and sqrt().
interval evaluation for EXPR_POLYNOMIAL Definition at line 2903 of file expr.c. References SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, SCIP_ExprData_Polynomial::constant, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, SCIP_OKAY, SCIP_Real, SCIPintervalAdd(), SCIPintervalDiv(), SCIPintervalIsEmpty(), SCIPintervalIsEntire(), SCIPintervalMul(), SCIPintervalPowerScalar(), SCIPintervalSet(), SCIPintervalSetEmpty(), SCIPintervalSquare(), and SCIPintervalSquareRoot().
curvature for EXPR_POLYNOMIAL Definition at line 2997 of file expr.c. References 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_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIPexprcurvAdd(), SCIPexprcurvMonomial(), and SCIPexprcurvMultiply().
expression data free for EXPR_POLYNOMIAL Definition at line 3051 of file expr.c. References NULL, and polynomialdataFree().
gives the name of an operand as string
Definition at line 3125 of file expr.c. References SCIP_EXPR_LAST. Referenced by exprgraphNodeUpdateBounds(), exprgraphPrintNodeExpression(), printExpr(), printRowNl(), reformulate(), SCIPexprgraphNodeSplitOffLinear(), SCIPexprgraphReleaseNode(), SCIPexprgraphUpdateNodeBoundsCurvature(), and SCIPwritePip().
gives the number of children of a simple operand
Definition at line 3135 of file expr.c. References SCIP_EXPR_LAST.
creates an expression Note, that the expression is allocated but for the children only the pointer is copied.
Definition at line 3154 of file expr.c. References BMSallocBlockMemory, SCIP_Expr::data, NULL, SCIP_ALLOC, and SCIP_OKAY. Referenced by SCIPexprCreate(), SCIPexprCreateLinear(), SCIPexprCreatePolynomial(), and SCIPexprCreateQuadratic().
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.
Definition at line 3185 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_ERROR, 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_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_OKAY, SCIP_Real, SCIPerrorMessage, SCIPexprAddMonomialFactors(), SCIPexprCreateMonomial(), SCIPexprFreeMonomial(), and TRUE. Referenced by exprgraphNodeSimplify(), and exprsimplifyConvertToPolynomials().
converts polynomial expression back into simpler expression, if possible
Definition at line 3625 of file expr.c. References BMSallocBlockMemory, BMSallocBlockMemoryArray, BMSclearMemoryArray, SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, EPSISINT, EPSROUND, SCIP_ExprData_Monomial::exponents, FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, MAX, MIN, SCIP_ExprData_Polynomial::monomials, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, polynomialdataFree(), polynomialdataMergeMonomials(), SCIP_ExprData_Quadratic::quadelems, SCIP_ALLOC, SCIP_EXPR_DEGREEINFINITY, SCIP_EXPR_DIV, SCIP_EXPR_INTPOWER, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_OKAY, SCIP_Real, SCIP_ExprData_Quadratic::sorted, and TRUE. Referenced by exprsimplifyUnconvertPolynomials(), and SCIPexprgraphSimplify().
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.
Definition at line 4003 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().
converts expressions into polynomials, where possible and obvious
Definition at line 4122 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().
removes duplicate children in a polynomial expression Leaves NULL's in children array.
Definition at line 4146 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().
eliminates NULL's in children array and shrinks it to actual size
Definition at line 4200 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().
checks which children are still in use and frees those which are not
Definition at line 4266 of file expr.c. References BMSallocBlockMemoryArray, BMSclearMemoryArray, BMSfreeBlockMemoryArray, SCIP_ExprData_Monomial::childidxs, SCIP_Expr::children, SCIP_Expr::data, SCIP_ExprData_Polynomial::monomials, SCIP_Expr::nchildren, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_OKAY, SCIPexprFreeDeep(), and TRUE. Referenced by exprsimplifyFlattenPolynomials().
flattens polynomials in polynomials, check for constants in non-polynomials expressions exprsimplifyConvertToPolynomials should have been called before to eliminate simple polynomial operands.
Definition at line 4317 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_ERROR, 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_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_OKAY, SCIP_Real, SCIPdebug, SCIPdebugMessage, SCIPdebugPrintf, SCIPerrorMessage, SCIPexprEval(), SCIPexprFindMonomialFactor(), SCIPexprFreeDeep(), SCIPexprGetNChildren(), SCIPexprGetNMonomials(), SCIPexprGetOperator(), SCIPexprGetOpReal(), SCIPexprMergeMonomials(), SCIPexprPrint(), SCIPmessagePrintWarning(), SCIP_ExprData_Polynomial::sorted, SCIP_ExprData_Monomial::sorted, and TRUE. Referenced by SCIPexprSimplify().
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.
Definition at line 4646 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().
converts polynomial expressions back into simpler expressions, where possible
Definition at line 4747 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().
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.
Definition at line 4781 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(), and SCIPhashtableRetrieve(). Referenced by exprParse().
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.
Definition at line 4874 of file expr.c. References SCIP_OKAY, SCIP_READERROR, and SCIPerrorMessage. Referenced by exprParse().
parses an expression from a string
Definition at line 4908 of file expr.c. References EPSISINT, exprparseFindClosingParenthesis(), exprparseReadVariable(), NULL, 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_MUL, SCIP_EXPR_REALPOWER, SCIP_EXPR_SIN, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_TAN, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPdebug, SCIPdebugMessage, SCIPerrorMessage, SCIPexprAdd(), SCIPexprCreate(), SCIPexprGetOperator(), SCIPexprGetOpReal(), SCIPexprMulConstant(), SCIPexprPrint(), SCIPmessagePrintInfo(), and SCIPstrToRealValue(). Referenced by SCIPexprParse().
gives operator of expression
Definition at line 5350 of file expr.c. References NULL, and SCIP_Expr::op. Referenced by eval(), exprIsNonSmooth(), exprParse(), exprsimplifyFlattenPolynomials(), exprsimplifyRemoveDuplicatePolynomialChildren(), exprsimplifyRemovePolynomialNullChildren(), exprsimplifySeparateLinearFromPolynomial(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), getLinearAndQuadraticCoefs(), initSepaDataCreateVred(), needAlwaysRetape(), printExpr(), printRowNl(), readConstraints(), readExpression(), readObjective(), SCIPexprAdd(), SCIPexprMulConstant(), and SCIPwritePip().
gives number of children of an expression
Definition at line 5360 of file expr.c. References SCIP_Expr::nchildren, and NULL. Referenced by eval(), exprIsNonSmooth(), exprsimplifyFlattenPolynomials(), exprsimplifySeparateLinearFromPolynomial(), getLinearAndQuadraticCoefs(), needAlwaysRetape(), printExpr(), printRowNl(), readObjective(), SCIPexprAdd(), SCIPexprMulConstant(), and SCIPwritePip(). gives pointer to array with children of an expression
Definition at line 5370 of file expr.c. References SCIP_Expr::children, and NULL. Referenced by eval(), exprIsNonSmooth(), getLinearAndQuadraticCoefs(), needAlwaysRetape(), printExpr(), printRowNl(), readObjective(), SCIPexprAdd(), and SCIPwritePip().
gives index belonging to a SCIP_EXPR_VARIDX or SCIP_EXPR_PARAM operand
Definition at line 5380 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, SCIP_EXPR_PARAM, and SCIP_EXPR_VARIDX. Referenced by eval(), exprsimplifySeparateLinearFromPolynomial(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), and readObjective(). gives real belonging to a SCIP_EXPR_CONST operand
Definition at line 5391 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_CONST. Referenced by eval(), exprParse(), exprsimplifyFlattenPolynomials(), printExpr(), printRowNl(), readExpression(), SCIPexprAdd(), and SCIPexprMulConstant().
gives void* belonging to a complex operand
Definition at line 5402 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_SUM. gives exponent belonging to a SCIP_EXPR_REALPOWER expression
Definition at line 5413 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_REALPOWER. Referenced by eval(), printExpr(), printRowNl(), and SCIPwritePip().
gives exponent belonging to a SCIP_EXPR_INTPOWER expression
Definition at line 5424 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_INTPOWER. Referenced by eval(), printExpr(), printRowNl(), and SCIPwritePip(). gives exponent belonging to a SCIP_EXPR_SIGNPOWER expression
Definition at line 5435 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_SIGNPOWER. Referenced by printExpr(). gives linear coefficients belonging to a SCIP_EXPR_LINEAR expression
Definition at line 5446 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, SCIP_EXPR_LINEAR, and SCIP_Real. Referenced by eval(), printExpr(), printRowNl(), and SCIPexprAdd(). gives constant belonging to a SCIP_EXPR_LINEAR expression
Definition at line 5459 of file expr.c. References SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_EXPR_LINEAR, and SCIP_Real. Referenced by eval(), printExpr(), printRowNl(), and SCIPexprAdd().
gives quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression
Definition at line 5472 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_QUADRATIC. Referenced by eval(), printExpr(), and printRowNl(). gives constant belonging to a SCIP_EXPR_QUADRATIC expression
Definition at line 5484 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_QUADRATIC. Referenced by eval(), printExpr(), and printRowNl(). gives linear coefficients belonging to a SCIP_EXPR_QUADRATIC expression can be NULL if all coefficients are 0.0
Definition at line 5497 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_QUADRATIC. Referenced by eval(), printExpr(), and printRowNl().
gives number of quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression
Definition at line 5509 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_QUADRATIC. Referenced by eval(), printExpr(), and printRowNl().
gives the monomials belonging to a SCIP_EXPR_POLYNOMIAL expression
Definition at line 5521 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().
gives the number of monomials belonging to a SCIP_EXPR_POLYNOMIAL expression
Definition at line 5533 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(). gives the constant belonging to a SCIP_EXPR_POLYNOMIAL expression
Definition at line 5545 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_POLYNOMIAL. Referenced by eval(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), and readObjective().
gets coefficient of a monomial
Definition at line 5557 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().
gets number of factors of a monomial
Definition at line 5567 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().
gets indices of children corresponding to factors of a monomial
Definition at line 5577 of file expr.c. References SCIP_ExprData_Monomial::childidxs, and NULL. Referenced by eval(), getLinearAndQuadraticCoefs(), printExpr(), printRowNl(), readObjective(), and reformulate().
gets exponents in factors of a monomial
Definition at line 5587 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().
creates a simple expression
Definition at line 5597 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_VARIDX, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, and SCIPerrorMessage. Referenced by createConsFromQuadTerm(), createExprtreeFromMonomial(), createNlRow(), exprgraphNodeCreateExpr(), exprParse(), exprparseReadVariable(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), initSepaData(), initSepaDataCreateVred(), readExpression(), readNonlinearExprs(), readPolynomial(), removeFixedVariables(), SCIPexprAdd(), SCIPexprgraphGetSeparableTrees(), SCIPexprgraphGetSumTrees(), SCIPexprMulConstant(), SCIPexprtreeAddExpr(), SCIPexprtreeRemoveFixedVars(), and SCIPwritePip().
copies an expression including its children
Definition at line 5763 of file expr.c. References BMSallocBlockMemoryArray, BMSduplicateBlockMemory, SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, and SCIPexprCopyDeep(). Referenced by exprsimplifyAddChildren(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), initSepaData(), initSepaDataCreateVred(), SCIPexprCopyDeep(), SCIPexprintCompile(), SCIPexprSubstituteVars(), SCIPexprtreeAddExpr(), SCIPexprtreeCopy(), and SCIPexprtreeSubstituteVars().
frees an expression including its children
Definition at line 5805 of file expr.c. References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, NULL, and SCIPexprFreeDeep(). Referenced by exprsimplifyFlattenPolynomials(), exprsimplifyRemoveDuplicatePolynomialChildren(), exprsimplifyRemovePolynomialUnusedChildren(), exprsimplifySeparateLinearFromPolynomial(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), initSepaData(), initSepaDataCreateVred(), readExpression(), removeFixedVariables(), SCIPexprAdd(), SCIPexprFreeDeep(), SCIPexprintCompile(), SCIPexprintFreeData(), SCIPexprMulConstant(), SCIPexprSubstituteVars(), SCIPexprtreeFree(), SCIPexprtreeRemoveFixedVars(), and SCIPexprtreeSubstituteVars().
frees an expression but not its children
Definition at line 5843 of file expr.c. References BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, and NULL. Referenced by SCIPexprAdd().
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.
Definition at line 5868 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().
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.
Definition at line 6026 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().
creates a SCIP_EXPR_LINEAR expression that is (affine) linear in its children: constant + sum_i coef_i child_i
Definition at line 6124 of file expr.c. References BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSduplicateBlockMemoryArray, exprCreate(), NULL, SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_LINEAR, SCIP_OKAY, and SCIP_Real. Referenced by createNlRow(), exprgraphNodeCreateExpr(), exprparseReadVariable(), initSepaData(), initSepaDataCreateVred(), readExpression(), removeFixedVariables(), SCIPexprAdd(), SCIPexprgraphGetSeparableTrees(), SCIPexprMulConstant(), and SCIPexprtreeRemoveFixedVars().
adds new terms to a linear expression
Definition at line 6161 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().
creates a SCIP_EXPR_QUADRATIC expression: constant + sum_i coef_i child_i + sum_i coef_i child1_i child2_i
Definition at line 6206 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().
ensures that quadratic elements of a quadratic expression are sorted
Definition at line 6242 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, quadraticdataSort(), and SCIP_EXPR_QUADRATIC. Referenced by eval(), and SCIPexprAreEqual().
creates a SCIP_EXPR_POLYNOMIAL expression from an array of monomials: constant + sum_i monomial_i
Definition at line 6254 of file expr.c. References BMSduplicateBlockMemoryArray, exprCreate(), NULL, polynomialdataCreate(), SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_POLYNOMIAL, and SCIP_OKAY. Referenced by createExprtreeFromMonomial(), createNlRow(), exprgraphNodeCreateExpr(), readPolynomial(), SCIPexprgraphGetSeparableTrees(), and SCIPexprgraphGetSumTrees().
adds an array of monomials to a SCIP_EXPR_POLYNOMIAL expression
Definition at line 6289 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataAddMonomials(), SCIP_CALL, SCIP_EXPR_POLYNOMIAL, and SCIP_OKAY. changes the constant in a SCIP_EXPR_POLYNOMIAL expression
Definition at line 6311 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, and SCIP_EXPR_POLYNOMIAL.
multiplies each summand of a polynomial by a given constant
Definition at line 6324 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataMultiplyByConstant(), and SCIP_EXPR_POLYNOMIAL.
multiplies each summand of a polynomial by a given monomial
Definition at line 6338 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataMultiplyByMonomial(), SCIP_CALL, SCIP_EXPR_POLYNOMIAL, and SCIP_OKAY.
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.
Definition at line 6361 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().
takes a power of the polynomial Exponent need to be an integer. Polynomial needs to be a monomial, if exponent is negative.
Definition at line 6407 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataPower(), SCIP_CALL, SCIP_EXPR_POLYNOMIAL, and SCIP_OKAY.
merges monomials in a polynomial expression that differ only in coefficient into a single monomial Eliminates monomials with coefficient between -eps and eps.
Definition at line 6427 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataMergeMonomials(), and SCIP_EXPR_POLYNOMIAL. Referenced by exprsimplifyFlattenPolynomials().
checks if two monomials are equal
Definition at line 6442 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().
changes coefficient of monomial
Definition at line 6473 of file expr.c. References SCIP_ExprData_Monomial::coef, and NULL. Referenced by polynomialdataMultiplyByConstant(), and polynomialdataMultiplyByPolynomial().
adds factors to a monomial
Definition at line 6484 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().
multiplies a monomial with a monomial
Definition at line 6513 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().
replaces the monomial by a power of the monomial Allows only integers as exponent.
Definition at line 6548 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().
merges factors that correspond to the same child by adding exponents Eliminates factors with exponent between -eps and eps.
Definition at line 6578 of file expr.c. References SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::coef, EPSEQ, EPSISINT, EPSROUND, EPSZ, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Monomial::nfactors, NULL, and SCIPexprSortMonomialFactors(). Referenced by polynomialdataMergeMonomials().
ensures that monomials of a polynomial are sorted
Definition at line 6645 of file expr.c. References SCIP_Expr::data, NULL, SCIP_Expr::op, polynomialdataSortMonomials(), and SCIP_EXPR_POLYNOMIAL. Referenced by SCIPexprAreEqual().
creates a monomial
Definition at line 6657 of file expr.c. References BMSallocBlockMemory, BMSallocBlockMemoryArray, BMSduplicateBlockMemoryArray, NULL, SCIP_ALLOC, and SCIP_OKAY. Referenced by createExprtreeFromMonomial(), createNlRow(), exprConvertToPolynomial(), polynomialdataAddMonomials(), polynomialdataCopy(), polynomialdataCreate(), polynomialdataMultiplyByMonomial(), polynomialdataMultiplyByPolynomial(), readPolynomial(), reformulate(), SCIPexprgraphGetSeparableTrees(), and SCIPexprgraphGetSumTrees().
frees a monomial
Definition at line 6714 of file expr.c. References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, and NULL. Referenced by exprConvertToPolynomial(), polynomialdataExpandMonomialFactor(), polynomialdataFree(), polynomialdataMergeMonomials(), polynomialdataMultiplyByConstant(), and polynomialdataPower().
ensures that factors in a monomial are sorted
Definition at line 6738 of file expr.c. References SCIP_ExprData_Monomial::childidxs, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Monomial::nfactors, NULL, SCIPsortIntReal(), SCIP_ExprData_Monomial::sorted, and TRUE. Referenced by SCIP_DECL_SORTPTRCOMP(), SCIPexprAreMonomialsEqual(), SCIPexprFindMonomialFactor(), and SCIPexprMergeMonomialFactors().
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.
Definition at line 6758 of file expr.c. References SCIP_ExprData_Monomial::childidxs, FALSE, SCIP_ExprData_Monomial::nfactors, NULL, SCIPexprSortMonomialFactors(), and SCIPsortedvecFindInt(). Referenced by exprgraphNodeSimplify(), and exprsimplifyFlattenPolynomials(). indicates whether the expression contains a SCIP_EXPR_PARAM
Definition at line 6775 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().
gets maximal degree of expression, or SCIP_EXPR_DEGREEINFINITY if not a polynomial
Definition at line 6794 of file expr.c. References SCIP_ExprData_Monomial::childidxs, SCIP_Expr::children, SCIP_Expr::data, SCIP_ExprData_Monomial::exponents, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, MAX, SCIP_ExprData_Polynomial::monomials, SCIP_Expr::nchildren, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_Expr::op, SCIP_ExprData_Quadratic::quadelems, quadraticdataSort(), SCIP_CALL, SCIP_ERROR, SCIP_EXPR_ABS, SCIP_EXPR_CONST, SCIP_EXPR_COS, SCIP_EXPR_DEGREEINFINITY, 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_OKAY, SCIPerrorMessage, and SCIPexprGetMaxDegree(). Referenced by SCIPexprGetMaxDegree(), and SCIPexprtreeGetMaxDegree().
counts usage of variables in expression
Definition at line 7119 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(). compares whether two expressions are the same Inconclusive, i.e., may give FALSE even if expressions are equivalent (x*y != y*x).
Definition at line 7142 of file expr.c. References SCIP_Expr::children, SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, SCIP_Expr::data, EPSEQ, EPSZ, FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Polynomial::monomials, SCIP_Expr::nchildren, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_Expr::op, SCIP_ExprData_Quadratic::quadelems, SCIP_EXPR_ABS, SCIP_EXPR_CONST, SCIP_EXPR_COS, SCIP_EXPR_DIV, SCIP_EXPR_EXP, SCIP_EXPR_INTPOWER, SCIP_EXPR_LAST, SCIP_EXPR_LINEAR, SCIP_EXPR_LOG, SCIP_EXPR_MAX, SCIP_EXPR_MIN, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PARAM, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SIGN, SCIP_EXPR_SIGNPOWER, SCIP_EXPR_SIN, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_EXPR_TAN, SCIP_EXPR_VARIDX, SCIP_Real, SCIPABORT, SCIPerrorMessage, SCIPexprAreEqual(), SCIPexprAreMonomialsEqual(), SCIPexprSortMonomials(), SCIPexprSortQuadElems(), and TRUE. Referenced by exprsimplifyAddChildren(), exprsimplifyRemoveDuplicatePolynomialChildren(), SCIPexprAreEqual(), and SCIPexprMultiplyPolynomialByPolynomial().
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.
Definition at line 7346 of file expr.c. References exprsimplifyConvertToPolynomials(), exprsimplifyFlattenPolynomials(), exprsimplifySeparateLinearFromPolynomial(), exprsimplifyUnconvertPolynomials(), NULL, SCIP_CALL, SCIP_OKAY, SCIPdebug, SCIPdebugMessage, SCIPdebugPrintf, and SCIPexprPrint(). Referenced by SCIPexprtreeSimplify().
evaluates an expression w.r.t. a point
Definition at line 7398 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 exprsimplifyFlattenPolynomials(), SCIPexprEval(), and SCIPexprtreeEval().
evaluates an expression w.r.t. an interval
Definition at line 7439 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 SCIPexprEvalInt(), and SCIPexprtreeEvalInt().
tries to determine the curvature type of an expression w.r.t. given variable domains
Definition at line 7481 of file expr.c. References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_Expr::children, SCIP_Expr::data, SCIP_Expr::nchildren, NULL, SCIP_Expr::op, SCIP_ALLOC, SCIP_CALL, SCIP_EXPRCURV_LINEAR, SCIP_EXPRESSION_MAXCHILDEST, SCIP_OKAY, and SCIPexprCheckCurvature(). Referenced by SCIPexprCheckCurvature(), and SCIPexprtreeCheckCurvature().
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.
Definition at line 7544 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().
updates variable indices in expression tree
Definition at line 7582 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().
updates parameter indices in expression tree
Definition at line 7603 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().
prints an expression
Definition at line 7624 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_VARIDX, SCIP_Real, SCIPABORT, SCIPerrorMessage, SCIPexprPrint(), and SCIPmessageFPrintInfo(). Referenced by exprParse(), exprsimplifyFlattenPolynomials(), SCIPexprPrint(), SCIPexprSimplify(), and SCIPexprtreePrint().
parses an expression from a string
Definition at line 7903 of file expr.c. References exprParse(), NULL, SCIP_CALL, SCIPhashtableCreate(), and SCIPhashtableFree(). Referenced by SCIP_DECL_CONSPARSE().
returns root expression of an expression tree
Definition at line 7964 of file expr.c. References NULL, and SCIP_ExprTree::root. Referenced by generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), getLinearAndQuadraticCoefs(), initSepaData(), initSepaDataCreateVred(), printNonlinearRow(), printRowNl(), readConstraints(), readObjective(), removeFixedVariables(), SCIPexprintCompile(), SCIPexprintEval(), SCIPexprintEvalInt(), SCIPnlpiOraclePrintProblemGams(), and SCIPwritePip().
returns number of variables in expression tree
Definition at line 7974 of file expr.c. References NULL, and SCIP_ExprTree::nvars. Referenced by addConcaveEstimatorBivariate(), addConcaveEstimatorMultivariate(), addConcaveEstimatorUnivariate(), addIntervalGradientEstimator(), addLinearization(), checkCurvature(), computeViolation(), consdataAddExprtrees(), createConstraint(), evalFunctionGradient(), evalFunctionValue(), freeConstraint(), generateCut(), getGradientMaxElement(), getLinearAndQuadraticCoefs(), hessLagAddExprtree(), hessLagSparsitySetNzFlagForExprtree(), nlpAddNlRows(), nlpSetupNlpiIndices(), nlrowCalcActivityBounds(), nlrowExprtreeChanged(), nlrowRemoveFixedExprtreeVars(), printFunction(), printRowNl(), processNlRow(), readObjective(), registerBranchingVariables(), registerLargeLPValueVariableForBranching(), removeFixedVariables(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSENFOPS(), SCIP_DECL_CONSEXITPRE(), SCIP_DECL_CONSGETNVARS(), SCIP_DECL_CONSGETVARS(), SCIP_DECL_CONSINITLP(), SCIPcreateConsBivariate(), SCIPevalExprtreeGlobalBounds(), SCIPevalExprtreeLocalBounds(), SCIPevalExprtreeSol(), SCIPexprintCompile(), SCIPexprintEval(), SCIPexprintEvalInt(), SCIPexprintGrad(), SCIPexprintGradInt(), SCIPexprintHessianDense(), SCIPexprintHessianSparsityDense(), SCIPexprtreeSimplify(), SCIPgetExprtreeTransformedVars(), SCIPnlpGetVarsNonlinearity(), SCIPnlpHasContinuousNonlinearity(), SCIPnlpiOracleChgExprtree(), SCIPnlpiOracleDelVarSet(), SCIPnlpiOracleEvalJacobian(), SCIPnlpiOracleGetJacobianSparsity(), SCIPnlrowGetSolActivity(), SCIPnlrowRecalcNLPActivity(), SCIPnlrowRecalcPseudoActivity(), SCIPwritePip(), solveDerivativeEquation(), and updateVariableDegreesCons().
returns number of parameters in expression tree
Definition at line 7984 of file expr.c. References SCIP_ExprTree::nparams, and NULL. Referenced by nlrowExprtreeParamChanged(), nlrowRemoveFixedExprtreeVars(), SCIPnlpiOracleChgExprParam(), and SCIPnlrowChgExprtreeParams().
returns values of parameters or NULL if none
Definition at line 7994 of file expr.c. References NULL, and SCIP_ExprTree::params. Referenced by nlrowExprtreeParamChanged(), SCIPexprintEval(), and SCIPexprintEvalInt().
sets value of a single parameter in expression tree
Definition at line 8004 of file expr.c. References NULL, and SCIP_ExprTree::params. Referenced by generateConvexConcaveUnderestimator(), SCIPnlpiOracleChgExprParam(), and SCIPnlrowChgExprtreeParam().
gets data of expression tree interpreter, or NULL if not set
Definition at line 8019 of file expr.c. References SCIP_ExprTree::interpreterdata, and NULL. Referenced by addIntervalGradientEstimator(), addLinearization(), computeViolation(), generateLinearizationCut(), getGradientMaxElement(), initSepaData(), SCIP_DECL_CONSINITLP(), SCIPexprintCompile(), SCIPexprintEval(), SCIPexprintEvalInt(), SCIPexprintGrad(), SCIPexprintGradInt(), SCIPexprintHessianDense(), SCIPexprintHessianSparsityDense(), SCIPexprintNewParametrization(), and solveDerivativeEquation().
sets data of expression tree interpreter
Definition at line 8029 of file expr.c. References SCIP_ExprTree::interpreterdata, and NULL. Referenced by SCIPexprintCompile().
frees data of expression tree interpreter, if any
Definition at line 8042 of file expr.c. References SCIP_ExprTree::interpreterdata, NULL, SCIP_CALL, SCIP_OKAY, and SCIPexprintFreeData(). Referenced by SCIPexprtreeAddExpr(), SCIPexprtreeFree(), SCIPexprtreeSimplify(), and SCIPexprtreeSubstituteVars().
indicates whether there are parameterized constants (SCIP_EXPR_PARAM) in expression tree
Definition at line 8056 of file expr.c. References NULL, SCIP_ExprTree::root, and SCIPexprHasParam().
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.
Definition at line 8072 of file expr.c. References NULL, SCIP_ExprTree::root, SCIP_CALL, SCIP_OKAY, and SCIPexprGetMaxDegree(). Referenced by SCIPwriteGms().
evaluates an expression tree w.r.t. a point
Definition at line 8085 of file expr.c. References NULL, SCIP_ExprTree::nvars, SCIP_ExprTree::params, SCIP_ExprTree::root, SCIP_CALL, SCIP_OKAY, and SCIPexprEval(). Referenced by addConcaveEstimatorBivariate(), addConcaveEstimatorMultivariate(), addConcaveEstimatorUnivariate(), generateConvexConcaveUnderestimator(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), nlrowRemoveFixedExprtreeVars(), SCIPevalExprtreeSol(), SCIPexprtreeSimplify(), SCIPnlrowGetSolActivity(), SCIPnlrowRecalcNLPActivity(), and SCIPnlrowRecalcPseudoActivity().
evaluates an expression tree w.r.t. an interval
Definition at line 8101 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(), and SCIPevalExprtreeLocalBounds().
prints an expression tree
Definition at line 8118 of file expr.c. References NULL, SCIP_ExprTree::params, SCIP_ExprTree::root, and SCIPexprPrint(). Referenced by generateConvexConcaveUnderestimator(), printFunction(), and SCIPexprtreePrintWithNames().
creates an expression tree
Definition at line 8133 of file expr.c. References BMSallocBlockMemory, BMSallocBlockMemoryArray, BMSclearMemoryArray, BMSduplicateBlockMemoryArray, NULL, SCIP_ALLOC, and SCIP_OKAY. Referenced by createConsFromQuadTerm(), createExprtreeFromMonomial(), createNlRow(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), initSepaData(), initSepaDataCreateVred(), readNonlinearExprs(), readPolynomial(), SCIP_DECL_CONSPARSE(), SCIPexprgraphGetSeparableTrees(), SCIPexprgraphGetSumTrees(), SCIPexprgraphGetTree(), and SCIPwritePip().
copies an expression tree
Definition at line 8174 of file expr.c. References BMSduplicateBlockMemory, BMSduplicateBlockMemoryArray, SCIP_ExprTree::nparams, NULL, SCIP_ExprTree::nvars, SCIP_ExprTree::params, SCIP_ExprTree::root, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPexprCopyDeep(), and SCIP_ExprTree::vars. Referenced by consdataAddExprtrees(), createConstraint(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), initSepaData(), removeFixedVariables(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSTRANS(), SCIPcreateConsBivariate(), SCIPnlpiOracleChgExprtree(), SCIPnlrowChgExprtree(), and SCIPnlrowCreate().
frees an expression tree
Definition at line 8214 of file expr.c. References BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, NULL, SCIP_CALL, SCIP_OKAY, SCIPexprFreeDeep(), and SCIPexprtreeFreeInterpreterData(). Referenced by consdataFree(), consdataSetExprtrees(), createConsFromMonomial(), createConsFromQuadTerm(), createNlRow(), freeConstraint(), freeSepaData(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), nlrowRemoveFixedExprtreeVars(), readConstraints(), readNonlinearExprs(), readObjective(), removeFixedVariables(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSDELETE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPRINT(), SCIPnlpiOracleChgExprtree(), SCIPnlpiOracleDelVarSet(), SCIPnlrowChgExprtree(), SCIPnlrowFree(), SCIPwriteGms(), and SCIPwritePip().
sets number and values of all parameters in expression tree
Definition at line 8238 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().
gives the number of usages for each variable in the expression tree
Definition at line 8269 of file expr.c. References BMSclearMemoryArray, NULL, SCIP_ExprTree::nvars, SCIP_ExprTree::root, and SCIPexprGetVarsUsage().
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.
Definition at line 8288 of file expr.c. References SCIP_ExprTree::blkmem, BMSallocMemoryArray, BMSfreeMemoryArray, EPSZ, NULL, SCIP_ExprTree::nvars, SCIP_ExprTree::root, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPexprSimplify(), SCIPexprtreeEval(), SCIPexprtreeFreeInterpreterData(), SCIPexprtreeGetNVars(), SCIPgetRandomReal(), and SCIPrelDiff().
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.
Definition at line 8339 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().
tries to determine the curvature type of an expression tree w.r.t. given variable domains
Definition at line 8362 of file expr.c. References NULL, SCIP_ExprTree::params, SCIP_ExprTree::root, SCIP_CALL, SCIP_OKAY, and SCIPexprCheckCurvature(). Referenced by checkCurvature().
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.
Definition at line 8388 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().
quicksort an array of quadratic elements; pivot is the medial element (taken from scip/sorttpl.c)
Definition at line 8442 of file expr.c. References QUADELEMS_ISBETTER, and QUADELEMS_SWAP. Referenced by SCIPquadelemSort().
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.
Definition at line 8552 of file expr.c. References quadelemsQuickSort(). Referenced by createConstraint(), exprgraphFindParentByOperator(), nlrowSortQuadElem(), quadraticdataSort(), SCIPnlpiOracleChgQuadCoefs(), and SCIPnlpiOracleDelVarSet().
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.
Definition at line 8577 of file expr.c. References FALSE, NULL, and TRUE. Referenced by nlrowSearchQuadElem(), and SCIPnlpiOracleChgQuadCoefs().
Adds quadratic elements with same index and removes elements with coefficient 0.0. Assumes that elements have been sorted before.
Definition at line 8629 of file expr.c. References SCIP_QuadElement::coef, NULL, and QUADELEMS_ISBETTER. Referenced by createConstraint(), and SCIPnlpiOracleChgQuadCoefs().
adds a parent to an expression graph node
Definition at line 8685 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().
ensures that array of parents in a node is sorted
Definition at line 8714 of file expr.c. References SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::parents, SCIP_ExprGraphNode::parentssorted, SCIPsortPtr(), and TRUE. Referenced by exprgraphNodeIsParent(), and exprgraphNodeRemoveParent().
removes a parent from an expression graph node If the node is not used and has no other parents, then it is freed.
Definition at line 8740 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().
checks if a node is parent of a node
Definition at line 8791 of file expr.c. References SCIP_ExprGraphNode::depth, exprgraphNodeSortParents(), FALSE, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::parents, and SCIPsortedvecFindPtr(). Referenced by exprgraphFindParentByOperator(), and exprgraphNodeRemovePolynomialDuplicateChildren().
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.
Definition at line 8822 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().
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.
Definition at line 8923 of file expr.c. References SCIP_ExprGraph::blkmem, SCIP_ExprGraphNode::children, exprgraphNodeAddParent(), exprgraphNodeRemoveParent(), FALSE, SCIP_ExprGraphNode::nchildren, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIP_ExprGraphNode::simplified. Referenced by SCIPexprgraphMoveNodeParents(), and SCIPexprgraphSimplify().
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 8973 of file expr.c. References NULL, and SCIP_EXPR_CONST.
sort array of nodes that holds constants
Definition at line 8992 of file expr.c. References SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssorted, SCIP_ExprGraph::nconsts, NULL, SCIPsortPtr(), and TRUE. Referenced by exprgraphFindConstNodePos(), and SCIPexprgraphFindConstNode().
finds position of expression graph node corresponding to a constant in constnodes array
Definition at line 9008 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().
creates an expression graph node
Definition at line 9063 of file expr.c. References BMSallocBlockMemory, BMSclearMemory, NULL, SCIP_ALLOC, SCIP_EXPR_CONST, SCIP_EXPR_PARAM, SCIP_EXPR_VARIDX, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_INVALID, SCIP_OKAY, SCIP_REAL_MAX, SCIPintervalSetEntire(), and TRUE. Referenced by exprgraphAddExpr(), SCIPexprgraphAddConst(), SCIPexprgraphAddExprtreeSum(), SCIPexprgraphAddVars(), SCIPexprgraphCreateNode(), SCIPexprgraphCreateNodeLinear(), SCIPexprgraphCreateNodePolynomial(), SCIPexprgraphCreateNodeQuadratic(), and SCIPexprgraphNodeSplitOffLinear().
prints the expression corresponding to a node (not recursively) < gaussian error function (1 operand) < imaginary part of gaussian error function (1 operand)
Definition at line 9107 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, SCIPexpropGetName(), SCIPmessageFPrintInfo(), and SCIP_Interval::sup. Referenced by exprgraphNodeSimplify(), exprgraphPrintNodeDot(), and SCIPexprgraphPrintNode().
prints a node of an expression graph
Definition at line 9360 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().
evaluate node of expression graph w.r.t. values stored in children
Definition at line 9402 of file expr.c. References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::nchildren, NULL, SCIP_ExprGraphNode::op, SCIP_ALLOC, SCIP_CALL, SCIP_EXPRESSION_MAXCHILDEST, SCIP_INVALID, SCIP_OKAY, SCIP_Real, and SCIP_ExprGraphNode::value. Referenced by exprgraphNodeEvalWithChildren(), SCIPexprgraphAddNode(), SCIPexprgraphEval(), and SCIPexprgraphSimplify().
evaluates node including subtree
Definition at line 9446 of file expr.c. References SCIP_ExprGraphNode::children, exprgraphNodeEval(), SCIP_ExprGraphNode::nchildren, NULL, SCIP_CALL, and SCIP_OKAY. Referenced by exprgraphNodeSimplify().
updates bounds of a node if a children has changed its bounds
Definition at line 9467 of file expr.c. References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, SCIP_Interval::inf, isLbBetter(), isUbBetter(), SCIP_ExprGraphNode::nchildren, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::parents, SCIP_ExprGraphNode::pos, SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_PARAM, SCIP_EXPR_VARIDX, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_CHILDTIGHTENED, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENT, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_EXPRESSION_MAXCHILDEST, SCIP_OKAY, SCIPdebugMessage, SCIPexpropGetName(), SCIPintervalIntersect(), SCIPintervalIsEmpty(), and SCIP_Interval::sup. Referenced by SCIPexprgraphPropagateVarBounds().
propagate bounds of a node into children by reverting the nodes expression
Definition at line 9560 of file expr.c. References 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_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_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENT, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENTFORCE, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENTRECENT, SCIP_Real, SCIPABORT, SCIPdebugMessage, SCIPdebugPrintf, SCIPerrorMessage, 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, and TRUE. Referenced by SCIPexprgraphPropagateNodeBounds().
removes duplicate children in a polynomial expression node Leaves NULL's in children array.
Definition at line 10594 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().
eliminates NULL's in children array and shrinks it to actual size
Definition at line 10652 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().
aims at simplifying a node in an expression graph, assuming all children have been simplified Converts node into polynomial, if possible and not constant.
Definition at line 10721 of file expr.c. References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSclearMemoryArray, BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, SCIP_ExprData_Monomial::childidxs, SCIP_ExprGraphNode::children, SCIP_ExprData_Monomial::coef, SCIP_ExprData_Polynomial::constant, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, ensureBlockMemoryArraySize, EPSISINT, SCIP_ExprData_Monomial::exponents, exprConvertToPolynomial(), exprgraphNodeAddChildren(), exprgraphNodeEvalWithChildren(), exprgraphNodeRemoveParent(), exprgraphNodeRemovePolynomialDuplicateChildren(), exprgraphNodeRemovePolynomialNullChildren(), exprgraphPrintNodeExpression(), FALSE, SCIP_ExprData_Polynomial::monomials, SCIP_ExprGraphNode::nchildren, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, NULL, SCIP_ExprGraphNode::op, polynomialdataExpandMonomialFactor(), polynomialdataFree(), polynomialdataMergeMonomials(), SCIP_ExprGraphNode::pos, pow(), SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_POLYNOMIAL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPdebug, SCIPdebugMessage, SCIPdebugPrintf, SCIPexprFindMonomialFactor(), SCIPmessagePrintWarning(), SCIP_ExprGraphNode::simplified, SCIP_ExprData_Polynomial::sorted, SCIP_ExprData_Monomial::sorted, TRUE, and SCIP_ExprGraphNode::value. Referenced by SCIPexprgraphSimplify().
creates an expression from a given node in an expression graph Assembles mapping of variables from graph to tree.
Definition at line 11047 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_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_VARIDX, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIPexprCreate(), SCIPexprCreateLinear(), SCIPexprCreatePolynomial(), SCIPexprCreateQuadratic(), and TRUE. Referenced by SCIPexprgraphGetSeparableTrees(), SCIPexprgraphGetSumTrees(), and SCIPexprgraphGetTree().
counts how often expression graph variables are used in a subtree of the expression graph
Definition at line 11205 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().
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.
Definition at line 11230 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().
assert that expression tree has at least a given depth
Definition at line 11290 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().
remove a variable from the variables arrays, assuming that its node will be removed or converted next
Definition at line 11317 of file expr.c. References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraph::nvars, SCIP_CALL, SCIP_OKAY, SCIPhashmapRemove(), SCIPhashmapSetImage(), SCIP_ExprGraph::userdata, SCIP_ExprGraph::varbounds, SCIP_ExprGraph::varidxs, SCIP_ExprGraph::varnodes, and SCIP_ExprGraph::vars. Referenced by SCIPexprgraphReleaseNode(), and SCIPexprgraphReplaceVarByLinearSum().
moves a node in an expression graph to a different depth New depth must be larger than children depth. Moves parent nodes to higher depth, if needed. Variable nodes cannot be moved.
Definition at line 11370 of file expr.c. References SCIP_ExprGraph::blkmem, SCIP_ExprGraphNode::children, SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssize, SCIP_ExprGraph::constssorted, SCIP_ExprGraphNode::curv, SCIP_ExprGraphNode::depth, SCIP_ExprGraph::depth, ensureBlockMemoryArraySize, exprgraphEnsureDepth(), SCIP_ExprGraphNode::nchildren, SCIP_ExprGraph::nconsts, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, SCIP_ExprGraph::nodessize, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::parents, SCIP_ExprGraphNode::pos, SCIP_CALL, SCIP_ERROR, SCIP_EXPR_CONST, SCIP_EXPR_VARIDX, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIPdebugMessage, and SCIPerrorMessage. Referenced by SCIPexprgraphMoveNodeParents(), SCIPexprgraphReplaceVarByLinearSum(), and SCIPexprgraphSimplify().
given a list of children, tries to find a common parent that represents a given operator with the same given data
Definition at line 11458 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_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().
adds an expression into an expression graph Enables corresponding nodes.
Definition at line 11921 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_VARIDX, SCIP_OKAY, SCIPdebugMessage, SCIPexprgraphAddConst(), SCIPexprgraphAddNode(), SCIPexprgraphAddVars(), TRUE, and SCIP_ExprGraph::vars. Referenced by SCIPexprgraphAddExprtreeSum().
sets bounds in variable nodes to those stored in exprgraph's varbounds array
Definition at line 12036 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().
captures node, i.e., increases number of uses
Definition at line 12147 of file expr.c. References SCIP_ExprGraphNode::nuses, and SCIPdebugMessage. Referenced by exprgraphNodeRemoveParent(), reformReplaceNode(), SCIPcreateConsNonlinear2(), SCIPexprgraphAddExprtreeSum(), and SCIPexprgraphNodeSplitOffLinear().
returns whether a node is currently enabled
Definition at line 12159 of file expr.c. References SCIP_ExprGraphNode::enabled, and NULL. Referenced by reformulate().
gets number of children of a node in an expression graph
Definition at line 12169 of file expr.c. References SCIP_ExprGraphNode::nchildren, and NULL. Referenced by reformEnsureChildrenMinCurvature(), reformMonomial(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_NONLINCONSUPGD(), and splitOffLinearPart().
gets children of a node in an expression graph
Definition at line 12179 of file expr.c. References SCIP_ExprGraphNode::children, and NULL. Referenced by reformEnsureChildrenMinCurvature(), reformMonomial(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().
gets number of parents of a node in an expression graph
Definition at line 12189 of file expr.c. References SCIP_ExprGraphNode::nparents, and NULL. Referenced by reformMonomial(), reformReplaceNode(), and reformulate().
gets parents of a node in an expression graph
Definition at line 12199 of file expr.c. References NULL, and SCIP_ExprGraphNode::parents. Referenced by reformMonomial().
gets depth of node in expression graph
Definition at line 12209 of file expr.c. References SCIP_ExprGraphNode::depth, and NULL. Referenced by reformEnsureChildrenMinCurvature(), reformNode2Var(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().
gets position of node in expression graph at its depth level
Definition at line 12219 of file expr.c. References NULL, and SCIP_ExprGraphNode::pos. Referenced by reformEnsureChildrenMinCurvature(), reformNode2Var(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().
gets operator of a node in an expression graph
Definition at line 12229 of file expr.c. References NULL, and SCIP_ExprGraphNode::op. Referenced by reformEnsureChildrenMinCurvature(), reformMonomial(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_NONLINCONSUPGD(), and SCIPexprgraphNodePolynomialAddMonomials().
gives index belonging to a SCIP_EXPR_VARIDX or SCIP_EXPR_PARAM operand
Definition at line 12239 of file expr.c. References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, SCIP_EXPR_PARAM, and SCIP_EXPR_VARIDX.
gives real belonging to a SCIP_EXPR_CONST operand
Definition at line 12250 of file expr.c. References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_CONST.
gives variable belonging to a SCIP_EXPR_VARIDX expression
Definition at line 12261 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().
gives exponent belonging to a SCIP_EXPR_REALPOWER expression
Definition at line 12276 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().
gives exponent belonging to a SCIP_EXPR_INTPOWER expression
Definition at line 12287 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().
gives exponent belonging to a SCIP_EXPR_SIGNPOWER expression
Definition at line 12298 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().
gives linear coefficients belonging to a SCIP_EXPR_LINEAR expression
Definition at line 12309 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().
gives constant belonging to a SCIP_EXPR_LINEAR expression
Definition at line 12320 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().
gives constant belonging to a SCIP_EXPR_QUADRATIC expression
Definition at line 12332 of file expr.c. References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_QUADRATIC. Referenced by SCIP_DECL_NONLINCONSUPGD().
gives linear coefficients belonging to a SCIP_EXPR_QUADRATIC expression, or NULL if all coefficients are 0.0
Definition at line 12344 of file expr.c. References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_QUADRATIC. Referenced by SCIP_DECL_NONLINCONSUPGD().
gives quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression
Definition at line 12356 of file expr.c. References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_QUADRATIC. Referenced by SCIP_DECL_NONLINCONSUPGD().
gives number of quadratic elements belonging to a SCIP_EXPR_QUADRATIC expression
Definition at line 12368 of file expr.c. References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraphNode::op, and SCIP_EXPR_QUADRATIC. Referenced by SCIP_DECL_NONLINCONSUPGD().
gives the monomials belonging to a SCIP_EXPR_POLYNOMIAL expression
Definition at line 12380 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().
gives the number of monomials belonging to a SCIP_EXPR_POLYNOMIAL expression
Definition at line 12392 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().
gives the constant belonging to a SCIP_EXPR_POLYNOMIAL expression
Definition at line 12404 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().
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.
Definition at line 12419 of file expr.c. References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprData_Monomial::childidxs, SCIP_ExprGraphNode::children, SCIP_ExprData_Monomial::coef, SCIP_ExprGraphNode::curv, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, SCIP_ExprData_Monomial::exponents, SCIP_ExprData_Monomial::nfactors, NULL, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::pos, SCIP_ALLOC, SCIP_EXPR_POLYNOMIAL, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_EXPRCURV_LINEAR, SCIP_EXPRESSION_MAXCHILDEST, SCIP_OKAY, SCIPexprcurvMonomial(), SCIPexprcurvMultiply(), and SCIPintervalIsEmpty(). Referenced by reformulate().
gets bounds of a node in an expression graph
Definition at line 12496 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().
gets value of expression associated to node from last evaluation call
Definition at line 12506 of file expr.c. References NULL, and SCIP_ExprGraphNode::value. Referenced by computeViolation(), reformMonomial(), reformNode2Var(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_NONLINCONSUPGD(), and SCIPexprgraphSimplify().
gets curvature of expression associated to node from last curvature check call
Definition at line 12516 of file expr.c. References SCIP_ExprGraphNode::curv, and NULL. Referenced by reformEnsureChildrenMinCurvature(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIP_DECL_NONLINCONSUPGD().
creates an expression graph node
Definition at line 12526 of file expr.c. References exprgraphCreateNode(), NULL, 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_VARIDX, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPABORT, and SCIPerrorMessage. Referenced by reformMonomial(), and reformulate().
creates an expression graph node for a linear expression
Definition at line 12609 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().
creates an expression graph node for a quadratic expression
Definition at line 12635 of file expr.c. References exprgraphCreateNode(), NULL, quadraticdataCreate(), SCIP_CALL, SCIP_EXPR_QUADRATIC, and SCIP_OKAY. Referenced by reformulate().
creates an expression graph node for a polynomial expression
Definition at line 12661 of file expr.c. References exprgraphCreateNode(), NULL, polynomialdataCreate(), SCIP_CALL, SCIP_EXPR_POLYNOMIAL, and SCIP_OKAY. Referenced by reformulate().
adds monomials to an expression graph node that is a polynomial expression
Definition at line 12686 of file expr.c. References SCIP_ExprGraphNode::data, NULL, polynomialdataAddMonomials(), SCIP_CALL, SCIP_EXPR_POLYNOMIAL, SCIP_OKAY, and SCIPexprgraphGetNodeOperator().
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.
Definition at line 12712 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_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().
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.
Definition at line 13523 of file expr.c. References SCIP_ExprGraphNode::depth, exprgraphMoveNode(), exprgraphNodeReplaceChild(), NULL, SCIP_CALL, and SCIP_OKAY. Referenced by reformReplaceNode(), SCIPexprgraphReplaceVarByLinearSum(), and SCIPexprgraphSimplify().
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.
Definition at line 13555 of file expr.c. References SCIP_ExprGraph::blkmem, SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssorted, SCIP_ExprGraphNode::depth, SCIP_ExprGraph::depth, exprgraphFindConstNodePos(), exprgraphNodeRemoveParent(), exprgraphRemoveVar(), SCIP_ExprGraph::nconsts, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, NULL, SCIP_ExprGraphNode::pos, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_VARIDX, SCIP_OKAY, SCIPdebugMessage, SCIPexprgraphFreeNode(), and SCIPexpropGetName(). Referenced by exprgraphNodeRemoveParent(), reformReplaceNode(), SCIP_DECL_CONSDEACTIVE(), and SCIPexprgraphNodeSplitOffLinear().
frees a node of an expression graph
Definition at line 13645 of file expr.c. References BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, and NULL. Referenced by SCIPexprgraphReleaseNode().
enables a node and recursively all its children in an expression graph
Definition at line 13670 of file expr.c. References SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraph::needvarboundprop, NULL, SCIP_ExprGraphNode::pos, SCIP_REAL_MAX, SCIPdebugMessage, SCIPexprgraphEnableNode(), SCIPintervalSetEntire(), and TRUE. Referenced by SCIP_DECL_CONSENABLE(), and SCIPexprgraphEnableNode().
disables a node and recursively all children which have no enabled parents in an expression graph
Definition at line 13697 of file expr.c. References SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, FALSE, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::nuses, SCIP_ExprGraphNode::parents, SCIP_ExprGraphNode::pos, SCIPdebugMessage, SCIPexprgraphDisableNode(), and TRUE. Referenced by SCIP_DECL_CONSDISABLE(), and SCIPexprgraphDisableNode().
returns whether the node has siblings in the expression graph
Definition at line 13728 of file expr.c. References FALSE, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::parents, and TRUE. Referenced by reformulate(), and SCIP_DECL_EXPRGRAPHNODEREFORM().
returns whether all children of an expression graph node are variable nodes Returns TRUE for nodes without children.
Definition at line 13747 of file expr.c. References SCIP_ExprGraphNode::children, FALSE, SCIP_ExprGraphNode::nchildren, NULL, SCIP_ExprGraphNode::op, SCIP_EXPR_VARIDX, and TRUE. Referenced by SCIP_DECL_NONLINCONSUPGD().
returns whether the node has an ancestor which has a nonlinear expression operand
Definition at line 13763 of file expr.c. References SCIP_ExprGraphNode::depth, FALSE, SCIP_ExprGraphNode::nparents, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::parents, SCIP_EXPR_CONST, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_PARAM, SCIP_EXPR_PLUS, SCIP_EXPR_SUM, SCIP_EXPR_VARIDX, SCIPexprgraphHasNodeNonlinearAncestor(), and TRUE. Referenced by reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIPexprgraphHasNodeNonlinearAncestor().
prints an expression graph node
Definition at line 13800 of file expr.c. References exprgraphPrintNodeExpression(), FALSE, and NULL. Referenced by reformulate().
tightens the bounds in a node of the graph Preparation for reverse propagation. Sets bound status to SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENTRECENT if tightening is strong enough and not cutoff.
Definition at line 13816 of file expr.c. References SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, FALSE, SCIP_Interval::inf, isLbBetter(), isUbBetter(), NULL, SCIP_ExprGraphNode::pos, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENT, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENTFORCE, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENTRECENT, SCIPdebugMessage, SCIPdebugPrintf, SCIPintervalIntersect(), SCIPintervalIsEmpty(), SCIP_Interval::sup, and TRUE. Referenced by exprgraphNodePropagateBounds(), propagateBoundsCons(), propagateConstraintSides(), and reformNode2Var().
ensures that bounds and curvature information in a node is uptodate Assumes that bounds and curvature in children are uptodate.
Definition at line 13877 of file expr.c. References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::curv, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprGraphNode::enabled, SCIP_Interval::inf, isLbBetter(), isUbBetter(), SCIP_ExprGraphNode::nchildren, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::parents, SCIP_ExprGraphNode::pos, SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_PARAM, SCIP_EXPR_VARIDX, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_CHILDTIGHTENED, SCIP_EXPRBOUNDSTATUS_TIGHTENEDBYPARENT, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_EXPRCURV_LINEAR, SCIP_EXPRESSION_MAXCHILDEST, SCIP_OKAY, SCIPdebugMessage, SCIPexpropGetName(), SCIPintervalIntersect(), SCIPintervalIsEmpty(), and SCIP_Interval::sup. Referenced by reformEnsureChildrenMinCurvature(), reformMonomial(), reformulate(), and SCIPexprgraphCheckCurvature().
get current maximal depth of expression graph
Definition at line 14027 of file expr.c. References SCIP_ExprGraph::depth, and NULL. Referenced by reformulate().
gets array with number of nodes at each depth of expression graph
Definition at line 14037 of file expr.c. References SCIP_ExprGraph::nnodes, and NULL. Referenced by reformulate().
gets nodes of expression graph, one array per depth
Definition at line 14047 of file expr.c. References SCIP_ExprGraph::nodes, and NULL. Referenced by reformulate().
gets number of variables in expression graph
Definition at line 14057 of file expr.c. References NULL, and SCIP_ExprGraph::nvars. Referenced by computeViolations(), presolveUpgrade(), propagateBounds(), propagateConstraintSides(), reformulate(), removeFixedNonlinearVariables(), SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSFREE(), SCIP_DECL_CONSGETNVARS(), and SCIP_DECL_CONSGETVARS().
gets array of variables in expression graph
Definition at line 14067 of file expr.c. References NULL, and SCIP_ExprGraph::vars. Referenced by computeViolations(), presolveUpgrade(), propagateBounds(), propagateConstraintSides(), reformulate(), removeFixedNonlinearVariables(), SCIP_DECL_CONSCHECK(), and SCIP_DECL_CONSGETVARS().
gets array of expression graph nodes corresponding to variables
Definition at line 14077 of file expr.c. References NULL, and SCIP_ExprGraph::varnodes. Referenced by propagateBounds(), and propagateConstraintSides().
sets value for a single variable given as expression graph node
Definition at line 14087 of file expr.c. References NULL, SCIP_ExprGraphNode::op, SCIP_EXPR_VARIDX, and SCIP_ExprGraphNode::value. Referenced by reformMonomial(), reformNode2Var(), reformulate(), and SCIP_DECL_EXPRGRAPHNODEREFORM().
sets bounds for variables
Definition at line 14099 of file expr.c. References BMScopyMemoryArray, NULL, SCIP_ExprGraph::nvars, and SCIP_ExprGraph::varbounds.
sets bounds for a single variable
Definition at line 14111 of file expr.c. References NULL, SCIPhashmapExists(), SCIPhashmapGetImage(), SCIP_ExprGraph::varbounds, SCIP_ExprGraph::varidxs, and SCIP_ExprGraph::vars.
sets bounds for a single variable given as expression graph node
Definition at line 14131 of file expr.c. References SCIP_ExprGraphNode::data, NULL, SCIP_ExprGraph::varbounds, and SCIP_ExprGraph::varnodes. Referenced by SCIP_DECL_EXPRGRAPHVARADDED().
sets lower bound for a single variable given as expression graph node
Definition at line 14151 of file expr.c. References SCIP_ExprGraphNode::data, SCIP_Interval::inf, NULL, SCIP_ExprGraph::varbounds, and SCIP_ExprGraph::varnodes. Referenced by SCIP_DECL_EVENTEXEC().
sets upper bound for a single variable given as expression graph node
Definition at line 14171 of file expr.c. References SCIP_ExprGraphNode::data, NULL, SCIP_Interval::sup, SCIP_ExprGraph::varbounds, and SCIP_ExprGraph::varnodes. Referenced by SCIP_DECL_EVENTEXEC().
gets bounds that are stored for all variables
Definition at line 14191 of file expr.c. References SCIP_ExprGraph::varbounds.
creates an empty expression graph
Definition at line 14199 of file expr.c. References BMSallocBlockMemory, BMSclearMemory, ensureBlockMemoryArraySize3, exprgraphEnsureDepth(), MAX, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPcalcHashtableSize(), SCIPhashmapCreate(), and TRUE. Referenced by SCIPincludeConshdlrBivariate(), and SCIPincludeConshdlrNonlinear().
frees an expression graph
Definition at line 14238 of file expr.c. References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, NULL, SCIP_OKAY, and SCIPhashmapFree(). Referenced by SCIP_DECL_CONSFREE().
adds an expression graph node to an expression graph Expression graph assumes ownership of node. Children are notified about new parent. Depth will be chosen to be the maximum of mindepth and the depth of all children plus one.
Definition at line 14287 of file expr.c. References SCIP_ExprGraph::blkmem, BMSduplicateBlockMemoryArray, SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprGraph::depth, ensureBlockMemoryArraySize, exprgraphEnsureDepth(), exprgraphNodeAddParent(), exprgraphNodeEval(), MAX, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraph::needvarboundprop, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, SCIP_ExprGraph::nodessize, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::pos, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_VARIDX, SCIP_EXPRBOUNDSTATUS_CHILDTIGHTENED, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_INVALID, SCIP_OKAY, SCIP_REAL_MAX, SCIPintervalSet(), SCIPintervalSetEntire(), TRUE, and SCIP_ExprGraphNode::value. Referenced by exprgraphAddExpr(), reformMonomial(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIPexprgraphAddConst(), SCIPexprgraphAddExprtreeSum(), SCIPexprgraphAddVars(), and SCIPexprgraphNodeSplitOffLinear().
adds variables to an expression graph, if not existing yet Also already existing nodes are enabled.
Definition at line 14371 of file expr.c. References SCIP_ExprGraph::blkmem, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprGraph::depth, SCIP_ExprGraphNode::enabled, ensureBlockMemoryArraySize, ensureBlockMemoryArraySize3, exprgraphCreateNode(), SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, SCIP_ExprGraph::nodessize, NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::pos, SCIP_CALL, SCIP_EXPR_VARIDX, SCIP_OKAY, SCIP_REAL_MAX, SCIPdebugMessage, SCIPexprgraphAddNode(), SCIPexprgraphFindVarNode(), SCIPhashmapExists(), SCIPhashmapInsert(), SCIPintervalSetEntire(), TRUE, SCIP_ExprGraph::userdata, SCIP_ExprGraph::varbounds, SCIP_ExprGraph::varidxs, SCIP_ExprGraph::varnodes, SCIP_ExprGraph::vars, and SCIP_ExprGraph::varssize. Referenced by exprgraphAddExpr(), reformMonomial(), reformNode2Var(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), and SCIPexprgraphReplaceVarByLinearSum().
adds a constant to an expression graph, if not existing yet Also already existing nodes are enabled.
Definition at line 14444 of file expr.c. References SCIP_ExprGraph::blkmem, SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssize, SCIP_ExprGraph::constssorted, SCIP_ExprGraphNode::depth, ensureBlockMemoryArraySize, exprgraphCreateNode(), SCIP_ExprGraph::nconsts, SCIP_ExprGraph::nnodes, NULL, SCIP_CALL, SCIP_EXPR_CONST, SCIP_OKAY, SCIPdebugMessage, SCIPexprgraphAddNode(), SCIPexprgraphFindConstNode(), and TRUE. Referenced by exprgraphAddExpr().
adds sum of expression trees into expression graph node will also be captured.
Definition at line 14489 of file expr.c. References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArray, SCIP_ExprGraphNode::depth, exprgraphAddExpr(), exprgraphCreateNode(), exprgraphFindParentByOperator(), FALSE, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_PLUS, SCIP_EXPR_SUM, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPexprgraphAddNode(), SCIPexprgraphCaptureNode(), and TRUE. Referenced by SCIP_DECL_CONSACTIVE().
replaces variable in expression graph by a linear sum of variables Variables will be added if not in the graph yet.
Definition at line 14629 of file expr.c. References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::boundstatus, SCIP_ExprGraphNode::children, SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssize, SCIP_ExprGraph::constssorted, SCIP_ExprGraphNode::data, ensureBlockMemoryArraySize, ensureBlockMemoryArraySize3, exprgraphMoveNode(), exprgraphNodeAddParent(), exprgraphRemoveVar(), FALSE, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraph::nconsts, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::nuses, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::parents, SCIP_ALLOC, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_LINEAR, SCIP_EXPR_SUM, SCIP_EXPRBOUNDSTATUS_CHILDRELAXED, SCIP_EXPRBOUNDSTATUS_VALID, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIP_REAL_MAX, SCIPdebugMessage, SCIPexprgraphAddVars(), SCIPexprgraphFindConstNode(), SCIPexprgraphFindVarNode(), SCIPexprgraphMoveNodeParents(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashmapInsert(), SCIPintervalSet(), SCIPintervalSetEntire(), SCIP_ExprGraphNode::simplified, SCIP_ExprGraph::userdata, SCIP_ExprGraphNode::value, SCIP_ExprGraph::varbounds, SCIP_ExprGraph::varidxs, SCIP_ExprGraph::varnodes, SCIP_ExprGraph::vars, and SCIP_ExprGraph::varssize. Referenced by removeFixedNonlinearVariables().
finds expression graph node corresponding to a variable
Definition at line 14801 of file expr.c. References FALSE, NULL, SCIP_EXPR_VARIDX, SCIPhashmapExists(), SCIPhashmapGetImage(), TRUE, SCIP_ExprGraph::varidxs, and SCIP_ExprGraph::varnodes. Referenced by SCIPexprgraphAddVars(), and SCIPexprgraphReplaceVarByLinearSum().
finds expression graph node corresponding to a constant
Definition at line 14830 of file expr.c. References SCIP_ExprGraph::constnodes, SCIP_ExprGraph::constssorted, SCIP_ExprGraphNode::data, exprgraphSortConstNodes(), FALSE, SCIP_ExprGraph::nconsts, NULL, SCIP_EXPR_CONST, and TRUE. Referenced by SCIPexprgraphAddConst(), SCIPexprgraphReplaceVarByLinearSum(), and SCIPexprgraphSimplify().
prints an expression graph in dot format
Definition at line 14878 of file expr.c. References SCIP_ExprGraph::depth, exprgraphPrintNodeDot(), SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, SCIP_ExprGraphNode::nparents, NULL, SCIP_OKAY, and SCIPmessageFPrintInfo(). Referenced by propagateBounds(), propagateConstraintSides(), SCIP_DECL_CONSINIT(), and SCIPexprgraphSimplify().
evaluates nodes of expression graph for given values of variables
Definition at line 14927 of file expr.c. References SCIP_ExprGraph::depth, exprgraphNodeEval(), SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, NULL, SCIP_ExprGraph::nvars, SCIP_CALL, and SCIP_OKAY. Referenced by computeViolations(), presolveUpgrade(), reformulate(), SCIP_DECL_CONSCHECK(), and SCIPexprgraphSimplify().
propagates bound changes in variables forward through the expression graph
Definition at line 14948 of file expr.c. References SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::depth, SCIP_ExprGraph::depth, exprgraphNodeUpdateBounds(), exprgraphUpdateVarNodeBounds(), FALSE, SCIP_ExprGraph::needvarboundprop, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, NULL, SCIP_ExprGraphNode::pos, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPintervalIsEmpty(), and TRUE. Referenced by propagateBounds(), reformulate(), and SCIP_DECL_CONSPRESOL().
propagates bound changes in nodes backward through the graph New bounds are not stored in varbounds, but only in nodes corresponding to variables. NOTE: it is assumed that SCIPexprgraphPropagateVarBounds was called before if variable bounds were relaxed.
Definition at line 15002 of file expr.c. References SCIP_ExprGraph::depth, exprgraphNodePropagateBounds(), FALSE, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, and NULL. Referenced by propagateBounds(), and propagateConstraintSides().
updates curvature information in expression graph nodes w.r.t. currently stored variable bounds Implies update of bounds in expression graph.
Definition at line 15034 of file expr.c. References SCIP_ExprGraphNode::bounds, SCIP_ExprGraphNode::curv, SCIP_ExprGraph::depth, exprgraphUpdateVarNodeBounds(), SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIPerrorMessage, SCIPexprgraphUpdateNodeBoundsCurvature(), and SCIPintervalIsEmpty().
aims at simplifying an expression graph A domain error can occur when variables were fixed to values for which a parent expression is not defined (e.g., 0^(-1) or log(-1)).
Definition at line 15077 of file expr.c. References SCIP_ExprGraph::blkmem, BMSallocMemoryArray, BMSfreeBlockMemoryArrayNull, BMSfreeMemoryArray, SCIP_ExprGraphNode::children, SCIP_ExprGraphNode::data, SCIP_ExprGraph::depth, ensureBlockMemoryArraySize, EPSZ, exprgraphMoveNode(), exprgraphNodeEval(), exprgraphNodeReplaceChild(), exprgraphNodeSimplify(), exprUnconvertPolynomial(), FALSE, SCIP_ExprGraphNode::nchildren, SCIP_ExprGraph::nnodes, SCIP_ExprGraph::nodes, SCIP_ExprGraphNode::nparents, NULL, SCIP_ExprGraphNode::nuses, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::parents, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_EXPR_CONST, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_SUM, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPexprgraphEval(), SCIPexprgraphFindConstNode(), SCIPexprgraphGetNodeVal(), SCIPexprgraphMoveNodeParents(), SCIPexprgraphPrintDot(), SCIPgetRandomReal(), SCIPhashmapCreate(), SCIPhashmapExists(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPhashmapInsert(), SCIPisFinite, SCIPrelDiff(), SCIP_ExprGraphNode::simplified, TRUE, and SCIP_ExprGraphNode::value. Referenced by SCIP_DECL_CONSEXITPRE(), and SCIP_DECL_CONSPRESOL().
creates an expression tree from a given node in an expression graph
Definition at line 15336 of file expr.c. References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_ExprGraphNode::depth, exprgraphNodeCreateExpr(), NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::pos, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPexprtreeCreate(), and SCIP_ExprGraph::vars. Referenced by createNlRow(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSPRINT(), SCIPexprgraphGetSeparableTrees(), SCIPexprgraphGetSumTrees(), and SCIPwriteGms().
creates a sum of expression trees with pairwise disjoint variables from a given node in an expression graph Giving SCIPexprgraphGetNodeNChildren() for exprtreesize is always sufficient.
Definition at line 15389 of file expr.c. References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, SCIP_ExprData_Monomial::childidxs, SCIP_ExprGraphNode::children, SCIP_ExprData_Monomial::coef, SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, SCIP_ExprData_Monomial::exponents, exprgraphNodeCheckSeparabilityComponent(), exprgraphNodeCreateExpr(), FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, MAX, MIN, SCIP_ExprData_Polynomial::monomials, SCIP_ExprGraphNode::nchildren, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::pos, SCIP_ExprData_Quadratic::quadelems, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_EXPR_CONST, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_QUADRATIC, SCIP_EXPR_SUM, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIPexprCreate(), SCIPexprCreateLinear(), SCIPexprCreateMonomial(), SCIPexprCreatePolynomial(), SCIPexprCreateQuadratic(), SCIPexprgraphGetTree(), SCIPexprtreeCreate(), TRUE, SCIP_ExprTree::vars, and SCIP_ExprGraph::vars.
returns how often expression graph variables are used in a subtree of the expression graph
Definition at line 15823 of file expr.c. References BMSclearMemoryArray, exprgraphNodeGetVarsUsage(), NULL, and SCIP_ExprGraph::nvars. Referenced by SCIP_DECL_CONSGETNVARS(), and SCIP_DECL_CONSGETVARS().
gives the number of summands which the expression of an expression graph node consists of
Definition at line 15839 of file expr.c. References SCIP_ExprGraphNode::data, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprGraphNode::nchildren, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprGraphNode::op, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_QUADRATIC, and SCIP_EXPR_SUM. Referenced by SCIP_DECL_CONSEXITPRE().
creates a sum of expression trees, possibly sharing variables, from a given node in an expression graph
Definition at line 15875 of file expr.c. References SCIP_ExprGraph::blkmem, BMSallocBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_ExprData_Monomial::childidxs, SCIP_ExprGraphNode::children, SCIP_ExprData_Monomial::coef, SCIP_QuadElement::coef, SCIP_ExprData_Quadratic::constant, SCIP_ExprData_Polynomial::constant, SCIP_ExprGraphNode::data, SCIP_ExprGraphNode::depth, EPSISINT, SCIP_ExprData_Monomial::exponents, exprgraphNodeCreateExpr(), FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_ExprData_Quadratic::lincoefs, SCIP_ExprData_Polynomial::monomials, SCIP_ExprGraphNode::nchildren, SCIP_ExprData_Monomial::nfactors, SCIP_ExprData_Polynomial::nmonomials, SCIP_ExprData_Quadratic::nquadelems, NULL, SCIP_ExprGraph::nvars, SCIP_ExprGraphNode::op, SCIP_ExprGraphNode::pos, SCIP_ExprData_Quadratic::quadelems, SCIP_ALLOC, SCIP_CALL, SCIP_ERROR, SCIP_EXPR_CONST, SCIP_EXPR_INTPOWER, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIPexprCreate(), SCIPexprCreateMonomial(), SCIPexprCreatePolynomial(), SCIPexprgraphGetTree(), SCIPexprtreeAddExpr(), SCIPexprtreeCreate(), SCIP_ExprTree::vars, and SCIP_ExprGraph::vars. Referenced by SCIP_DECL_CONSEXITPRE(). Variable Documentation
Initial value:
=
{
"unknown",
"convex",
"concave",
"linear"
}
curvature names as strings Definition at line 177 of file expr.c. Referenced by SCIPexprcurvGetName(). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||