Detailed Description
NLP representation used by various NLP solver interface implementations.
Typedefs | |
typedef struct SCIP_NlpiOracle | SCIP_NLPIORACLE |
Typedef Documentation
◆ SCIP_NLPIORACLE
typedef struct SCIP_NlpiOracle SCIP_NLPIORACLE |
NLPI oracle data structure
Definition at line 51 of file nlpioracle.h.
Function Documentation
◆ SCIPnlpiOracleCreate()
SCIP_RETCODE SCIPnlpiOracleCreate | ( | SCIP * | scip, |
SCIP_NLPIORACLE ** | oracle | ||
) |
creates an NLPIORACLE data structure
- Parameters
-
scip SCIP data structure oracle pointer to store NLPIORACLE data structure
Definition at line 983 of file nlpioracle.c.
References BMSclearMemory, createConstraint(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocMemory, SCIPcreateClock(), SCIPdebugMessage, SCIPexprintCreate(), SCIPexprintGetName(), SCIPgetBoolParam(), and SCIPsetClockEnabled().
Referenced by SCIP_DECL_NLPICREATEPROBLEM().
◆ SCIPnlpiOracleFree()
SCIP_RETCODE SCIPnlpiOracleFree | ( | SCIP * | scip, |
SCIP_NLPIORACLE ** | oracle | ||
) |
frees an NLPIORACLE data structure
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure
Definition at line 1013 of file nlpioracle.c.
References BMSfreeMemory, FALSE, freeConstraint(), freeConstraints(), freeVariables(), invalidateHessianLagSparsity(), invalidateJacobiSparsity(), NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPexprintFree(), SCIPfreeClock(), and SCIPnlpiOracleSetProblemName().
Referenced by SCIP_DECL_NLPIFREEPROBLEM().
◆ SCIPnlpiOracleSetProblemName()
SCIP_RETCODE SCIPnlpiOracleSetProblemName | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
const char * | name | ||
) |
sets the problem name (used for printing)
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure name name of problem
Definition at line 1045 of file nlpioracle.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPduplicateBlockMemoryArray, and SCIPfreeBlockMemoryArray.
Referenced by SCIP_DECL_NLPICREATEPROBLEM(), and SCIPnlpiOracleFree().
◆ SCIPnlpiOracleGetProblemName()
const char* SCIPnlpiOracleGetProblemName | ( | SCIP_NLPIORACLE * | oracle | ) |
gets the problem name, or NULL if none set
- Parameters
-
oracle pointer to NLPIORACLE data structure
Definition at line 1069 of file nlpioracle.c.
References NULL, and SCIPdebugMessage.
Referenced by SCIP_DECL_NLPISOLVE().
◆ SCIPnlpiOracleAddVars()
SCIP_RETCODE SCIPnlpiOracleAddVars | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
int | nvars, | ||
const SCIP_Real * | lbs, | ||
const SCIP_Real * | ubs, | ||
const char ** | varnames | ||
) |
adds variables
- Parameters
-
scip SCIP data structure 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 1081 of file nlpioracle.c.
References BMSclearMemoryArray, BMScopyMemoryArray, ensureVarsSize(), EPSEQ, invalidateHessianLagSparsity(), NULL, SCIP_CALL, SCIP_DEFAULT_EPSILON, SCIP_OKAY, SCIPallocClearBlockMemoryArray, SCIPdebugMessage, SCIPduplicateBlockMemoryArray, and SCIPinfinity().
Referenced by SCIP_DECL_NLPIADDVARS().
◆ SCIPnlpiOracleAddConstraints()
SCIP_RETCODE SCIPnlpiOracleAddConstraints | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
int | nconss, | ||
const SCIP_Real * | lhss, | ||
const SCIP_Real * | rhss, | ||
const int * | nlininds, | ||
int *const * | lininds, | ||
SCIP_Real *const * | linvals, | ||
SCIP_EXPR ** | exprs, | ||
const char ** | consnames | ||
) |
adds constraints
linear coefficients: row(=constraint) oriented matrix; quadratic coefficients: row oriented matrix for each constraint
- Parameters
-
scip SCIP data structure 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 exprs NULL if no nonlinear parts, otherwise exprs[.] gives nonlinear part, or NULL if no nonlinear part in this constraint consnames names of new constraints, or NULL if no names should be stored
Definition at line 1167 of file nlpioracle.c.
References createConstraint(), ensureConssSize(), SCIP_NlpiOracleCons::expr, FALSE, invalidateHessianLagSparsity(), invalidateJacobiSparsity(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPinfinity(), and TRUE.
Referenced by SCIP_DECL_NLPIADDCONSTRAINTS().
◆ SCIPnlpiOracleSetObjective()
SCIP_RETCODE SCIPnlpiOracleSetObjective | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
const SCIP_Real | constant, | ||
int | nlin, | ||
const int * | lininds, | ||
const SCIP_Real * | linvals, | ||
SCIP_EXPR * | expr | ||
) |
sets or overwrites objective, a minimization problem is expected
May change sparsity pattern.
- Parameters
-
scip SCIP data structure 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 expr expression of nonlinear part, or NULL if no nonlinear part
Definition at line 1228 of file nlpioracle.c.
References createConstraint(), freeConstraint(), invalidateHessianLagSparsity(), NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPisInfinity(), and TRUE.
Referenced by SCIP_DECL_NLPISETOBJECTIVE().
◆ SCIPnlpiOracleChgVarBounds()
SCIP_RETCODE SCIPnlpiOracleChgVarBounds | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
int | nvars, | ||
const int * | indices, | ||
const SCIP_Real * | lbs, | ||
const SCIP_Real * | ubs | ||
) |
change variable bounds
- Parameters
-
scip SCIP data structure 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 1257 of file nlpioracle.c.
References EPSEQ, NULL, SCIP_DEFAULT_EPSILON, SCIP_OKAY, SCIPdebugMessage, and SCIPinfinity().
Referenced by SCIP_DECL_NLPICHGVARBOUNDS().
◆ SCIPnlpiOracleChgConsSides()
SCIP_RETCODE SCIPnlpiOracleChgConsSides | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
int | nconss, | ||
const int * | indices, | ||
const SCIP_Real * | lhss, | ||
const SCIP_Real * | rhss | ||
) |
change constraint sides
- Parameters
-
scip SCIP data structure 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 1294 of file nlpioracle.c.
References EPSEQ, NULL, SCIP_DEFAULT_EPSILON, SCIP_OKAY, SCIPdebugMessage, and SCIPinfinity().
Referenced by SCIP_DECL_NLPICHGCONSSIDES().
◆ SCIPnlpiOracleDelVarSet()
SCIP_RETCODE SCIPnlpiOracleDelVarSet | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
int * | delstats | ||
) |
deletes a set of variables
- Parameters
-
scip SCIP data structure 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 1329 of file nlpioracle.c.
References clearDeletedLinearElements(), SCIP_NlpiOracleCons::expr, SCIP_NlpiOracleCons::exprintdata, FALSE, freeVariables(), invalidateHessianLagSparsity(), invalidateJacobiSparsity(), SCIP_NlpiOracleCons::lincoefs, SCIP_NlpiOracleCons::linidxs, mapIndices(), moveVariable(), SCIP_NlpiOracleCons::nlinidxs, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_OKAY, SCIPcreateExpriter(), SCIPdebugMessage, SCIPexprintFreeData(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPfreeBlockMemoryArray, SCIPfreeExpriter(), SCIPgetIndexExprVaridx(), SCIPisExprVaridx(), SCIPreleaseExpr(), SCIPsetIndexExprVaridx(), SCIPsortIntReal(), and TRUE.
Referenced by SCIP_DECL_NLPIDELVARSET().
◆ SCIPnlpiOracleDelConsSet()
SCIP_RETCODE SCIPnlpiOracleDelConsSet | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
int * | delstats | ||
) |
deletes a set of constraints
- Parameters
-
scip SCIP data structure 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 1471 of file nlpioracle.c.
References BMSclearMemoryArray, freeConstraint(), freeConstraints(), invalidateHessianLagSparsity(), invalidateJacobiSparsity(), NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, TRUE, and updateVariableCounts().
Referenced by SCIP_DECL_NLPIDELCONSSET().
◆ SCIPnlpiOracleChgLinearCoefs()
SCIP_RETCODE SCIPnlpiOracleChgLinearCoefs | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
int | considx, | ||
int | nentries, | ||
const int * | varidxs, | ||
const SCIP_Real * | newcoefs | ||
) |
changes (or adds) linear coefficients in one constraint or objective
- Parameters
-
scip SCIP data structure 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 1557 of file nlpioracle.c.
References ensureConsLinSize(), FALSE, invalidateJacobiSparsity(), SCIP_NlpiOracleCons::lincoefs, SCIP_NlpiOracleCons::linidxs, SCIP_NlpiOracleCons::linsize, SCIP_NlpiOracleCons::nlinidxs, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPduplicateBlockMemoryArray, SCIPsortedvecFindInt(), sortLinearCoefficients(), TRUE, and updateVariableCounts().
Referenced by SCIP_DECL_NLPICHGLINEARCOEFS().
◆ SCIPnlpiOracleChgExpr()
SCIP_RETCODE SCIPnlpiOracleChgExpr | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
int | considx, | ||
SCIP_EXPR * | expr | ||
) |
replaces expression of one constraint or objective
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure considx index of constraint where expression should be changed, or -1 for objective expr new expression, or NULL
Definition at line 1653 of file nlpioracle.c.
References SCIP_NlpiOracleCons::expr, SCIP_NlpiOracleCons::exprintdata, invalidateHessianLagSparsity(), invalidateJacobiSparsity(), NULL, SCIP_CALL, SCIP_OKAY, SCIPcaptureExpr(), SCIPdebugMessage, SCIPexprintCompile(), SCIPexprintFreeData(), SCIPreleaseExpr(), and updateVariableCounts().
Referenced by SCIP_DECL_NLPICHGEXPR().
◆ SCIPnlpiOracleChgObjConstant()
SCIP_RETCODE SCIPnlpiOracleChgObjConstant | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
SCIP_Real | objconstant | ||
) |
changes the constant value in the objective function
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure objconstant new value for objective constant
Definition at line 1699 of file nlpioracle.c.
References NULL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIP_DECL_NLPICHGOBJCONSTANT().
◆ SCIPnlpiOracleGetNVars()
int SCIPnlpiOracleGetNVars | ( | SCIP_NLPIORACLE * | oracle | ) |
gives the current number of variables
- Parameters
-
oracle pointer to NLPIORACLE data structure
Definition at line 1716 of file nlpioracle.c.
References NULL, and SCIP_NlpiOracle::nvars.
Referenced by computeInteriorPoint(), ensureStartingPoint(), handleNlpParam(), initWorhp(), processSolveOutcome(), SCIP_DECL_NLPIADDCONSTRAINTS(), SCIP_DECL_NLPIADDVARS(), SCIP_DECL_NLPICHGCONSSIDES(), SCIP_DECL_NLPIDELVARSET(), SCIP_DECL_NLPIFREEPROBLEM(), SCIP_DECL_NLPISETINITIALGUESS(), SCIP_DECL_NLPISOLVE(), SCIPgetNlpiOracleIpopt(), setupGradients(), setupHessian(), setupStart(), updateWorhp(), userDF(), userDG(), userF(), userG(), and userHM().
◆ SCIPnlpiOracleGetNConstraints()
int SCIPnlpiOracleGetNConstraints | ( | SCIP_NLPIORACLE * | oracle | ) |
gives the current number of constraints
- Parameters
-
oracle pointer to NLPIORACLE data structure
Definition at line 1726 of file nlpioracle.c.
References SCIP_NlpiOracle::nconss, and NULL.
Referenced by computeInteriorPoint(), handleNlpParam(), initWorhp(), processSolveOutcome(), SCIP_DECL_NLPIADDCONSTRAINTS(), SCIP_DECL_NLPIADDVARS(), SCIP_DECL_NLPIDELCONSSET(), SCIP_DECL_NLPIFREEPROBLEM(), SCIP_DECL_NLPISETINITIALGUESS(), SCIP_DECL_NLPISOLVE(), SCIPgetNlpiOracleIpopt(), setupGradients(), setupStart(), updateWorhp(), userDF(), userDG(), userF(), userG(), and userHM().
◆ SCIPnlpiOracleGetVarLbs()
const SCIP_Real* SCIPnlpiOracleGetVarLbs | ( | SCIP_NLPIORACLE * | oracle | ) |
gives the variables lower bounds
- Parameters
-
oracle pointer to NLPIORACLE data structure
Definition at line 1736 of file nlpioracle.c.
References NULL, and SCIP_NlpiOracle::varlbs.
Referenced by ensureStartingPoint(), handleNlpParam(), initWorhp(), SCIP_DECL_NLPICHGVARBOUNDS(), SCIP_DECL_NLPISOLVE(), SCIPgetNlpiOracleIpopt(), setupStart(), and updateWorhp().
◆ SCIPnlpiOracleGetVarUbs()
const SCIP_Real* SCIPnlpiOracleGetVarUbs | ( | SCIP_NLPIORACLE * | oracle | ) |
gives the variables upper bounds
- Parameters
-
oracle pointer to NLPIORACLE data structure
Definition at line 1746 of file nlpioracle.c.
References NULL, and SCIP_NlpiOracle::varubs.
Referenced by ensureStartingPoint(), handleNlpParam(), initWorhp(), SCIP_DECL_NLPICHGVARBOUNDS(), SCIP_DECL_NLPISOLVE(), SCIPgetNlpiOracleIpopt(), setupStart(), and updateWorhp().
◆ SCIPnlpiOracleGetVarNames()
char** SCIPnlpiOracleGetVarNames | ( | SCIP_NLPIORACLE * | oracle | ) |
gives the variables names, or NULL if not set
- Parameters
-
oracle pointer to NLPIORACLE data structure
Definition at line 1756 of file nlpioracle.c.
References NULL, and SCIP_NlpiOracle::varnames.
Referenced by SCIPgetNlpiOracleIpopt().
◆ SCIPnlpiOracleIsVarNonlinear()
SCIP_Bool SCIPnlpiOracleIsVarNonlinear | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
int | varidx | ||
) |
indicates whether variable appears nonlinear in any objective or constraint
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure varidx the variable to check
Definition at line 1766 of file nlpioracle.c.
References NULL, and SCIP_NlpiOracle::varnlcount.
Referenced by handleNlpParam(), and SCIPgetNlpiOracleIpopt().
◆ SCIPnlpiOracleGetVarCounts()
void SCIPnlpiOracleGetVarCounts | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
const int ** | lincounts, | ||
const int ** | nlcounts | ||
) |
returns number of linear and nonlinear appearances of variables in objective and constraints
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure lincounts buffer to return pointer to array of counts of linear appearances nlcounts buffer to return pointer to array of counts of nonlinear appearances
Definition at line 1781 of file nlpioracle.c.
References NULL, SCIP_NlpiOracle::varlincount, and SCIP_NlpiOracle::varnlcount.
Referenced by SCIPgetNlpiOracleIpopt().
◆ SCIPnlpiOracleGetObjectiveConstant()
SCIP_Real SCIPnlpiOracleGetObjectiveConstant | ( | SCIP_NLPIORACLE * | oracle | ) |
gives constant term of objective
- Parameters
-
oracle pointer to NLPIORACLE data structure
Definition at line 1797 of file nlpioracle.c.
References SCIP_NlpiOracleCons::lhs, NULL, SCIP_NlpiOracle::objective, and SCIP_NlpiOracleCons::rhs.
Referenced by SCIP_DECL_NLPICHGOBJCONSTANT().
◆ SCIPnlpiOracleGetConstraintLhs()
SCIP_Real SCIPnlpiOracleGetConstraintLhs | ( | SCIP_NLPIORACLE * | oracle, |
int | considx | ||
) |
gives left-hand side of a constraint
- Parameters
-
oracle pointer to NLPIORACLE data structure considx constraint index
Definition at line 1808 of file nlpioracle.c.
References SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::lhs, and NULL.
Referenced by handleNlpParam(), initWorhp(), SCIP_DECL_NLPICHGCONSSIDES(), SCIP_DECL_NLPISOLVE(), SCIPgetNlpiOracleIpopt(), and updateWorhp().
◆ SCIPnlpiOracleGetConstraintRhs()
SCIP_Real SCIPnlpiOracleGetConstraintRhs | ( | SCIP_NLPIORACLE * | oracle, |
int | considx | ||
) |
gives right-hand side of a constraint
- Parameters
-
oracle pointer to NLPIORACLE data structure considx constraint index
Definition at line 1821 of file nlpioracle.c.
References SCIP_NlpiOracle::conss, NULL, and SCIP_NlpiOracleCons::rhs.
Referenced by handleNlpParam(), initWorhp(), SCIP_DECL_NLPICHGCONSSIDES(), SCIP_DECL_NLPISOLVE(), SCIPgetNlpiOracleIpopt(), and updateWorhp().
◆ SCIPnlpiOracleGetConstraintName()
char* SCIPnlpiOracleGetConstraintName | ( | SCIP_NLPIORACLE * | oracle, |
int | considx | ||
) |
gives name of a constraint, may be NULL
- Parameters
-
oracle pointer to NLPIORACLE data structure considx constraint index
Definition at line 1834 of file nlpioracle.c.
References SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::name, and NULL.
Referenced by SCIPgetNlpiOracleIpopt().
◆ SCIPnlpiOracleIsConstraintNonlinear()
SCIP_Bool SCIPnlpiOracleIsConstraintNonlinear | ( | SCIP_NLPIORACLE * | oracle, |
int | considx | ||
) |
indicates whether constraint is nonlinear
- Parameters
-
oracle pointer to NLPIORACLE data structure considx index of constraint for which nonlinearity status is returned, or -1 for objective
Definition at line 1847 of file nlpioracle.c.
References SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::expr, NULL, and SCIP_NlpiOracle::objective.
Referenced by computeInteriorPoint(), handleNlpParam(), SCIP_DECL_NLPIADDCONSTRAINTS(), SCIP_DECL_NLPISETOBJECTIVE(), and SCIP_DECL_NLPISOLVE().
◆ SCIPnlpiOracleGetEvalCapability()
SCIP_EXPRINTCAPABILITY SCIPnlpiOracleGetEvalCapability | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle | ||
) |
gives the evaluation capabilities that are shared among all expressions in the problem
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure
Definition at line 1864 of file nlpioracle.c.
References SCIP_NlpiOracle::conss, SCIP_NlpiOracleCons::expr, SCIP_NlpiOracleCons::exprintdata, SCIP_NlpiOracle::exprinterpreter, SCIP_NlpiOracle::nconss, NULL, SCIP_NlpiOracle::objective, SCIP_EXPRINTCAPABILITY_ALL, and SCIPexprintGetExprCapability().
Referenced by SCIP_DECL_NLPISOLVE().
◆ SCIPnlpiOracleEvalObjectiveValue()
SCIP_RETCODE SCIPnlpiOracleEvalObjectiveValue | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
const SCIP_Real * | x, | ||
SCIP_Real * | objval | ||
) |
evaluates the objective function in a given point
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure x point where to evaluate objval pointer to store objective value
Definition at line 1887 of file nlpioracle.c.
References evalFunctionValue(), NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPstartClock(), and SCIPstopClock().
Referenced by F77_FUNC(), SCIP_DECL_NLPIGETSOLUTION(), SCIPgetNlpiOracleIpopt(), setupStart(), and userF().
◆ SCIPnlpiOracleEvalConstraintValue()
SCIP_RETCODE SCIPnlpiOracleEvalConstraintValue | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
int | considx, | ||
const SCIP_Real * | x, | ||
SCIP_Real * | conval | ||
) |
evaluates one constraint function in a given point
- Parameters
-
scip SCIP data structure 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 1912 of file nlpioracle.c.
References evalFunctionValue(), NULL, SCIP_NlpiOracle::nvars, SCIP_CALL, SCIPdebugMessage, SCIPstartClock(), and SCIPstopClock().
Referenced by F77_FUNC(), and setupStart().
◆ SCIPnlpiOracleEvalConstraintValues()
SCIP_RETCODE SCIPnlpiOracleEvalConstraintValues | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
const SCIP_Real * | x, | ||
SCIP_Real * | convals | ||
) |
evaluates all constraint functions in a given point
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure x point where to evaluate convals buffer to store constraint values
Definition at line 1936 of file nlpioracle.c.
References evalFunctionValue(), NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPstartClock(), and SCIPstopClock().
Referenced by SCIPgetNlpiOracleIpopt(), and userG().
◆ SCIPnlpiOracleEvalObjectiveGradient()
SCIP_RETCODE SCIPnlpiOracleEvalObjectiveGradient | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
const SCIP_Real * | x, | ||
SCIP_Bool | isnewx, | ||
SCIP_Real * | objval, | ||
SCIP_Real * | objgrad | ||
) |
computes the objective gradient in a given point
- Returns
- SCIP_INVALIDDATA, if the function or its gradient could not be evaluated (domain error, etc.)
- Parameters
-
scip SCIP data structure 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 1968 of file nlpioracle.c.
References evalFunctionGradient(), NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPstartClock(), and SCIPstopClock().
Referenced by F77_FUNC(), SCIPgetNlpiOracleIpopt(), setupStart(), and userDF().
◆ SCIPnlpiOracleEvalConstraintGradient()
SCIP_RETCODE SCIPnlpiOracleEvalConstraintGradient | ( | SCIP * | scip, |
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
- Returns
- SCIP_INVALIDDATA, if the function or its gradient could not be evaluated (domain error, etc.)
- Parameters
-
scip SCIP data structure 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 1997 of file nlpioracle.c.
References evalFunctionGradient(), NULL, SCIP_NlpiOracle::nvars, SCIP_CALL, SCIPdebugMessage, SCIPstartClock(), and SCIPstopClock().
◆ SCIPnlpiOracleGetJacobianSparsity()
SCIP_RETCODE SCIPnlpiOracleGetJacobianSparsity | ( | SCIP * | scip, |
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.
- Parameters
-
scip SCIP data structure 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 2027 of file nlpioracle.c.
References BMSclearMemoryArray, BMScopyMemoryArray, ensureIntArraySize(), SCIP_NlpiOracleCons::expr, FALSE, SCIP_NlpiOracleCons::linidxs, SCIP_NlpiOracleCons::nlinidxs, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_OKAY, SCIPallocBlockMemoryArray, SCIPcreateExpriter(), SCIPdebugMessage, SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPfreeBlockMemoryArray, SCIPfreeExpriter(), SCIPgetIndexExprVaridx(), SCIPisExprVaridx(), SCIPreallocBlockMemoryArray, SCIPstartClock(), SCIPstopClock(), and TRUE.
Referenced by handleNlpParam(), initWorhp(), SCIPgetNlpiOracleIpopt(), and setupGradients().
◆ SCIPnlpiOracleEvalJacobian()
SCIP_RETCODE SCIPnlpiOracleEvalJacobian | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
const SCIP_Real * | x, | ||
SCIP_Bool | isnewx, | ||
SCIP_Real * | convals, | ||
SCIP_Real * | jacobi | ||
) |
evaluates the Jacobian matrix in a given point
The values in the Jacobian 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.
- Returns
- SCIP_INVALIDDATA, if the Jacobian could not be evaluated (domain error, etc.)
- Parameters
-
scip SCIP data structure 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 2159 of file nlpioracle.c.
References BMSclearMemoryArray, BMScopyMemoryArray, SCIP_NlpiOracleCons::expr, SCIP_NlpiOracleCons::exprintdata, SCIP_NlpiOracleCons::lincoefs, SCIP_NlpiOracleCons::linidxs, SCIP_NlpiOracleCons::nlinidxs, NULL, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPallocCleanBufferArray, SCIPdebug, SCIPdebugMessage, SCIPdebugMsg, SCIPexprintGrad(), SCIPfreeCleanBufferArray, SCIPisFinite, SCIPisInfinity(), SCIPstartClock(), and SCIPstopClock().
Referenced by F77_FUNC(), SCIPgetNlpiOracleIpopt(), setupStart(), and userDG().
◆ SCIPnlpiOracleGetHessianLagSparsity()
SCIP_RETCODE SCIPnlpiOracleGetHessianLagSparsity | ( | SCIP * | scip, |
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.
- Parameters
-
scip SCIP data structure 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 2286 of file nlpioracle.c.
References BMSclearMemoryArray, hessLagSparsitySetNzFlagForExpr(), NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemoryArray, SCIPdebugMessage, SCIPfreeBlockMemoryArray, SCIPfreeBlockMemoryArrayNull, SCIPstartClock(), and SCIPstopClock().
Referenced by handleNlpParam(), initWorhp(), SCIPgetNlpiOracleIpopt(), setupHessian(), and userHM().
◆ SCIPnlpiOracleEvalHessianLag()
SCIP_RETCODE SCIPnlpiOracleEvalHessianLag | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
const SCIP_Real * | x, | ||
SCIP_Bool | isnewx_obj, | ||
SCIP_Bool | isnewx_cons, | ||
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.
- Returns
- SCIP_INVALIDDATA, if the Hessian could not be evaluated (domain error, etc.)
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure x point where to evaluate isnewx_obj has the point x changed since the last call to an objective evaluation function? isnewx_cons has the point x changed since the last call to the constraint evaluation function? objfactor weight for objective function lambda weights (Lagrangian multipliers) for the constraints hessian pointer to store sparse hessian values
Definition at line 2380 of file nlpioracle.c.
References BMSclearMemoryArray, SCIP_NlpiOracle::heslagcols, SCIP_NlpiOracle::heslagoffsets, hessLagAddExpr(), SCIP_NlpiOracle::nconss, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPstartClock(), and SCIPstopClock().
Referenced by F77_FUNC(), SCIPgetNlpiOracleIpopt(), and userHM().
◆ SCIPnlpiOracleResetEvalTime()
SCIP_RETCODE SCIPnlpiOracleResetEvalTime | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle | ||
) |
resets clock that measures evaluation time
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure
Definition at line 2427 of file nlpioracle.c.
References SCIP_NlpiOracle::evalclock, NULL, SCIP_CALL, SCIP_OKAY, and SCIPresetClock().
Referenced by SCIP_DECL_NLPISOLVE().
◆ SCIPnlpiOracleGetEvalTime()
SCIP_Real SCIPnlpiOracleGetEvalTime | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle | ||
) |
gives time spend in evaluation since last reset of clock
Gives 0 if the eval clock is disabled.
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure
Definition at line 2443 of file nlpioracle.c.
References SCIP_NlpiOracle::evalclock, NULL, and SCIPgetClockTime().
Referenced by SCIP_DECL_NLPIGETSTATISTICS().
◆ SCIPnlpiOraclePrintProblem()
SCIP_RETCODE SCIPnlpiOraclePrintProblem | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
FILE * | file | ||
) |
prints the problem to a file.
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure file file to print to, or NULL for standard output
Definition at line 2454 of file nlpioracle.c.
References FALSE, SCIP_NlpiOracleCons::lhs, NULL, printFunction(), SCIP_NlpiOracleCons::rhs, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPinfoMessage(), and SCIPisInfinity().
Referenced by computeInteriorPoint(), and SCIP_DECL_NLPISOLVE().
◆ SCIPnlpiOraclePrintProblemGams()
SCIP_RETCODE SCIPnlpiOraclePrintProblemGams | ( | SCIP * | scip, |
SCIP_NLPIORACLE * | oracle, | ||
SCIP_Real * | initval, | ||
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.
- Parameters
-
scip SCIP data structure oracle pointer to NLPIORACLE data structure initval starting point values for variables or NULL file file to print to, or NULL for standard output
Definition at line 2522 of file nlpioracle.c.
References SCIP_NlpiOracleCons::expr, exprIsNonSmooth(), FALSE, SCIP_NlpiOracleCons::lhs, SCIP_NlpiOracleCons::name, NULL, printFunction(), printName(), SCIP_NlpiOracleCons::rhs, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPinfoMessage(), SCIPisInfinity(), SCIPsnprintf(), and TRUE.