Detailed Description
methods and files provided by the default expression interpreters of SCIP
A detailed description what a expression interpreter does and how to add a expression interpreter to SCIP can be found here.
Modules | |
Inclusion methods | |
methods to include specific expression interpreters into SCIP | |
Files | |
file | exprinterpret_cppad.cpp |
methods to interpret (evaluate) an expression tree "fast" using CppAD | |
file | exprinterpret_none.c |
function definitions for nonexisting expression interpreter to resolve linking references | |
Function Documentation
◆ SCIPexprintGetName()
SCIP_EXPORT const char* SCIPexprintGetName | ( | void | ) |
gets name and version of expression interpreter
Definition at line 2135 of file exprinterpret_cppad.cpp.
Referenced by doScipCreate(), SCIP_DECL_CONSINIT(), and SCIPnlpiOracleCreate().
◆ SCIPexprintGetDesc()
SCIP_EXPORT const char* SCIPexprintGetDesc | ( | void | ) |
gets descriptive text of expression interpreter
Definition at line 2141 of file exprinterpret_cppad.cpp.
Referenced by doScipCreate().
◆ SCIPexprintGetCapability()
SCIP_EXPORT SCIP_EXPRINTCAPABILITY SCIPexprintGetCapability | ( | void | ) |
gets capabilities of expression interpreter (using bitflags)
Definition at line 2147 of file exprinterpret_cppad.cpp.
References SCIP_EXPRINTCAPABILITY_FUNCVALUE, SCIP_EXPRINTCAPABILITY_GRADIENT, SCIP_EXPRINTCAPABILITY_HESSIAN, SCIP_EXPRINTCAPABILITY_INTFUNCVALUE, SCIP_EXPRINTCAPABILITY_INTGRADIENT, and SCIP_EXPRINTCAPABILITY_NONE.
Referenced by addIntervalGradientEstimator(), processNlRow(), and SCIP_DECL_NLPISOLVE().
◆ SCIPexprintCreate()
SCIP_EXPORT SCIP_RETCODE SCIPexprintCreate | ( | BMS_BLKMEM * | blkmem, |
SCIP_EXPRINT ** | exprint | ||
) |
creates an expression interpreter object
- Parameters
-
blkmem block memory data structure exprint buffer to store pointer to expression interpreter
Definition at line 2157 of file exprinterpret_cppad.cpp.
References BMSallocBlockMemory, NULL, SCIP_NOMEMORY, SCIP_OKAY, and SCIPdebugMessage.
Referenced by applyHeur(), createCoveringProblem(), SCIP_DECL_SEPAEXECLP(), SCIPincludeConshdlrBivariate(), SCIPincludeConshdlrNonlinear(), and SCIPnlpiOracleCreate().
◆ SCIPexprintFree()
SCIP_EXPORT SCIP_RETCODE SCIPexprintFree | ( | SCIP_EXPRINT ** | exprint | ) |
frees an expression interpreter object
- Parameters
-
exprint expression interpreter that should be freed
Definition at line 2174 of file exprinterpret_cppad.cpp.
References BMSfreeBlockMemory, NULL, and SCIP_OKAY.
Referenced by createCoveringProblem(), SCIP_DECL_CONSFREE(), SCIP_DECL_SEPAEXITSOL(), SCIPnlpiOracleFree(), and sepadataClear().
◆ SCIPexprintCompile()
SCIP_EXPORT SCIP_RETCODE SCIPexprintCompile | ( | SCIP_EXPRINT * | exprint, |
SCIP_EXPRTREE * | tree | ||
) |
compiles an expression tree and stores compiled data in expression tree
- Parameters
-
exprint interpreter data structure tree expression tree
Definition at line 2187 of file exprinterpret_cppad.cpp.
References analyzeTree(), SCIP_ExprInt::blkmem, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprCopyDeep(), SCIPexprFreeDeep(), SCIPexprtreeGetInterpreterData(), SCIPexprtreeGetNVars(), SCIPexprtreeGetRoot(), and SCIPexprtreeSetInterpreterData().
Referenced by addIntervalGradientEstimator(), addLinearization(), computeGradient(), computeViolation(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), generateLinearizationCut(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), initSepaData(), processNlRow(), SCIP_DECL_CONSINITLP(), SCIPnlpiOracleAddConstraints(), SCIPnlpiOracleChgExprtree(), and SCIPnlpiOracleSetObjective().
◆ SCIPexprintGetExprtreeCapability()
SCIP_EXPORT SCIP_EXPRINTCAPABILITY SCIPexprintGetExprtreeCapability | ( | SCIP_EXPRINT * | exprint, |
SCIP_EXPRTREE * | tree | ||
) |
gives the capability to evaluate an expression by the expression interpreter
In cases of user-given expressions, higher order derivatives may not be available for the user-expression, even if the expression interpreter could handle these. This method allows to recognize that, e.g., the Hessian for an expression is not available because it contains a user expression that does not provide Hessians.
- Parameters
-
exprint interpreter data structure tree expression tree
Definition at line 2242 of file exprinterpret_cppad.cpp.
References NULL, SCIP_EXPRINTCAPABILITY_NONE, and SCIPexprtreeGetInterpreterData().
Referenced by SCIPnlpiOracleGetEvalCapability().
◆ SCIPexprintFreeData()
SCIP_EXPORT SCIP_RETCODE SCIPexprintFreeData | ( | SCIP_EXPRINTDATA ** | interpreterdata | ) |
frees interpreter data
- Parameters
-
interpreterdata interpreter data that should freed
Definition at line 2256 of file exprinterpret_cppad.cpp.
References NULL, SCIP_OKAY, and SCIPexprFreeDeep().
Referenced by SCIPexprtreeFreeInterpreterData().
◆ SCIPexprintNewParametrization()
SCIP_EXPORT SCIP_RETCODE SCIPexprintNewParametrization | ( | SCIP_EXPRINT * | exprint, |
SCIP_EXPRTREE * | tree | ||
) |
notify expression interpreter that a new parameterization is used this probably causes retaping by AD algorithms
notify expression interpreter that a new parameterization is used
This probably causes retaping by AD algorithms.
- Parameters
-
exprint interpreter data structure tree expression tree
Definition at line 2276 of file exprinterpret_cppad.cpp.
References NULL, SCIP_OKAY, and SCIPexprtreeGetInterpreterData().
Referenced by generateConvexConcaveUnderestimator().
◆ SCIPexprintEval()
SCIP_EXPORT SCIP_RETCODE SCIPexprintEval | ( | SCIP_EXPRINT * | exprint, |
SCIP_EXPRTREE * | tree, | ||
SCIP_Real * | varvals, | ||
SCIP_Real * | val | ||
) |
evaluates an expression tree
- Parameters
-
exprint interpreter data structure tree expression tree varvals values of variables val buffer to store value
Definition at line 2295 of file exprinterpret_cppad.cpp.
References eval(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPdebugMessage, SCIPerrorMessage, SCIPexprtreeEval(), SCIPexprtreeGetInterpreterData(), SCIPexprtreeGetNVars(), SCIPexprtreeGetParamVals(), and SCIPexprtreeGetRoot().
Referenced by addIntervalGradientEstimator(), computeViolation(), evalFunctionValue(), generateConvexConcaveUnderestimator(), generateEstimatingHyperplane(), SCIPexprintGrad(), SCIPexprintHessianDense(), SCIPexprintHessianSparsityDense(), and SCIPnlpiOracleEvalJacobian().
◆ SCIPexprintEvalInt()
SCIP_EXPORT SCIP_RETCODE SCIPexprintEvalInt | ( | SCIP_EXPRINT * | exprint, |
SCIP_EXPRTREE * | tree, | ||
SCIP_Real | infinity, | ||
SCIP_INTERVAL * | varvals, | ||
SCIP_INTERVAL * | val | ||
) |
evaluates an expression tree on intervals
- Parameters
-
exprint interpreter data structure tree expression tree infinity value for infinity varvals interval values of variables val buffer to store interval value of expression
Definition at line 2363 of file exprinterpret_cppad.cpp.
References eval(), infinity, NULL, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPerrorMessage, SCIPexprtreeEvalInt(), SCIPexprtreeGetInterpreterData(), SCIPexprtreeGetNVars(), SCIPexprtreeGetParamVals(), and SCIPexprtreeGetRoot().
Referenced by SCIPexprintGradInt().
◆ SCIPexprintGrad()
SCIP_EXPORT SCIP_RETCODE SCIPexprintGrad | ( | SCIP_EXPRINT * | exprint, |
SCIP_EXPRTREE * | tree, | ||
SCIP_Real * | varvals, | ||
SCIP_Bool | new_varvals, | ||
SCIP_Real * | val, | ||
SCIP_Real * | gradient | ||
) |
computes value and gradient of an expression tree
- Parameters
-
exprint interpreter data structure tree expression tree varvals values of variables, can be NULL if new_varvals is FALSE new_varvals have variable values changed since last call to a point evaluation routine? val buffer to store expression value gradient buffer to store expression gradient, need to have length at least SCIPexprtreeGetNVars(tree)
Definition at line 2429 of file exprinterpret_cppad.cpp.
References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPerrorMessage, SCIPexprintEval(), SCIPexprtreeGetInterpreterData(), and SCIPexprtreeGetNVars().
Referenced by addLinearization(), computeGradient(), evalFunctionGradient(), generate1ConvexIndefiniteUnderestimatorAtBoundary(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), generateConvexConcaveUnderestimator(), generateLinearizationCut(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateUnderestimatorParallelYFacets(), lifting(), SCIPnlpiOracleEvalJacobian(), and solveDerivativeEquation().
◆ SCIPexprintGradInt()
SCIP_EXPORT SCIP_RETCODE SCIPexprintGradInt | ( | SCIP_EXPRINT * | exprint, |
SCIP_EXPRTREE * | tree, | ||
SCIP_Real | infinity, | ||
SCIP_INTERVAL * | varvals, | ||
SCIP_Bool | new_varvals, | ||
SCIP_INTERVAL * | val, | ||
SCIP_INTERVAL * | gradient | ||
) |
computes interval value and interval gradient of an expression tree
- Parameters
-
exprint interpreter data structure tree expression tree infinity value for infinity varvals interval values of variables, can be NULL if new_varvals is FALSE new_varvals have variable interval values changed since last call to an interval evaluation routine? val buffer to store expression interval value gradient buffer to store expression interval gradient, need to have length at least SCIPexprtreeGetNVars(tree)
Definition at line 2476 of file exprinterpret_cppad.cpp.
References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPerrorMessage, SCIPexprintEvalInt(), SCIPexprtreeGetInterpreterData(), and SCIPexprtreeGetNVars().
Referenced by addIntervalGradientEstimator().
◆ SCIPexprintHessianSparsityDense()
SCIP_EXPORT SCIP_RETCODE SCIPexprintHessianSparsityDense | ( | SCIP_EXPRINT * | exprint, |
SCIP_EXPRTREE * | tree, | ||
SCIP_Real * | varvals, | ||
SCIP_Bool * | sparsity | ||
) |
gives sparsity pattern of hessian
NOTE: this function might be replaced later by something nicer. Since the AD code might need to do a forward sweep, you should pass variable values in here.
gives sparsity pattern of hessian NOTE: this function might be replaced later by something nicer Since the AD code might need to do a forward sweep, you should pass variable values in here.
- Parameters
-
exprint interpreter data structure tree expression tree varvals values of variables sparsity buffer to store sparsity pattern of Hessian, sparsity[i+n*j] indicates whether entry (i,j) is nonzero in the hessian
Definition at line 2526 of file exprinterpret_cppad.cpp.
References NULL, r, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIP_Real, SCIPdebugMessage, SCIPerrorMessage, SCIPexprintEval(), SCIPexprtreeGetInterpreterData(), SCIPexprtreeGetNVars(), and TRUE.
Referenced by hessLagSparsitySetNzFlagForExprtree(), initSepaData(), and processNlRow().
◆ SCIPexprintHessianDense()
SCIP_EXPORT SCIP_RETCODE SCIPexprintHessianDense | ( | SCIP_EXPRINT * | exprint, |
SCIP_EXPRTREE * | tree, | ||
SCIP_Real * | varvals, | ||
SCIP_Bool | new_varvals, | ||
SCIP_Real * | val, | ||
SCIP_Real * | hessian | ||
) |
computes value and dense hessian of an expression tree
The full hessian is computed (lower left and upper right triangle).
computes value and dense hessian of an expression tree the full hessian is computed (lower left and upper right triangle)
- Parameters
-
exprint interpreter data structure tree expression tree varvals values of variables, can be NULL if new_varvals is FALSE new_varvals have variable values changed since last call to an evaluation routine? val buffer to store function value hessian buffer to store hessian values, need to have size at least n*n
Definition at line 2599 of file exprinterpret_cppad.cpp.
References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPerrorMessage, SCIPexprintEval(), SCIPexprtreeGetInterpreterData(), and SCIPexprtreeGetNVars().
Referenced by generate1ConvexIndefiniteUnderestimator(), hessLagAddExprtree(), and solveDerivativeEquation().