Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

NLP representation used by various NLP solver interface implementations.

Typedefs

typedef struct SCIP_NlpiOracle SCIP_NLPIORACLE
 

Functions

SCIP_RETCODE SCIPnlpiOracleCreate (SCIP *scip, SCIP_NLPIORACLE **oracle)
 
SCIP_RETCODE SCIPnlpiOracleFree (SCIP *scip, SCIP_NLPIORACLE **oracle)
 
SCIP_RETCODE SCIPnlpiOracleSetProblemName (SCIP *scip, SCIP_NLPIORACLE *oracle, const char *name)
 
const char * SCIPnlpiOracleGetProblemName (SCIP_NLPIORACLE *oracle)
 
SCIP_RETCODE SCIPnlpiOracleAddVars (SCIP *scip, SCIP_NLPIORACLE *oracle, int nvars, const SCIP_Real *lbs, const SCIP_Real *ubs, const char **varnames)
 
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)
 
SCIP_RETCODE SCIPnlpiOracleSetObjective (SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real constant, int nlin, const int *lininds, const SCIP_Real *linvals, SCIP_EXPR *expr)
 
SCIP_RETCODE SCIPnlpiOracleChgVarBounds (SCIP *scip, SCIP_NLPIORACLE *oracle, int nvars, const int *indices, const SCIP_Real *lbs, const SCIP_Real *ubs)
 
SCIP_RETCODE SCIPnlpiOracleChgConsSides (SCIP *scip, SCIP_NLPIORACLE *oracle, int nconss, const int *indices, const SCIP_Real *lhss, const SCIP_Real *rhss)
 
SCIP_RETCODE SCIPnlpiOracleDelVarSet (SCIP *scip, SCIP_NLPIORACLE *oracle, int *delstats)
 
SCIP_RETCODE SCIPnlpiOracleDelConsSet (SCIP *scip, SCIP_NLPIORACLE *oracle, int *delstats)
 
SCIP_RETCODE SCIPnlpiOracleChgLinearCoefs (SCIP *scip, SCIP_NLPIORACLE *oracle, int considx, int nentries, const int *varidxs, const SCIP_Real *newcoefs)
 
SCIP_RETCODE SCIPnlpiOracleChgExpr (SCIP *scip, SCIP_NLPIORACLE *oracle, int considx, SCIP_EXPR *expr)
 
SCIP_RETCODE SCIPnlpiOracleChgObjConstant (SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_Real objconstant)
 
int SCIPnlpiOracleGetNVars (SCIP_NLPIORACLE *oracle)
 
int SCIPnlpiOracleGetNConstraints (SCIP_NLPIORACLE *oracle)
 
const SCIP_RealSCIPnlpiOracleGetVarLbs (SCIP_NLPIORACLE *oracle)
 
const SCIP_RealSCIPnlpiOracleGetVarUbs (SCIP_NLPIORACLE *oracle)
 
char ** SCIPnlpiOracleGetVarNames (SCIP_NLPIORACLE *oracle)
 
SCIP_Bool SCIPnlpiOracleIsVarNonlinear (SCIP *scip, SCIP_NLPIORACLE *oracle, int varidx)
 
void SCIPnlpiOracleGetVarCounts (SCIP *scip, SCIP_NLPIORACLE *oracle, const int **lincounts, const int **nlcounts)
 
SCIP_Real SCIPnlpiOracleGetObjectiveConstant (SCIP_NLPIORACLE *oracle)
 
SCIP_Real SCIPnlpiOracleGetConstraintLhs (SCIP_NLPIORACLE *oracle, int considx)
 
SCIP_Real SCIPnlpiOracleGetConstraintRhs (SCIP_NLPIORACLE *oracle, int considx)
 
char * SCIPnlpiOracleGetConstraintName (SCIP_NLPIORACLE *oracle, int considx)
 
SCIP_Bool SCIPnlpiOracleIsConstraintNonlinear (SCIP_NLPIORACLE *oracle, int considx)
 
SCIP_EXPRINTCAPABILITY SCIPnlpiOracleGetEvalCapability (SCIP *scip, SCIP_NLPIORACLE *oracle)
 
