methods 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.
Typedefs | |
typedef struct SCIP_NlpiOracle | SCIP_NLPIORACLE |
typedef struct SCIP_NlpiOracle SCIP_NLPIORACLE |
NLPI oracle data structure
Definition at line 36 of file nlpioracle.h.
SCIP_RETCODE SCIPnlpiOracleCreate | ( | BMS_BLKMEM * | blkmem, |
SCIP_NLPIORACLE ** | oracle | ||
) |
creates an NLPIORACLE data structure
blkmem | block memory |
oracle | pointer to store 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().
SCIP_RETCODE SCIPnlpiOracleFree | ( | SCIP_NLPIORACLE ** | oracle | ) |
frees an NLPIORACLE data structure
oracle | pointer to 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().
SCIP_RETCODE SCIPnlpiOracleSetInfinity | ( | SCIP_NLPIORACLE * | oracle, |
SCIP_Real | infinity | ||
) |
sets the value for infinity
oracle | pointer to NLPIORACLE data structure |
infinity | value to use for infinity |
Definition at line 1376 of file nlpioracle.c.
References infinity, NULL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIP_DECL_NLPICREATEPROBLEM(), and SCIP_DECL_NLPISETREALPAR().
SCIP_Real SCIPnlpiOracleGetInfinity | ( | SCIP_NLPIORACLE * | oracle | ) |
gets the value for infinity
oracle | pointer to NLPIORACLE data structure |
Definition at line 1392 of file nlpioracle.c.
References NULL, and SCIPdebugMessage.
Referenced by SCIP_DECL_NLPIGETREALPAR().
SCIP_RETCODE SCIPnlpiOracleSetProblemName | ( | SCIP_NLPIORACLE * | oracle, |
const char * | name | ||
) |
sets the problem name (used for printing)
oracle | pointer to NLPIORACLE data structure |
name | name of problem |
Definition at line 1404 of file nlpioracle.c.
References BMSduplicateBlockMemoryArray, BMSfreeBlockMemoryArray, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIP_DECL_NLPICREATEPROBLEM(), and SCIPnlpiOracleFree().
const char* SCIPnlpiOracleGetProblemName | ( | SCIP_NLPIORACLE * | oracle | ) |
gets the problem name, or NULL if none set
oracle | pointer to NLPIORACLE data structure |
Definition at line 1427 of file nlpioracle.c.
References NULL, and SCIPdebugMessage.
SCIP_RETCODE SCIPnlpiOracleAddVars | ( | SCIP_NLPIORACLE * | oracle, |
int | nvars, | ||
const SCIP_Real * | lbs, | ||
const SCIP_Real * | ubs, | ||
const char ** | varnames | ||
) |
adds variables
oracle | pointer to NLPIORACLE data structure |
nvars | number of variables to add |
lbs | array with lower bounds of new variables, or NULL if all -infinity |
ubs | array with upper bounds of new variables, or NULL if all +infinity |
varnames | array with names of new variables, or NULL if no names should be stored |
Definition at line 1439 of file nlpioracle.c.
References BMSallocBlockMemoryArray, BMSclearMemoryArray, BMScopyMemoryArray, BMSduplicateBlockMemoryArray, ensureVarsSize(), EPSEQ, invalidateHessianLagSparsity(), NULL, SCIP_ALLOC, SCIP_CALL, SCIP_DEFAULT_EPSILON, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIP_DECL_NLPIADDVARS().
SCIP_RETCODE SCIPnlpiOracleAddConstraints | ( | SCIP_NLPIORACLE * | oracle, |
int | nconss, | ||
const SCIP_Real * | lhss, | ||
const SCIP_Real * | rhss, | ||
const int * | nlininds, | ||
int *const * | lininds, | ||
SCIP_Real *const * | linvals, | ||
const int * | nquadelems, | ||
SCIP_QUADELEM *const * | quadelems, | ||
int *const * | exprvaridxs, | ||
SCIP_EXPRTREE *const * | exprtrees, | ||
const char ** | consnames | ||
) |
adds constraints
linear coefficients: row(=constraint) oriented matrix; quadratic coefficients: row oriented matrix for each constraint
oracle | pointer to NLPIORACLE data structure |
nconss | number of constraints to add |
lhss | array with left-hand sides of constraints, or NULL if all -infinity |
rhss | array with right-hand sides of constraints, or NULL if all +infinity |
nlininds | number of linear coefficients for each constraint, may be NULL in case of no linear part |
lininds | indices of variables for linear coefficients for each constraint, may be NULL in case of no linear part |
linvals | values of linear coefficient for each constraint, may be NULL in case of no linear part |
nquadelems | number of elements in matrix of quadratic part for each constraint, may be NULL in case of no quadratic part in any constraint |
quadelems | quadratic elements specifying quadratic part for each constraint, entry of array may be NULL in case of no quadratic part, may be NULL in case of no quadratic part in any constraint |
exprvaridxs | NULL if no nonquadratic parts, otherwise epxrvaridxs[.] maps variable indices in expression tree to indices in nlp |
exprtrees | NULL if no nonquadratic parts, otherwise exprtrees[.] gives nonquadratic part, or NULL if no nonquadratic part in this constraint |
consnames | names of new constraints, or NULL if no names should be stored |
Definition at line 1524 of file nlpioracle.c.
References createConstraint(), ensureConssSize(), SCIP_NlpiOracleCons::exprtree, FALSE, invalidateHessianLagSparsity(), invalidateJacobiSparsity(), SCIP_NlpiOracleCons::nquadelems, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprintCompile(), TRUE, and updateVariableDegreesCons().
Referenced by SCIP_DECL_NLPIADDCONSTRAINTS().
SCIP_RETCODE SCIPnlpiOracleSetObjective | ( | SCIP_NLPIORACLE * | oracle, |
const SCIP_Real | constant, | ||
int | nlin, | ||
const int * | lininds, | ||
const SCIP_Real * | linvals, | ||
int | nquadelems, | ||
const SCIP_QUADELEM * | quadelems, | ||
const int * | exprvaridxs, | ||
const SCIP_EXPRTREE * | exprtree | ||
) |
sets or overwrites objective, a minimization problem is expected
May change sparsity pattern.
oracle | pointer to NLPIORACLE data structure |
constant | constant part of objective |
nlin | number of linear variable coefficients |
lininds | indices of linear variables, or NULL if no linear part |
linvals | coefficients of linear variables, or NULL if no linear part |
nquadelems | number of entries in matrix of quadratic part |
quadelems | entries in matrix of quadratic part, may be NULL in case of no quadratic part |
exprvaridxs | maps variable indices in expression tree to indices in nlp, or NULL if no nonquadratic part |
exprtree | expression tree of nonquadratic part, or NULL if no nonquadratic part |
Definition at line 1602 of file nlpioracle.c.
References createConstraint(), FALSE, freeConstraint(), SCIP_NlpiOracle::infinity, invalidateHessianLagSparsity(), NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPexprintCompile().
Referenced by SCIP_DECL_NLPISETOBJECTIVE().
SCIP_RETCODE SCIPnlpiOracleChgVarBounds | ( | SCIP_NLPIORACLE * | oracle, |
int | nvars, | ||
const int * | indices, | ||
const SCIP_Real * | lbs, | ||
const SCIP_Real * | ubs | ||
) |
change variable bounds
oracle | pointer to NLPIORACLE data structure |
nvars | number of variables to change bounds |
indices | indices of variables to change bounds |
lbs | new lower bounds, or NULL if all should be -infty |
ubs | new upper bounds, or NULL if all should be +infty |
Definition at line 1639 of file nlpioracle.c.
References EPSEQ, NULL, SCIP_DEFAULT_EPSILON, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIP_DECL_NLPICHGVARBOUNDS().
SCIP_RETCODE SCIPnlpiOracleChgConsSides | ( | SCIP_NLPIORACLE * | oracle, |
int | nconss, | ||
const int * | indices, | ||
const SCIP_Real * | lhss, | ||
const SCIP_Real * | rhss | ||
) |
change constraint sides
change constraint bounds
oracle | pointer to NLPIORACLE data structure |
nconss | number of constraints to change bounds |
indices | indices of constraints to change bounds |
lhss | new left-hand sides, or NULL if all should be -infty |
rhss | new right-hand sides, or NULL if all should be +infty |
Definition at line 1675 of file nlpioracle.c.
References EPSEQ, NULL, SCIP_DEFAULT_EPSILON, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIP_DECL_NLPICHGCONSSIDES().
SCIP_RETCODE SCIPnlpiOracleDelVarSet | ( | SCIP_NLPIORACLE * | oracle, |
int * | delstats | ||
) |
deletes a set of variables
oracle | pointer to NLPIORACLE data structure |
delstats | deletion status of vars in input (1 if var should be deleted, 0 if not); new position of var in output (-1 if var was deleted) |
Definition at line 1709 of file nlpioracle.c.
References BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, clearDeletedLinearElements(), clearDeletedQuadElements(), SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracleCons::exprvaridxs, freeVariables(), invalidateHessianLagSparsity(), invalidateJacobiSparsity(), SCIP_NlpiOracleCons::lincoefs, SCIP_NlpiOracleCons::linidxs, mapIndices(), mapIndicesQuad(), moveVariable(), SCIP_NlpiOracleCons::nlinidxs, NULL, SCIP_NlpiOracleCons::quadelems, SCIP_NlpiOracleCons::quadsize, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprtreeFree(), SCIPexprtreeGetNVars(), SCIPquadelemSort(), and SCIPsortIntReal().
Referenced by SCIP_DECL_NLPIDELVARSET().
SCIP_RETCODE SCIPnlpiOracleDelConsSet | ( | SCIP_NLPIORACLE * | oracle, |
int * | delstats | ||
) |
deletes a set of constraints
oracle | pointer to NLPIORACLE data structure |
delstats | array with deletion status of rows in input (1 if row should be deleted, 0 if not); new position of row in output (-1 if row was deleted) |
Definition at line 1819 of file nlpioracle.c.
References FALSE, freeConstraint(), freeConstraints(), invalidateHessianLagSparsity(), invalidateJacobiSparsity(), NULL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIP_DECL_NLPIDELCONSSET().
SCIP_RETCODE SCIPnlpiOracleChgLinearCoefs | ( | SCIP_NLPIORACLE * | oracle, |
int | considx, | ||
int | nentries, | ||
const int * | varidxs, | ||
const SCIP_Real * | newcoefs | ||
) |
changes (or adds) linear coefficients in one constraint or objective
changes linear coefficients in one constraint or objective
oracle | pointer to NLPIORACLE data structure |
considx | index of constraint where linear coefficients should be changed, or -1 for objective |
nentries | number of coefficients to change |
varidxs | array with indices of variables which coefficients should be changed |
newcoefs | array with new coefficients of variables |
Definition at line 1897 of file nlpioracle.c.
References BMSduplicateBlockMemoryArray, ensureConsLinSize(), FALSE, invalidateJacobiSparsity(), SCIP_NlpiOracleCons::lincoefs, SCIP_NlpiOracleCons::linidxs, SCIP_NlpiOracleCons::linsize, MAX, SCIP_NlpiOracleCons::nlinidxs, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPsortedvecFindInt(), sortLinearCoefficients(), and TRUE.
Referenced by SCIP_DECL_NLPICHGLINEARCOEFS().
SCIP_RETCODE SCIPnlpiOracleChgQuadCoefs | ( | SCIP_NLPIORACLE * | oracle, |
int | considx, | ||
int | nquadelems, | ||
const SCIP_QUADELEM * | quadelems | ||
) |
changes (or adds) coefficients in the quadratic part of one constraint or objective
oracle | pointer to NLPIORACLE data structure |
considx | index of constraint where quadratic coefficients should be changed, or -1 for objective |
nquadelems | number of entries in quadratic constraint to change |
quadelems | new elements in quadratic matrix (replacing already existing ones or adding new ones) |
Definition at line 1994 of file nlpioracle.c.
References BMSduplicateBlockMemoryArray, SCIP_QuadElement::coef, ensureConsQuadSize(), FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, invalidateHessianLagSparsity(), invalidateJacobiSparsity(), MAX, SCIP_NlpiOracleCons::nquadelems, NULL, SCIP_NlpiOracleCons::quadelems, SCIP_NlpiOracleCons::quadsize, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPquadelemSort(), SCIPquadelemSortedFind(), SCIPquadelemSqueeze(), and TRUE.
Referenced by SCIP_DECL_NLPICHGQUADCOEFS().
SCIP_RETCODE SCIPnlpiOracleChgExprtree | ( | SCIP_NLPIORACLE * | oracle, |
int | considx, | ||
const int * | exprvaridxs, | ||
const SCIP_EXPRTREE * | exprtree | ||
) |
replaces expression tree of one constraint or objective
oracle | pointer to NLPIORACLE data structure |
considx | index of constraint where expression tree should be changed, or -1 for objective |
exprvaridxs | problem indices of variables in expression tree |
exprtree | new expression tree, or NULL |
Definition at line 2092 of file nlpioracle.c.
References BMSduplicateBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracleCons::exprvaridxs, FALSE, invalidateHessianLagSparsity(), invalidateJacobiSparsity(), NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprintCompile(), SCIPexprtreeCopy(), SCIPexprtreeFree(), and SCIPexprtreeGetNVars().
Referenced by SCIP_DECL_NLPICHGEXPRTREE().
SCIP_RETCODE SCIPnlpiOracleChgExprParam | ( | SCIP_NLPIORACLE * | oracle, |
int | considx, | ||
int | paramidx, | ||
SCIP_Real | paramval | ||
) |
changes one parameter of expression tree of one constraint or objective
oracle | pointer to NLPIORACLE data structure |
considx | index of constraint where parameter should be changed in expression tree, or -1 for objective |
paramidx | index of parameter |
paramval | new value of parameter |
Definition at line 2149 of file nlpioracle.c.
References NULL, SCIP_OKAY, SCIPdebugMessage, SCIPexprtreeGetNParams(), and SCIPexprtreeSetParamVal().
Referenced by SCIP_DECL_NLPICHGNONLINCOEF().
SCIP_RETCODE SCIPnlpiOracleChgObjConstant | ( | SCIP_NLPIORACLE * | oracle, |
SCIP_Real | objconstant | ||
) |
changes the constant value in the objective function
oracle | pointer to NLPIORACLE data structure |
objconstant | new value for objective constant |
Definition at line 2174 of file nlpioracle.c.
References NULL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIP_DECL_NLPICHGOBJCONSTANT().
int SCIPnlpiOracleGetNVars | ( | SCIP_NLPIORACLE * | oracle | ) |
gives the current number of variables
oracle | pointer to NLPIORACLE data structure |
Definition at line 2190 of file nlpioracle.c.
References NULL, and SCIP_NlpiOracle::nvars.
Referenced by computeInteriorPoint(), SCIP_DECL_NLPISETINITIALGUESS(), and SCIPsetModifiedDefaultSettingsIpopt().
int SCIPnlpiOracleGetNConstraints | ( | SCIP_NLPIORACLE * | oracle | ) |
gives the current number of constraints
oracle | pointer to NLPIORACLE data structure |
Definition at line 2200 of file nlpioracle.c.
References SCIP_NlpiOracle::nconss, and NULL.
Referenced by computeInteriorPoint(), and SCIPsetModifiedDefaultSettingsIpopt().
const SCIP_Real* SCIPnlpiOracleGetVarLbs | ( | SCIP_NLPIORACLE * | oracle | ) |
gives the variables lower bounds
oracle | pointer to NLPIORACLE data structure |
Definition at line 2210 of file nlpioracle.c.
References NULL, and SCIP_NlpiOracle::varlbs.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
const SCIP_Real* SCIPnlpiOracleGetVarUbs | ( | SCIP_NLPIORACLE * | oracle | ) |
gives the variables upper bounds
oracle | pointer to NLPIORACLE data structure |
Definition at line 2220 of file nlpioracle.c.
References NULL, and SCIP_NlpiOracle::varubs.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
char** SCIPnlpiOracleGetVarNames | ( | SCIP_NLPIORACLE * | oracle | ) |
gives the variables names, or NULL if not set
oracle | pointer to NLPIORACLE data structure |
Definition at line 2230 of file nlpioracle.c.
References NULL, and SCIP_NlpiOracle::varnames.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
int SCIPnlpiOracleGetVarDegree | ( | SCIP_NLPIORACLE * | oracle, |
int | varidx | ||
) |
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.
oracle | pointer to NLPIORACLE data structure |
varidx | the variable for which the degree is returned |
Definition at line 2242 of file nlpioracle.c.
References NULL, updateVariableDegrees(), and SCIP_NlpiOracle::vardegrees.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
int* SCIPnlpiOracleGetVarDegrees | ( | SCIP_NLPIORACLE * | oracle | ) |
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.
oracle | pointer to NLPIORACLE data structure |
Definition at line 2259 of file nlpioracle.c.
References NULL, updateVariableDegrees(), and SCIP_NlpiOracle::vardegrees.
SCIP_Real SCIPnlpiOracleGetConstraintLhs | ( | SCIP_NLPIORACLE * | oracle, |
int | considx | ||
) |
gives left-hand side of a constraint
oracle | pointer to NLPIORACLE data structure |
considx | constraint index |
Definition at line 2271 of file nlpioracle.c.
References SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::lhs, and NULL.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
SCIP_Real SCIPnlpiOracleGetConstraintRhs | ( | SCIP_NLPIORACLE * | oracle, |
int | considx | ||
) |
gives right-hand side of a constraint
oracle | pointer to NLPIORACLE data structure |
considx | constraint index |
Definition at line 2284 of file nlpioracle.c.
References SCIP_NlpiOracle::conss, NULL, and SCIP_NlpiOracleCons::rhs.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
char* SCIPnlpiOracleGetConstraintName | ( | SCIP_NLPIORACLE * | oracle, |
int | considx | ||
) |
gives name of a constraint, may be NULL
oracle | pointer to NLPIORACLE data structure |
considx | constraint index |
Definition at line 2297 of file nlpioracle.c.
References SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::name, and NULL.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
int SCIPnlpiOracleGetConstraintDegree | ( | SCIP_NLPIORACLE * | oracle, |
int | considx | ||
) |
gives maximum degree of a constraint or objective The degree is the maximal degree of all summands,, and is infinity for nonpolynomial terms.
oracle | pointer to NLPIORACLE data structure |
considx | index of constraint for which the degree is requested, or -1 for objective |
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.
Referenced by computeInteriorPoint(), and SCIPsetModifiedDefaultSettingsIpopt().
int SCIPnlpiOracleGetMaxDegree | ( | SCIP_NLPIORACLE * | oracle | ) |
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.
oracle | pointer to NLPIORACLE data structure |
Definition at line 2344 of file nlpioracle.c.
References NULL, SCIPdebugMessage, and updateVariableDegrees().
Referenced by SCIP_DECL_NLPISOLVE().
SCIP_EXPRINTCAPABILITY SCIPnlpiOracleGetEvalCapability | ( | SCIP_NLPIORACLE * | oracle | ) |
Gives the evaluation capabilities that are shared among all expression trees in the problem.
oracle | pointer to NLPIORACLE data structure |
Definition at line 2370 of file nlpioracle.c.
References SCIP_NlpiOracle::conss, SCIP_NlpiOracle::exprinterpreter, SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracle::nconss, NULL, SCIP_NlpiOracle::objective, SCIP_EXPRINTCAPABILITY_ALL, and SCIPexprintGetExprtreeCapability().
Referenced by SCIP_DECL_NLPISOLVE().
SCIP_RETCODE SCIPnlpiOracleEvalObjectiveValue | ( | SCIP_NLPIORACLE * | oracle, |
const SCIP_Real * | x, | ||
SCIP_Real * | objval | ||
) |
evaluates the objective function in a given point
oracle | pointer to NLPIORACLE data structure |
x | point where to evaluate |
objval | pointer to store objective value |
Definition at line 2392 of file nlpioracle.c.
References evalFunctionValue(), NULL, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
SCIP_RETCODE SCIPnlpiOracleEvalConstraintValue | ( | SCIP_NLPIORACLE * | oracle, |
int | considx, | ||
const SCIP_Real * | x, | ||
SCIP_Real * | conval | ||
) |
evaluates one constraint function in a given point
oracle | pointer to NLPIORACLE data structure |
considx | index of constraint to evaluate |
x | point where to evaluate |
conval | pointer to store constraint value |
Definition at line 2411 of file nlpioracle.c.
References evalFunctionValue(), NULL, SCIP_NlpiOracle::nvars, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage.
SCIP_RETCODE SCIPnlpiOracleEvalConstraintValues | ( | SCIP_NLPIORACLE * | oracle, |
const SCIP_Real * | x, | ||
SCIP_Real * | convals | ||
) |
evaluates all constraint functions in a given point
oracle | pointer to NLPIORACLE data structure |
x | point where to evaluate |
convals | buffer to store constraint values |
Definition at line 2430 of file nlpioracle.c.
References evalFunctionValue(), NULL, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
SCIP_RETCODE SCIPnlpiOracleEvalObjectiveGradient | ( | SCIP_NLPIORACLE * | oracle, |
const SCIP_Real * | x, | ||
SCIP_Bool | isnewx, | ||
SCIP_Real * | objval, | ||
SCIP_Real * | objgrad | ||
) |
computes the objective gradient in a given point
oracle | pointer to NLPIORACLE data structure |
x | point where to evaluate |
isnewx | has the point x changed since the last call to some evaluation function? |
objval | pointer to store objective value |
objgrad | pointer to store (dense) objective gradient |
Definition at line 2453 of file nlpioracle.c.
References evalFunctionGradient(), NULL, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
SCIP_RETCODE SCIPnlpiOracleEvalConstraintGradient | ( | SCIP_NLPIORACLE * | oracle, |
const int | considx, | ||
const SCIP_Real * | x, | ||
SCIP_Bool | isnewx, | ||
SCIP_Real * | conval, | ||
SCIP_Real * | congrad | ||
) |
computes a constraints gradient in a given point
oracle | pointer to NLPIORACLE data structure |
considx | index of constraint to compute gradient for |
x | point where to evaluate |
isnewx | has the point x changed since the last call to some evaluation function? |
conval | pointer to store constraint value |
congrad | pointer to store (dense) constraint gradient |
Definition at line 2474 of file nlpioracle.c.
References evalFunctionGradient(), NULL, SCIP_NlpiOracle::nvars, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIPnlpiOracleEvalJacobian().
SCIP_RETCODE SCIPnlpiOracleGetJacobianSparsity | ( | SCIP_NLPIORACLE * | oracle, |
const int ** | offset, | ||
const int ** | col | ||
) |
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.
oracle | pointer to NLPIORACLE data structure |
offset | pointer to store pointer that stores the offsets to each rows sparsity pattern in col, can be NULL |
col | pointer to store pointer that stores the indices of variables that appear in each row, offset[nconss] gives length of col, can be NULL |
Definition at line 2499 of file nlpioracle.c.
References BMSallocBlockMemoryArray, BMSclearMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArray, BMSreallocBlockMemoryArray, ensureIntArraySize(), SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracleCons::exprvaridxs, FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_NlpiOracleCons::linidxs, MIN, SCIP_NlpiOracleCons::nlinidxs, SCIP_NlpiOracleCons::nquadelems, NULL, SCIP_NlpiOracleCons::quadelems, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprtreeGetNVars(), and TRUE.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
SCIP_RETCODE SCIPnlpiOracleEvalJacobian | ( | SCIP_NLPIORACLE * | oracle, |
const SCIP_Real * | x, | ||
SCIP_Bool | isnewx, | ||
SCIP_Real * | convals, | ||
SCIP_Real * | jacobi | ||
) |
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.
oracle | pointer to NLPIORACLE data structure |
x | point where to evaluate |
isnewx | has the point x changed since the last call to some evaluation function? |
convals | pointer to store constraint values, can be NULL |
jacobi | pointer to store sparse jacobian values |
Definition at line 2638 of file nlpioracle.c.
References BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, SCIP_NlpiOracleCons::exprtree, SCIP_NlpiOracleCons::exprvaridxs, SCIP_NlpiOracleCons::lincoefs, SCIP_NlpiOracleCons::nlinidxs, SCIP_NlpiOracleCons::nquadelems, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPdebug, SCIPdebugMessage, SCIPexprintEval(), SCIPexprintGrad(), SCIPexprtreeGetNVars(), SCIPisFinite, and SCIPnlpiOracleEvalConstraintGradient().
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
SCIP_RETCODE SCIPnlpiOracleGetHessianLagSparsity | ( | SCIP_NLPIORACLE * | oracle, |
const int ** | offset, | ||
const int ** | col | ||
) |
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.
oracle | pointer to NLPIORACLE data structure |
offset | pointer to store pointer that stores the offsets to each rows sparsity pattern in col, can be NULL |
col | pointer to store pointer that stores the indices of variables that appear in each row, offset[nconss] gives length of col, can be NULL |
Definition at line 2777 of file nlpioracle.c.
References BMSallocBlockMemoryArray, BMSclearMemoryArray, BMSfreeBlockMemoryArray, BMSfreeBlockMemoryArrayNull, hessLagSparsitySetNzFlagForExprtree(), hessLagSparsitySetNzFlagForQuad(), NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
SCIP_RETCODE SCIPnlpiOracleEvalHessianLag | ( | SCIP_NLPIORACLE * | oracle, |
const SCIP_Real * | x, | ||
SCIP_Bool | isnewx, | ||
SCIP_Real | objfactor, | ||
const SCIP_Real * | lambda, | ||
SCIP_Real * | hessian | ||
) |
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.
oracle | pointer to NLPIORACLE data structure |
x | point where to evaluate |
isnewx | has the point x changed since the last call to some evaluation function? |
objfactor | weight for objective function |
lambda | weights (Lagrangian multipliers) for the constraints |
hessian | pointer to store sparse hessian values |
Definition at line 2874 of file nlpioracle.c.
References SCIP_NlpiOracle::heslagcols, SCIP_NlpiOracle::heslagoffsets, hessLagAddExprtree(), hessLagAddQuad(), SCIP_NlpiOracle::nconss, NULL, SCIP_CALL, SCIP_CALL_QUIET, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIPsetModifiedDefaultSettingsIpopt().
SCIP_RETCODE SCIPnlpiOraclePrintProblem | ( | SCIP_NLPIORACLE * | oracle, |
SCIP_MESSAGEHDLR * | messagehdlr, | ||
FILE * | file | ||
) |
prints the problem to a file.
oracle | pointer to NLPIORACLE data structure |
messagehdlr | message handler |
file | file to print to, or NULL for standard output |
Definition at line 2917 of file nlpioracle.c.
References FALSE, infinity, SCIP_NlpiOracleCons::lhs, NULL, printFunction(), SCIP_NlpiOracleCons::rhs, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, and SCIPmessageFPrintInfo().
Referenced by computeInteriorPoint().
SCIP_RETCODE SCIPnlpiOraclePrintProblemGams | ( | SCIP_NLPIORACLE * | oracle, |
SCIP_Real * | initval, | ||
SCIP_MESSAGEHDLR * | messagehdlr, | ||
FILE * | file | ||
) |
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.
oracle | pointer to NLPIORACLE data structure |
initval | starting point values for variables or NULL |
messagehdlr | message handler |
file | file to print to, or NULL for standard output |
Definition at line 2986 of file nlpioracle.c.
References exprIsNonSmooth(), SCIP_NlpiOracleCons::exprtree, FALSE, infinity, SCIP_NlpiOracleCons::lhs, SCIP_NlpiOracleCons::name, SCIP_NlpiOracleCons::nquadelems, NULL, printFunction(), printName(), SCIP_NlpiOracleCons::rhs, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPexprtreeGetRoot(), SCIPmessageFPrintInfo(), and TRUE.