exprinterpret_cppad.cpp File Reference Detailed Descriptionmethods to interpret (evaluate) an expression tree "fast" using CppAD Definition in file exprinterpret_cppad.cpp. #include "scip/def.h" #include "blockmemshell/memory.h" #include "nlpi/pub_expr.h" #include "nlpi/exprinterpret.h" #include <cmath> #include <vector> #include "nlpi/intervalarithext.h" #include <cppad/cppad.hpp> #include <cppad/error_handler.hpp> #include <pthread.h> Go to the source code of this file.
Macro Definition Documentation
sign of a value (-1 or +1) 0.0 has sign +1 Definition at line 56 of file exprinterpret_cppad.cpp. Referenced by atomic_signpower< Type >::atomic_signpower().
Definition at line 60 of file exprinterpret_cppad.cpp.
Definition at line 71 of file exprinterpret_cppad.cpp. Function Documentation
definition of CondExpOp for SCIPInterval (required by CppAD) Definition at line 191 of file exprinterpret_cppad.cpp.
another function that returns whether two intervals are the same (required by CppAD)
Definition at line 208 of file exprinterpret_cppad.cpp.
another function required by CppAD
Definition at line 218 of file exprinterpret_cppad.cpp.
returns whether the interval equals [0,0]
Definition at line 227 of file exprinterpret_cppad.cpp.
returns whether the interval equals [1,1]
Definition at line 236 of file exprinterpret_cppad.cpp.
yet another function that checks whether two intervals are equal
Definition at line 245 of file exprinterpret_cppad.cpp.
greater than zero not defined for intervals
Definition at line 255 of file exprinterpret_cppad.cpp.
greater than or equal zero not defined for intervals
Definition at line 269 of file exprinterpret_cppad.cpp.
less than not defined for intervals
Definition at line 283 of file exprinterpret_cppad.cpp.
less than or equal not defined for intervals
Definition at line 297 of file exprinterpret_cppad.cpp.
conversion to integers not defined for intervals
Definition at line 311 of file exprinterpret_cppad.cpp.
printing of an interval (required by CppAD) Definition at line 325 of file exprinterpret_cppad.cpp. References NULL, and SCIP_EXPRINTCAPABILITY_ALL.
template<class Type >
Definition at line 1211 of file exprinterpret_cppad.cpp. References SCIPexprEvalUser(). Referenced by atomic_userexpr< Type >::atomic_userexpr().
template<>
Definition at line 1223 of file exprinterpret_cppad.cpp. References SCIPInterval::infinity, and SCIPexprEvalIntUser().
template<>
specialization of minimum evaluation for real numbers
Definition at line 1656 of file exprinterpret_cppad.cpp. References evalMax(). Referenced by atomic_userexpr< Type >::atomic_userexpr(), and evalAbs().
template<>
template<>
specialization of absolute value evaluation for intervals Use sqrt(x^2) for now
Definition at line 1725 of file exprinterpret_cppad.cpp. References cos(), evalMax(), evalMin(), exp(), log(), NULL, pow(), SCIP_CALL, SCIP_ERROR, SCIP_EXPR_ABS, SCIP_EXPR_CONST, SCIP_EXPR_COS, SCIP_EXPR_DIV, SCIP_EXPR_EXP, SCIP_EXPR_INTPOWER, SCIP_EXPR_LAST, SCIP_EXPR_LINEAR, SCIP_EXPR_LOG, SCIP_EXPR_MAX, SCIP_EXPR_MIN, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PARAM, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SIGN, SCIP_EXPR_SIGNPOWER, SCIP_EXPR_SIN, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_EXPR_TAN, SCIP_EXPR_USER, SCIP_EXPR_VARIDX, SCIP_NOMEMORY, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPexprGetChildren(), SCIPexprGetIntPowerExponent(), SCIPexprGetLinearCoefs(), SCIPexprGetLinearConstant(), SCIPexprGetMonomialChildIndices(), SCIPexprGetMonomialCoef(), SCIPexprGetMonomialExponents(), SCIPexprGetMonomialNFactors(), SCIPexprGetMonomials(), SCIPexprGetNChildren(), SCIPexprGetNMonomials(), SCIPexprGetNQuadElements(), SCIPexprGetOperator(), SCIPexprGetOpIndex(), SCIPexprGetOpReal(), SCIPexprGetPolynomialConstant(), SCIPexprGetQuadConstant(), SCIPexprGetQuadElements(), SCIPexprGetQuadLinearCoefs(), SCIPexprGetRealPowerExponent(), SCIPexprGetUserEvalCapability(), SCIPexprSortQuadElems(), sign(), sin(), and sqrt(). Referenced by evalMax().
gets name and version of expression interpreter Definition at line 2157 of file exprinterpret_cppad.cpp.
gets descriptive text of expression interpreter Definition at line 2163 of file exprinterpret_cppad.cpp.
gets capabilities of expression interpreter (using bitflags) Definition at line 2169 of file exprinterpret_cppad.cpp. References SCIP_EXPRINTCAPABILITY_FUNCVALUE, SCIP_EXPRINTCAPABILITY_GRADIENT, SCIP_EXPRINTCAPABILITY_HESSIAN, SCIP_EXPRINTCAPABILITY_INTFUNCVALUE, and SCIP_EXPRINTCAPABILITY_INTGRADIENT.
creates an expression interpreter object
Definition at line 2179 of file exprinterpret_cppad.cpp. References NULL, SCIP_NOMEMORY, and SCIP_OKAY.
frees an expression interpreter object
Definition at line 2196 of file exprinterpret_cppad.cpp.
compiles an expression tree and stores compiled data in expression tree
Definition at line 2209 of file exprinterpret_cppad.cpp. References NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprCopyDeep(), SCIPexprFreeDeep(), SCIPexprtreeGetInterpreterData(), SCIPexprtreeGetNVars(), SCIPexprtreeGetRoot(), and SCIPexprtreeSetInterpreterData().
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.
Definition at line 2264 of file exprinterpret_cppad.cpp. References NULL, and SCIPexprtreeGetInterpreterData().
frees interpreter data
Definition at line 2278 of file exprinterpret_cppad.cpp. References NULL, SCIP_OKAY, and SCIPexprFreeDeep().
notify expression interpreter that a new parameterization is used This probably causes retaping by AD algorithms.
Definition at line 2298 of file exprinterpret_cppad.cpp. References NULL, SCIP_OKAY, and SCIPexprtreeGetInterpreterData().
evaluates an expression tree
Definition at line 2317 of file exprinterpret_cppad.cpp. References NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprtreeEval(), SCIPexprtreeGetInterpreterData(), SCIPexprtreeGetNVars(), SCIPexprtreeGetParamVals(), and SCIPexprtreeGetRoot(). Referenced by SCIPexprintGrad(), SCIPexprintHessianDense(), and SCIPexprintHessianSparsityDense().
evaluates an expression tree on intervals
Definition at line 2385 of file exprinterpret_cppad.cpp. References SCIPInterval::infinity, NULL, SCIP_CALL, SCIP_OKAY, SCIPexprtreeEvalInt(), SCIPexprtreeGetInterpreterData(), SCIPexprtreeGetNVars(), SCIPexprtreeGetParamVals(), and SCIPexprtreeGetRoot(). Referenced by SCIPexprintGradInt().
computes value and gradient of an expression tree
Definition at line 2451 of file exprinterpret_cppad.cpp. References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPexprintEval(), SCIPexprtreeGetInterpreterData(), and SCIPexprtreeGetNVars().
computes interval value and interval gradient of an expression tree
Definition at line 2498 of file exprinterpret_cppad.cpp. References NULL, SCIP_CALL, SCIP_OKAY, SCIPexprintEvalInt(), SCIPexprtreeGetInterpreterData(), and SCIPexprtreeGetNVars().
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.
Definition at line 2548 of file exprinterpret_cppad.cpp. References NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPexprintEval(), SCIPexprtreeGetInterpreterData(), SCIPexprtreeGetNVars(), and TRUE.
computes value and dense hessian of an expression tree The full hessian is computed (lower left and upper right triangle).
Definition at line 2621 of file exprinterpret_cppad.cpp. References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPexprintEval(), SCIPexprtreeGetInterpreterData(), and SCIPexprtreeGetNVars(). |