Detailed Description
methods for expressions and expression trees
Functions | |
SCIP_EXPORT SCIP_VAR ** | SCIPexprtreeGetVars (SCIP_EXPRTREE *tree) |
SCIP_EXPORT SCIP_RETCODE | SCIPexprtreeSetVars (SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars) |
SCIP_EXPORT SCIP_RETCODE | SCIPexprtreeAddVars (SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars) |
SCIP_EXPORT SCIP_RETCODE | SCIPexprtreePrintWithNames (SCIP_EXPRTREE *tree, SCIP_MESSAGEHDLR *messagehdlr, FILE *file) |
SCIP_EXPORT int | SCIPexprtreeFindVar (SCIP_EXPRTREE *tree, SCIP_VAR *var) |
SCIP_EXPORT SCIP_RETCODE | SCIPgetExprtreeTransformedVars (SCIP *scip, SCIP_EXPRTREE *tree) |
SCIP_EXPORT SCIP_RETCODE | SCIPevalExprtreeSol (SCIP *scip, SCIP_EXPRTREE *tree, SCIP_SOL *sol, SCIP_Real *val) |
SCIP_EXPORT SCIP_RETCODE | SCIPevalExprtreeGlobalBounds (SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val) |
SCIP_EXPORT SCIP_RETCODE | SCIPevalExprtreeLocalBounds (SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val) |
Function Documentation
◆ SCIPexprtreeGetVars()
SCIP_EXPORT SCIP_VAR** SCIPexprtreeGetVars | ( | SCIP_EXPRTREE * | tree | ) |
returns variables of expression tree
- Parameters
-
tree expression tree
Definition at line 102 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(), getLinearAndQuadraticCoefs(), initSepaData(), isConvexLocal(), nlpAddNlRows(), nlpSetupNlpiIndices(), nlrowCalcActivityBounds(), nlrowExprtreeChanged(), printNonlinearRow(), printRowNl(), processNlRow(), readObjective(), registerBranchingVariables(), registerLargeRelaxValueVariableForBranching(), removeFixedVariables(), replaceViolatedByLinearConstraints(), 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().
◆ SCIPexprtreeSetVars()
SCIP_EXPORT SCIP_RETCODE SCIPexprtreeSetVars | ( | SCIP_EXPRTREE * | tree, |
int | nvars, | ||
SCIP_VAR ** | vars | ||
) |
stores array of variables in expression tree
- Parameters
-
tree expression tree nvars number of variables vars variables
Definition at line 112 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().
◆ SCIPexprtreeAddVars()
SCIP_EXPORT SCIP_RETCODE SCIPexprtreeAddVars | ( | SCIP_EXPRTREE * | tree, |
int | nvars, | ||
SCIP_VAR ** | vars | ||
) |
adds variables to the expression tree variables array
- Parameters
-
tree expression tree nvars number of variables vars variables
Definition at line 144 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().
◆ SCIPexprtreePrintWithNames()
SCIP_EXPORT SCIP_RETCODE SCIPexprtreePrintWithNames | ( | SCIP_EXPRTREE * | tree, |
SCIP_MESSAGEHDLR * | messagehdlr, | ||
FILE * | file | ||
) |
prints an expression tree using variable names from variables array
- Parameters
-
tree expression tree messagehdlr message handler file file for printing, or NULL for stdout
Definition at line 173 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().
◆ SCIPexprtreeFindVar()
SCIP_EXPORT 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!
- Parameters
-
tree expression tree var variable to search for
Definition at line 206 of file nlp.c.
References NULL, SCIP_ExprTree::nvars, and SCIP_ExprTree::vars.
Referenced by nlpDelVarPos(), and nlrowRemoveFixedVar().
◆ SCIPgetExprtreeTransformedVars()
SCIP_EXPORT SCIP_RETCODE SCIPgetExprtreeTransformedVars | ( | SCIP * | scip, |
SCIP_EXPRTREE * | tree | ||
) |
replaces array of variables in expression tree by corresponding transformed variables
- Returns
- SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
- Precondition
- This method can be called if
scip
is in one of the following stages:
See SCIP_STAGE for a complete list of all possible solving stages.
- Parameters
-
scip SCIP data structure tree expression tree
Definition at line 74 of file scip_expr.c.
References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcheckStage(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPgetTransformedVars(), and TRUE.
Referenced by SCIP_DECL_CONSTRANS().
◆ SCIPevalExprtreeSol()
SCIP_EXPORT 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
- Returns
- SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
- Precondition
- This method can be called if
scip
is in one of the following stages:
See SCIP_STAGE for a complete list of all possible solving stages.
- Parameters
-
scip SCIP data structure tree expression tree sol a solution, or NULL for current LP solution val buffer to store value
Definition at line 113 of file scip_expr.c.
References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcheckStage(), SCIPexprtreeEval(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPgetSolVals(), and TRUE.
◆ SCIPevalExprtreeGlobalBounds()
SCIP_EXPORT SCIP_RETCODE SCIPevalExprtreeGlobalBounds | ( | SCIP * | scip, |
SCIP_EXPRTREE * | tree, | ||
SCIP_Real | infinity, | ||
SCIP_INTERVAL * | val | ||
) |
evaluates an expression tree w.r.t. current global bounds
- Returns
- SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
- Precondition
- This method can be called if
scip
is in one of the following stages:
See SCIP_STAGE for a complete list of all possible solving stages.
- Parameters
-
scip SCIP data structure tree expression tree infinity value to use for infinity val buffer to store result
Definition at line 168 of file scip_expr.c.
References FALSE, infty2infty, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPcheckStage(), SCIPexprtreeEvalInt(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPinfinity(), SCIPintervalSetBounds(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), and TRUE.
◆ SCIPevalExprtreeLocalBounds()
SCIP_EXPORT SCIP_RETCODE SCIPevalExprtreeLocalBounds | ( | SCIP * | scip, |
SCIP_EXPRTREE * | tree, | ||
SCIP_Real | infinity, | ||
SCIP_INTERVAL * | val | ||
) |
evaluates an expression tree w.r.t. current local bounds
- Returns
- SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
- Precondition
- This method can be called if
scip
is in one of the following stages:
See SCIP_STAGE for a complete list of all possible solving stages.
- Parameters
-
scip SCIP data structure tree expression tree infinity value to use for infinity val buffer to store result
Definition at line 233 of file scip_expr.c.
References FALSE, infty2infty, MAX, MIN, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPcheckStage(), SCIPexprtreeEvalInt(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPinfinity(), SCIPintervalSetBounds(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by enforceViolatedFixedNonlinear(), and replaceViolatedByLinearConstraints().