methods for expressions and expression trees
Functions | |
SCIP_VAR ** | SCIPexprtreeGetVars (SCIP_EXPRTREE *tree) |
SCIP_RETCODE | SCIPexprtreeSetVars (SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars) |
SCIP_RETCODE | SCIPexprtreeAddVars (SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars) |
SCIP_RETCODE | SCIPexprtreePrintWithNames (SCIP_EXPRTREE *tree, SCIP_MESSAGEHDLR *messagehdlr, FILE *file) |
int | SCIPexprtreeFindVar (SCIP_EXPRTREE *tree, SCIP_VAR *var) |
SCIP_RETCODE | SCIPgetExprtreeTransformedVars (SCIP *scip, SCIP_EXPRTREE *tree) |
SCIP_RETCODE | SCIPevalExprtreeSol (SCIP *scip, SCIP_EXPRTREE *tree, SCIP_SOL *sol, SCIP_Real *val) |
SCIP_RETCODE | SCIPevalExprtreeGlobalBounds (SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val) |
SCIP_RETCODE | SCIPevalExprtreeLocalBounds (SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val) |
SCIP_VAR** SCIPexprtreeGetVars | ( | SCIP_EXPRTREE * | tree | ) |
returns variables of expression tree
tree | expression tree |
Definition at line 101 of file nlp.c.
References NULL, and SCIP_ExprTree::vars.
Referenced by addConcaveEstimatorBivariate(), addConcaveEstimatorMultivariate(), addConcaveEstimatorUnivariate(), addIntervalGradientEstimator(), addLinearization(), addUserEstimator(), checkCurvature(), computeGradient(), computeViolation(), consdataAddExprtrees(), generate1ConvexIndefiniteUnderestimator(), generate1ConvexIndefiniteUnderestimatorAtBoundary(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), generateConvexConcaveEstimator(), generateConvexConcaveUnderestimator(), generateCut(), generateEstimatingHyperplane(), generateLinearizationCut(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateOverestimatingHyperplaneCut(), generateUnderestimatorParallelYFacets(), getGradientMaxElement(), getLinearAndQuadraticCoefs(), initSepaData(), isConvexLocal(), nlpAddNlRows(), nlpSetupNlpiIndices(), nlrowCalcActivityBounds(), nlrowExprtreeChanged(), printNonlinearRow(), printRowNl(), processNlRow(), readObjective(), registerBranchingVariables(), registerLargeRelaxValueVariableForBranching(), removeFixedVariables(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSENFOPS(), SCIP_DECL_CONSEXITPRE(), SCIP_DECL_CONSGETVARS(), SCIP_DECL_CONSINITLP(), SCIP_DECL_CONSTRANS(), SCIP_DECL_EVENTEXEC(), SCIPcreateConsBivariate(), SCIPcreateNlpiProb(), SCIPevalExprtreeGlobalBounds(), SCIPevalExprtreeLocalBounds(), SCIPevalExprtreeSol(), SCIPgetExprtreeTransformedVars(), SCIPnlpGetVarsNonlinearity(), SCIPnlpHasContinuousNonlinearity(), SCIPnlrowGetSolActivity(), SCIPnlrowRecalcNLPActivity(), SCIPnlrowRecalcPseudoActivity(), and SCIPwritePip().
SCIP_RETCODE SCIPexprtreeSetVars | ( | SCIP_EXPRTREE * | tree, |
int | nvars, | ||
SCIP_VAR ** | vars | ||
) |
stores array of variables in expression tree
tree | expression tree |
nvars | number of variables |
vars | variables |
Definition at line 111 of file nlp.c.
References SCIP_ExprTree::blkmem, BMScopyMemoryArray, BMSduplicateBlockMemoryArray, BMSfreeBlockMemoryArrayNull, BMSreallocBlockMemoryArray, NULL, SCIP_ExprTree::nvars, SCIP_ALLOC, SCIP_OKAY, and SCIP_ExprTree::vars.
Referenced by createConsFromQuadTerm(), createExprtreeFromMonomial(), createNlRow(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), initSepaData(), readNonlinearExprs(), readPolynomial(), removeFixedVariables(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSTRANS(), SCIPwritePip(), and setupProblem().
SCIP_RETCODE SCIPexprtreeAddVars | ( | SCIP_EXPRTREE * | tree, |
int | nvars, | ||
SCIP_VAR ** | vars | ||
) |
adds variables to the expression tree variables array
tree | expression tree |
nvars | number of variables |
vars | variables |
Definition at line 143 of file nlp.c.
References SCIP_ExprTree::blkmem, BMScopyMemoryArray, BMSduplicateBlockMemoryArray, BMSreallocBlockMemoryArray, NULL, SCIP_ExprTree::nvars, SCIP_ALLOC, SCIP_OKAY, and SCIP_ExprTree::vars.
Referenced by createNlRow(), and SCIPexprtreeRemoveFixedVars().
SCIP_RETCODE SCIPexprtreePrintWithNames | ( | SCIP_EXPRTREE * | tree, |
SCIP_MESSAGEHDLR * | messagehdlr, | ||
FILE * | file | ||
) |
prints an expression tree using variable names from variables array
tree | expression tree |
messagehdlr | message handler |
file | file for printing, or NULL for stdout |
Definition at line 172 of file nlp.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, NULL, SCIP_ExprTree::nvars, SCIP_ALLOC, SCIP_OKAY, SCIPexprtreePrint(), SCIPvarGetName(), and SCIP_ExprTree::vars.
Referenced by checkCurvature(), generate1ConvexIndefiniteUnderestimatorAtBoundary(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), generateConvexConcaveUnderestimator(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), readPolynomial(), SCIP_DECL_CONSPRINT(), and SCIPnlrowPrint().
int SCIPexprtreeFindVar | ( | SCIP_EXPRTREE * | tree, |
SCIP_VAR * | var | ||
) |
searches the variables array of an expression tree for a variable and returns its position, or -1 if not found Note that this is an O(n) operation!
tree | expression tree |
var | variable to search for |
Definition at line 205 of file nlp.c.
References NULL, SCIP_ExprTree::nvars, and SCIP_ExprTree::vars.
Referenced by nlpDelVarPos(), and nlrowRemoveFixedVar().
SCIP_RETCODE SCIPgetExprtreeTransformedVars | ( | SCIP * | scip, |
SCIP_EXPRTREE * | tree | ||
) |
replaces array of variables in expression tree by corresponding transformed variables
scip
is in one of the following stages:
See SCIP_STAGE for a complete list of all possible solving stages.
scip | SCIP data structure |
tree | expression tree |
Definition at line 32804 of file scip.c.
References checkStage(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPgetTransformedVars(), and TRUE.
Referenced by SCIP_DECL_CONSTRANS().
SCIP_RETCODE SCIPevalExprtreeSol | ( | SCIP * | scip, |
SCIP_EXPRTREE * | tree, | ||
SCIP_SOL * | sol, | ||
SCIP_Real * | val | ||
) |
evaluates an expression tree for a primal solution or LP solution
scip
is in one of the following stages:
See SCIP_STAGE for a complete list of all possible solving stages.
scip | SCIP data structure |
tree | expression tree |
sol | a solution, or NULL for current LP solution |
val | buffer to store value |
Definition at line 32843 of file scip.c.
References checkStage(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPexprtreeEval(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPgetSolVals(), and TRUE.
SCIP_RETCODE SCIPevalExprtreeGlobalBounds | ( | SCIP * | scip, |
SCIP_EXPRTREE * | tree, | ||
SCIP_Real | infinity, | ||
SCIP_INTERVAL * | val | ||
) |
evaluates an expression tree w.r.t. current global bounds
scip
is in one of the following stages:
See SCIP_STAGE for a complete list of all possible solving stages.
scip | SCIP data structure |
tree | expression tree |
infinity | value to use for infinity |
val | buffer to store result |
Definition at line 32898 of file scip.c.
References checkStage(), FALSE, infty2infty, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPexprtreeEvalInt(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPinfinity(), SCIPintervalSetBounds(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), and TRUE.
SCIP_RETCODE SCIPevalExprtreeLocalBounds | ( | SCIP * | scip, |
SCIP_EXPRTREE * | tree, | ||
SCIP_Real | infinity, | ||
SCIP_INTERVAL * | val | ||
) |
evaluates an expression tree w.r.t. current local bounds
scip
is in one of the following stages:
See SCIP_STAGE for a complete list of all possible solving stages.
scip | SCIP data structure |
tree | expression tree |
infinity | value to use for infinity |
val | buffer to store result |
Definition at line 32963 of file scip.c.
References checkStage(), FALSE, infty2infty, MAX, MIN, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPexprtreeEvalInt(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPinfinity(), SCIPintervalSetBounds(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by enforceViolatedFixedNonlinear(), and replaceViolatedByLinearConstraints().