SCIP_RETCODE SCIPnlpiOracleEvalObjectiveValue (SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Real *objval)
 
SCIP_RETCODE SCIPnlpiOracleEvalConstraintValue (SCIP *scip, SCIP_NLPIORACLE *oracle, int considx, const SCIP_Real *x, SCIP_Real *conval)
 
SCIP_RETCODE SCIPnlpiOracleEvalConstraintValues (SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Real *convals)
 
SCIP_RETCODE SCIPnlpiOracleEvalObjectiveGradient (SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Bool isnewx, SCIP_Real *objval, SCIP_Real *objgrad)
 
SCIP_RETCODE SCIPnlpiOracleEvalConstraintGradient (SCIP *scip, SCIP_NLPIORACLE *oracle, const int considx, const SCIP_Real *x, SCIP_Bool isnewx, SCIP_Real *conval, SCIP_Real *congrad)
 
SCIP_RETCODE SCIPnlpiOracleGetJacobianSparsity (SCIP *scip, SCIP_NLPIORACLE *oracle, const int **offset, const int **col)
 
SCIP_RETCODE SCIPnlpiOracleEvalJacobian (SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Bool isnewx, SCIP_Real *convals, SCIP_Real *jacobi)
 
SCIP_RETCODE SCIPnlpiOracleGetHessianLagSparsity (SCIP *scip, SCIP_NLPIORACLE *oracle, const int **offset, const int **col)
 
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 *lambdas, SCIP_Real *hessian)
 
SCIP_RETCODE SCIPnlpiOracleResetEvalTime (SCIP *scip, SCIP_NLPIORACLE *oracle)
 
SCIP_Real SCIPnlpiOracleGetEvalTime (SCIP *scip, SCIP_NLPIORACLE *oracle)
 
SCIP_RETCODE SCIPnlpiOraclePrintProblem (SCIP *scip, SCIP_NLPIORACLE *oracle, FILE *file)
 
SCIP_RETCODE SCIPnlpiOraclePrintProblemGams (SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_Real *initval, FILE *file)
 

Typedef Documentation

◆ SCIP_NLPIORACLE

NLPI oracle data structure

Definition at line 42 of file nlpioracle.h.

Function Documentation

◆ SCIPnlpiOracleCreate()

SCIP_RETCODE SCIPnlpiOracleCreate ( SCIP scip,
SCIP_NLPIORACLE **  oracle 
)

creates an NLPIORACLE data structure

Parameters
scipSCIP data structure
oraclepointer to store NLPIORACLE data structure

Definition at line 974 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure

Definition at line 1004 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
namename of problem

Definition at line 1036 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
oraclepointer to NLPIORACLE data structure

Definition at line 1060 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
nvarsnumber of variables to add
lbsarray with lower bounds of new variables, or NULL if all -infinity
ubsarray with upper bounds of new variables, or NULL if all +infinity
varnamesarray with names of new variables, or NULL if no names should be stored

Definition at line 1072 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
nconssnumber of constraints to add
lhssarray with left-hand sides of constraints, or NULL if all -infinity
rhssarray with right-hand sides of constraints, or NULL if all +infinity
nlinindsnumber of linear coefficients for each constraint, may be NULL in case of no linear part
linindsindices of variables for linear coefficients for each constraint, may be NULL in case of no linear part
linvalsvalues of linear coefficient for each constraint, may be NULL in case of no linear part
exprsNULL if no nonlinear parts, otherwise exprs[.] gives nonlinear part, or NULL if no nonlinear part in this constraint
consnamesnames of new constraints, or NULL if no names should be stored

Definition at line 1158 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
constantconstant part of objective
nlinnumber of linear variable coefficients
linindsindices of linear variables, or NULL if no linear part
linvalscoefficients of linear variables, or NULL if no linear part
exprexpression of nonlinear part, or NULL if no nonlinear part

Definition at line 1219 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
nvarsnumber of variables to change bounds
indicesindices of variables to change bounds
lbsnew lower bounds, or NULL if all should be -infty
ubsnew upper bounds, or NULL if all should be +infty

Definition at line 1248 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
nconssnumber of constraints to change bounds
indicesindices of constraints to change bounds
lhssnew left-hand sides, or NULL if all should be -infty
rhssnew right-hand sides, or NULL if all should be +infty

