All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Detailed Descriptionmethods to store an NLP and request function, gradient, and hessian values Not a full NLPI, but implements a common part of many NLPIs that takes care of the problem storage and function, gradient, and hessian evaluation. Definition in file nlpioracle.h. Go to the source code of this file.
Typedef Documentation
NLPI oracle data structure Definition at line 35 of file nlpioracle.h. Function Documentation
creates an NLPIORACLE data structure
Definition at line 1320 of file nlpioracle.c. References BMSallocMemory, BMSclearMemory, createConstraint(), NULL, SCIP_ALLOC, SCIP_CALL, SCIP_DEFAULT_INFINITY, SCIP_OKAY, SCIPdebugMessage, SCIPexprintCreate(), SCIPexprintGetName(), and TRUE. Referenced by SCIP_DECL_NLPICREATEPROBLEM().
frees an NLPIORACLE data structure
Definition at line 1347 of file nlpioracle.c. References BMSfreeMemory, freeConstraint(), freeConstraints(), freeVariables(), invalidateHessianLagSparsity(), invalidateJacobiSparsity(), NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprintFree(), and SCIPnlpiOracleSetProblemName(). Referenced by SCIP_DECL_NLPIFREEPROBLEM().
sets the value for infinity
Definition at line 1376 of file nlpioracle.c. References SCIP_NlpiOracle::infinity, NULL, SCIP_OKAY, and SCIPdebugMessage. Referenced by SCIP_DECL_NLPICREATEPROBLEM(), and SCIP_DECL_NLPISETREALPAR().
gets the value for infinity
Definition at line 1392 of file nlpioracle.c. References SCIP_NlpiOracle::infinity, NULL, and SCIPdebugMessage. Referenced by SCIP_DECL_NLPIGETREALPAR().
sets the problem name (used for printing)
Definition at line 1404 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, BMSduplicateBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_NlpiOracle::name, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage. Referenced by SCIP_DECL_NLPICREATEPROBLEM(), and SCIPnlpiOracleFree().
gets the problem name, or NULL if none set
Definition at line 1427 of file nlpioracle.c. References SCIP_NlpiOracle::name, NULL, and SCIPdebugMessage.
adds variables
Definition at line 1439 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, BMSallocBlockMemoryArray, BMSclearMemoryArray, BMScopyMemoryArray, BMSduplicateBlockMemoryArray, ensureVarsSize(), EPSEQ, SCIP_NlpiOracle::infinity, invalidateHessianLagSparsity(), NULL, SCIP_NlpiOracle::nvars, SCIP_ALLOC, SCIP_CALL, SCIP_DEFAULT_EPSILON, SCIP_OKAY, SCIPdebugMessage, SCIP_NlpiOracle::vardegrees, SCIP_NlpiOracle::varlbs, SCIP_NlpiOracle::varnames, SCIP_NlpiOracle::varssize, and SCIP_NlpiOracle::varubs. Referenced by SCIP_DECL_NLPIADDVARS().
adds constraints linear coefficients: row(=constraint) oriented matrix; quadratic coefficients: row oriented matrix for each constraint
Definition at line 1524 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, SCIP_NlpiOracle::conss, createConstraint(), ensureConssSize(), SCIP_NlpiOracle::exprinterpreter, SCIP_NlpiOracleCons::exprtree, FALSE, SCIP_NlpiOracle::infinity, invalidateHessianLagSparsity(), invalidateJacobiSparsity(), SCIP_NlpiOracle::nconss, SCIP_NlpiOracleCons::nquadelems, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprintCompile(), TRUE, updateVariableDegreesCons(), and SCIP_NlpiOracle::vardegreesuptodate. Referenced by SCIP_DECL_NLPIADDCONSTRAINTS().
sets or overwrites objective, a minimization problem is expected May change sparsity pattern.
Definition at line 1602 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, createConstraint(), SCIP_NlpiOracle::exprinterpreter, SCIP_NlpiOracleCons::exprtree, FALSE, freeConstraint(), SCIP_NlpiOracle::infinity, invalidateHessianLagSparsity(), NULL, SCIP_NlpiOracle::objective, SCIP_NlpiOracleCons::quadsize, REALABS, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprintCompile(), and SCIP_NlpiOracle::vardegreesuptodate. Referenced by SCIP_DECL_NLPISETOBJECTIVE().
change variable bounds
Definition at line 1639 of file nlpioracle.c. References EPSEQ, SCIP_NlpiOracle::infinity, NULL, SCIP_NlpiOracle::nvars, SCIP_DEFAULT_EPSILON, SCIP_OKAY, SCIPdebugMessage, SCIP_NlpiOracle::varlbs, and SCIP_NlpiOracle::varubs. Referenced by SCIP_DECL_NLPICHGVARBOUNDS().
change constraint sides change constraint bounds
Definition at line 1675 of file nlpioracle.c. References SCIP_NlpiOracle::conss, EPSEQ, SCIP_NlpiOracle::infinity, SCIP_NlpiOracleCons::lhs, SCIP_NlpiOracle::nconss, NULL, SCIP_NlpiOracleCons::rhs, SCIP_DEFAULT_EPSILON, SCIP_OKAY, and SCIPdebugMessage. Referenced by SCIP_DECL_NLPICHGCONSSIDES().
deletes a set of variables
Definition at line 1709 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, clearDeletedLinearElements(), clearDeletedQuadElements(), SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracleCons::exprvaridxs, freeVariables(), invalidateHessianLagSparsity(), invalidateJacobiSparsity(), SCIP_NlpiOracleCons::lincoefs, SCIP_NlpiOracleCons::linidxs, mapIndices(), mapIndicesQuad(), moveVariable(), SCIP_NlpiOracle::nconss, SCIP_NlpiOracleCons::nlinidxs, SCIP_NlpiOracleCons::nquadelems, NULL, SCIP_NlpiOracle::nvars, SCIP_NlpiOracle::objective, SCIP_NlpiOracleCons::quadelems, SCIP_NlpiOracleCons::quadsize, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprtreeFree(), SCIPexprtreeGetNVars(), SCIPquadelemSort(), SCIPsortIntReal(), and SCIP_NlpiOracle::varnames. Referenced by SCIP_DECL_NLPIDELVARSET().
deletes a set of constraints
Definition at line 1819 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, SCIP_NlpiOracle::conss, FALSE, freeConstraint(), freeConstraints(), invalidateHessianLagSparsity(), invalidateJacobiSparsity(), SCIP_NlpiOracle::nconss, NULL, SCIP_OKAY, SCIPdebugMessage, and SCIP_NlpiOracle::vardegreesuptodate. Referenced by SCIP_DECL_NLPIDELCONSSET().
changes (or adds) linear coefficients in one constraint or objective changes linear coefficients in one constraint or objective
Definition at line 1897 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, BMSduplicateBlockMemoryArray, SCIP_NlpiOracle::conss, ensureConsLinSize(), FALSE, invalidateJacobiSparsity(), SCIP_NlpiOracleCons::lincoefs, SCIP_NlpiOracleCons::linidxs, SCIP_NlpiOracleCons::linsize, MAX, SCIP_NlpiOracleCons::nlinidxs, NULL, SCIP_NlpiOracle::nvars, SCIP_NlpiOracle::objective, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPsortedvecFindInt(), sortLinearCoefficients(), TRUE, SCIP_NlpiOracle::vardegrees, and SCIP_NlpiOracle::vardegreesuptodate. Referenced by SCIP_DECL_NLPICHGLINEARCOEFS().
changes (or adds) coefficients in the quadratic part of one constraint or objective
Definition at line 1994 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, BMSduplicateBlockMemoryArray, SCIP_QuadElement::coef, SCIP_NlpiOracle::conss, ensureConsQuadSize(), FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, invalidateHessianLagSparsity(), invalidateJacobiSparsity(), MAX, SCIP_NlpiOracleCons::nquadelems, NULL, SCIP_NlpiOracle::objective, SCIP_NlpiOracleCons::quadelems, SCIP_NlpiOracleCons::quadsize, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPquadelemSort(), SCIPquadelemSortedFind(), SCIPquadelemSqueeze(), TRUE, SCIP_NlpiOracle::vardegrees, and SCIP_NlpiOracle::vardegreesuptodate. Referenced by SCIP_DECL_NLPICHGQUADCOEFS().
replaces expression tree of one constraint or objective
Definition at line 2092 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, BMSduplicateBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_NlpiOracle::conss, SCIP_NlpiOracle::exprinterpreter, SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracleCons::exprvaridxs, FALSE, invalidateHessianLagSparsity(), invalidateJacobiSparsity(), NULL, SCIP_NlpiOracle::nvars, SCIP_NlpiOracle::objective, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprintCompile(), SCIPexprtreeCopy(), SCIPexprtreeFree(), SCIPexprtreeGetNVars(), SCIP_NlpiOracle::vardegrees, and SCIP_NlpiOracle::vardegreesuptodate. Referenced by SCIP_DECL_NLPICHGEXPRTREE().
changes one parameter of expression tree of one constraint or objective
Definition at line 2149 of file nlpioracle.c. References SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::exprtree, NULL, SCIP_NlpiOracle::objective, SCIP_OKAY, SCIPdebugMessage, SCIPexprtreeGetNParams(), and SCIPexprtreeSetParamVal(). Referenced by SCIP_DECL_NLPICHGNONLINCOEF().
changes the constant value in the objective function
Definition at line 2174 of file nlpioracle.c. References SCIP_NlpiOracleCons::lhs, NULL, SCIP_NlpiOracle::objective, SCIP_NlpiOracleCons::rhs, SCIP_OKAY, and SCIPdebugMessage. Referenced by SCIP_DECL_NLPICHGOBJCONSTANT().
gives the current number of variables
Definition at line 2190 of file nlpioracle.c. References NULL, and SCIP_NlpiOracle::nvars. Referenced by SCIP_DECL_NLPISETINITIALGUESS().
gives the current number of constraints
Definition at line 2200 of file nlpioracle.c. References SCIP_NlpiOracle::nconss, and NULL.
gives the variables lower bounds
Definition at line 2210 of file nlpioracle.c. References NULL, and SCIP_NlpiOracle::varlbs.
gives the variables upper bounds
Definition at line 2220 of file nlpioracle.c. References NULL, and SCIP_NlpiOracle::varubs.
gives the variables names, or NULL if not set
Definition at line 2230 of file nlpioracle.c. References NULL, and SCIP_NlpiOracle::varnames.
Gives maximum degree of a variable w.r.t. objective and all constraints. The degree of a variable is the degree of the summand where it appears in, and is infinity for nonpolynomial terms.
Definition at line 2242 of file nlpioracle.c. References NULL, updateVariableDegrees(), and SCIP_NlpiOracle::vardegrees.
Gives maximum degree of all variables w.r.t. objective and all constraints. The degree of a variable is the degree of the summand where it appears in, and is infinity for nonpolynomial terms.
Definition at line 2259 of file nlpioracle.c. References NULL, updateVariableDegrees(), and SCIP_NlpiOracle::vardegrees.
gives left-hand side of a constraint
Definition at line 2271 of file nlpioracle.c. References SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::lhs, and NULL.
gives right-hand side of a constraint
Definition at line 2284 of file nlpioracle.c. References SCIP_NlpiOracle::conss, NULL, and SCIP_NlpiOracleCons::rhs.
gives name of a constraint, may be NULL
Definition at line 2297 of file nlpioracle.c. References SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::name, and NULL.
gives maximum degree of a constraint or objective The degree is the maximal degree of all summands,, and is infinity for nonpolynomial terms.
Definition at line 2312 of file nlpioracle.c. References SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracleCons::nlinidxs, SCIP_NlpiOracleCons::nquadelems, NULL, and SCIP_NlpiOracle::objective.
Gives maximum degree over all constraints and the objective (or over all variables, resp.). Thus, if this function returns 0, then the objective and all constraints are constant. If it returns 1, then the problem in linear. If it returns 2, then its a QP, QCP, or QCQP. And if it returns > 2, then it is an NLP.
Definition at line 2344 of file nlpioracle.c. References NULL, SCIP_NlpiOracle::nvars, SCIPdebugMessage, updateVariableDegrees(), and SCIP_NlpiOracle::vardegrees. Referenced by SCIP_DECL_NLPISOLVE().
evaluates the objective function in a given point
Definition at line 2370 of file nlpioracle.c. References evalFunctionValue(), SCIP_NlpiOracleCons::lhs, NULL, SCIP_NlpiOracle::objective, SCIP_NlpiOracleCons::rhs, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage.
evaluates one constraint function in a given point
Definition at line 2389 of file nlpioracle.c. References SCIP_NlpiOracle::conss, evalFunctionValue(), NULL, SCIP_NlpiOracle::nvars, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage.
evaluates all constraint functions in a given point
Definition at line 2408 of file nlpioracle.c. References SCIP_NlpiOracle::conss, evalFunctionValue(), SCIP_NlpiOracle::nconss, NULL, SCIP_NlpiOracle::nvars, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage.
computes the objective gradient in a given point
Definition at line 2431 of file nlpioracle.c. References evalFunctionGradient(), SCIP_NlpiOracleCons::lhs, NULL, SCIP_NlpiOracle::objective, SCIP_NlpiOracleCons::rhs, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage.
computes a constraints gradient in a given point
Definition at line 2452 of file nlpioracle.c. References SCIP_NlpiOracle::conss, evalFunctionGradient(), NULL, SCIP_NlpiOracle::nvars, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage. Referenced by SCIPnlpiOracleEvalJacobian().
gets sparsity pattern (rowwise) of Jacobian matrix Note that internal data is returned in *offset and *col, thus the user does not need to allocate memory there. Adding or deleting constraints destroys the sparsity structure and make another call to this function necessary.
Definition at line 2477 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, BMSallocBlockMemoryArray, BMSclearMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArray, BMSreallocBlockMemoryArray, SCIP_NlpiOracle::conss, ensureIntArraySize(), SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracleCons::exprvaridxs, FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_NlpiOracle::jaccols, SCIP_NlpiOracle::jacoffsets, SCIP_NlpiOracleCons::linidxs, MIN, SCIP_NlpiOracle::nconss, SCIP_NlpiOracleCons::nlinidxs, SCIP_NlpiOracleCons::nquadelems, NULL, SCIP_NlpiOracle::nvars, SCIP_NlpiOracleCons::quadelems, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprtreeGetNVars(), and TRUE.
evaluates the Jacobi matrix in a given point The values in the Jacobi matrix are returned in the same order as specified by the offset and col arrays obtained by SCIPnlpiOracleGetJacobianSparsity. The user need to call SCIPnlpiOracleGetJacobianSparsity at least ones before using this function.
Definition at line 2616 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, SCIP_NlpiOracle::conss, SCIP_NlpiOracle::exprinterpreter, SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracleCons::exprvaridxs, SCIP_NlpiOracle::infinity, SCIP_NlpiOracle::jaccols, SCIP_NlpiOracle::jacoffsets, SCIP_NlpiOracleCons::lincoefs, SCIP_NlpiOracle::nconss, SCIP_NlpiOracleCons::nlinidxs, SCIP_NlpiOracleCons::nquadelems, NULL, SCIP_NlpiOracle::nvars, SCIP_ALLOC, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPdebug, SCIPdebugMessage, SCIPexprintEval(), SCIPexprintGrad(), SCIPexprtreeGetNVars(), and SCIPnlpiOracleEvalConstraintGradient().
gets sparsity pattern of the Hessian matrix of the Lagrangian Note that internal data is returned in *offset and *col, thus the user must not to allocate memory there. Adding or deleting variables, objective, or constraints may destroy the sparsity structure and make another call to this function necessary. Only elements of the lower left triangle and the diagonal are counted. gets sparsity pattern of the Hessian matrix of the Lagrangian Note that internal data is returned in *offset and *col, thus the user must not allocate memory there. Adding or deleting variables, objective, or constraints may destroy the sparsity structure and make another call to this function necessary. Only elements of the lower left triangle and the diagonal are counted. nonzeros in Hessian corresponding to one column collen[i] is length of array colnz[i] colnnz[i] is number of entries in colnz[i] (<= collen[i])
Definition at line 2755 of file nlpioracle.c. References SCIP_NlpiOracle::blkmem, BMSallocBlockMemoryArray, BMSclearMemoryArray, BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracleCons::exprvaridxs, SCIP_NlpiOracle::heslagcols, SCIP_NlpiOracle::heslagoffsets, hessLagSparsitySetNzFlagForExprtree(), hessLagSparsitySetNzFlagForQuad(), SCIP_NlpiOracle::nconss, SCIP_NlpiOracleCons::nquadelems, NULL, SCIP_NlpiOracle::nvars, SCIP_NlpiOracle::objective, SCIP_NlpiOracleCons::quadelems, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.
evaluates the Hessian matrix of the Lagrangian in a given point The values in the Hessian matrix are returned in the same order as specified by the offset and col arrays obtained by SCIPnlpiOracleGetHessianLagSparsity. The user must call SCIPnlpiOracleGetHessianLagSparsity at least ones before using this function. Only elements of the lower left triangle and the diagonal are computed.
Definition at line 2852 of file nlpioracle.c. References SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracleCons::exprvaridxs, SCIP_NlpiOracle::heslagcols, SCIP_NlpiOracle::heslagoffsets, hessLagAddExprtree(), hessLagAddQuad(), SCIP_NlpiOracle::nconss, SCIP_NlpiOracleCons::nquadelems, NULL, SCIP_NlpiOracle::nvars, SCIP_NlpiOracle::objective, SCIP_NlpiOracleCons::quadelems, SCIP_CALL, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage.
prints the problem to a file.
Definition at line 2894 of file nlpioracle.c. References SCIP_NlpiOracle::conss, FALSE, SCIP_NlpiOracle::infinity, SCIP_NlpiOracleCons::lhs, SCIP_NlpiOracleCons::name, SCIP_NlpiOracle::name, SCIP_NlpiOracle::nconss, NULL, SCIP_NlpiOracle::nvars, SCIP_NlpiOracle::objective, printFunction(), SCIP_NlpiOracleCons::rhs, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPmessageFPrintInfo(), SCIP_NlpiOracle::vardegrees, SCIP_NlpiOracle::vardegreesuptodate, SCIP_NlpiOracle::varlbs, SCIP_NlpiOracle::varnames, and SCIP_NlpiOracle::varubs.
prints the problem to a file in GAMS format If there are variable (equation, resp.) names with more than 9 characters, then variable (equation, resp.) names are prefixed with an unique identifier. This is to make it easier to identify variables solution output in the listing file. Names with more than 64 characters are shorten to 64 letters due to GAMS limits.
Definition at line 2963 of file nlpioracle.c. References SCIP_NlpiOracle::conss, exprIsNonSmooth(), SCIP_NlpiOracleCons::exprtree, FALSE, SCIP_NlpiOracle::infinity, SCIP_NlpiOracleCons::lhs, SCIP_NlpiOracleCons::name, SCIP_NlpiOracle::name, SCIP_NlpiOracle::nconss, NULL, SCIP_NlpiOracle::nvars, SCIP_NlpiOracle::objective, printFunction(), printName(), SCIP_NlpiOracleCons::rhs, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPexprtreeGetRoot(), SCIPmessageFPrintInfo(), TRUE, SCIP_NlpiOracle::varlbs, SCIP_NlpiOracle::varnames, and SCIP_NlpiOracle::varubs. |