Definition at line 1285 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 
)

◆ SCIPnlpiOracleDelConsSet()

SCIP_RETCODE SCIPnlpiOracleDelConsSet ( SCIP scip,
SCIP_NLPIORACLE oracle,
int *  delstats 
)

deletes a set of constraints

Parameters
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
delstatsarray 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 1462 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
considxindex of constraint where linear coefficients should be changed, or -1 for objective
nentriesnumber of coefficients to change
varidxsarray with indices of variables which coefficients should be changed
newcoefsarray with new coefficients of variables

Definition at line 1548 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
considxindex of constraint where expression should be changed, or -1 for objective
exprnew expression, or NULL

Definition at line 1644 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
objconstantnew value for objective constant

Definition at line 1690 of file nlpioracle.c.

References NULL, SCIP_OKAY, and SCIPdebugMessage.

Referenced by SCIP_DECL_NLPICHGOBJCONSTANT().

◆ SCIPnlpiOracleGetNVars()

◆ SCIPnlpiOracleGetNConstraints()

◆ SCIPnlpiOracleGetVarLbs()

const SCIP_Real* SCIPnlpiOracleGetVarLbs ( SCIP_NLPIORACLE oracle)

gives the variables lower bounds

Parameters
oraclepointer to NLPIORACLE data structure

Definition at line 1727 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
oraclepointer to NLPIORACLE data structure

Definition at line 1737 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
oraclepointer to NLPIORACLE data structure

Definition at line 1747 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
varidxthe variable to check

Definition at line 1757 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
lincountsbuffer to return pointer to array of counts of linear appearances
nlcountsbuffer to return pointer to array of counts of nonlinear appearances

Definition at line 1772 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
oraclepointer to NLPIORACLE data structure

Definition at line 1788 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
oraclepointer to NLPIORACLE data structure
considxconstraint index

Definition at line 1799 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
oraclepointer to NLPIORACLE data structure
considxconstraint index

Definition at line 1812 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
oraclepointer to NLPIORACLE data structure
considxconstraint index

Definition at line 1825 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
oraclepointer to NLPIORACLE data structure
considxindex of constraint for which nonlinearity status is returned, or -1 for objective

Definition at line 1838 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure

Definition at line 1855 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
xpoint where to evaluate
objvalpointer to store objective value

Definition at line 1878 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
considxindex of constraint to evaluate
xpoint where to evaluate
convalpointer to store constraint value

Definition at line 1903 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
xpoint where to evaluate
convalsbuffer to store constraint values

Definition at line 1927 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
xpoint where to evaluate
isnewxhas the point x changed since the last call to some evaluation function?
objvalpointer to store objective value
objgradpointer to store (dense) objective gradient

Definition at line 1959 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
considxindex of constraint to compute gradient for
xpoint where to evaluate
isnewxhas the point x changed since the last call to some evaluation function?
convalpointer to store constraint value
congradpointer to store (dense) constraint gradient

Definition at line 1988 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
offsetpointer to store pointer that stores the offsets to each rows sparsity pattern in col, can be NULL
colpointer 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 2018 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
xpoint where to evaluate
isnewxhas the point x changed since the last call to some evaluation function?
convalspointer to store constraint values, can be NULL
jacobipointer to store sparse jacobian values

Definition at line 2150 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
offsetpointer to store pointer that stores the offsets to each rows sparsity pattern in col, can be NULL
colpointer 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 2277 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
xpoint where to evaluate
isnewx_objhas the point x changed since the last call to an objective evaluation function?
isnewx_conshas the point x changed since the last call to the constraint evaluation function?
objfactorweight for objective function
lambdaweights (Lagrangian multipliers) for the constraints
hessianpointer to store sparse hessian values

Definition at line 2371 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure

Definition at line 2418 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure

Definition at line 2434 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
filefile to print to, or NULL for standard output

Definition at line 2445 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
scipSCIP data structure
oraclepointer to NLPIORACLE data structure
initvalstarting point values for variables or NULL
filefile to print to, or NULL for standard output

Definition at line 2513 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.