136 assert(newsize >= minsize);
185 assert(newsize >= minsize);
333 assert(factor == 1 || factor == -1);
336 for( j = 0; j < nlinidxs; ++j )
384 while( j+offset < *nidxs )
391 idxs[j] = idxs[j+offset];
392 coefs[j] = coefs[j+offset];
396 while( j+offset+1 < *nidxs && idxs[j] == idxs[j+offset+1] )
398 coefs[j] += coefs[j+offset+1];
403 if( coefs[j] == 0.0 )
439 (*cons)->linsize = nlinidxs;
440 (*cons)->nlinidxs = nlinidxs;
444 assert((*cons)->linidxs[0] >= 0);
449 (*cons)->expr = expr;
498 if( (*cons)->expr !=
NULL )
504 if( (*cons)->name !=
NULL )
601 for(
i = 0;
i < oracle->
nvars; ++
i )
631 for( ; nindices ; --nindices, ++indices )
633 assert(indexmap[*indices] >= 0);
634 *indices = indexmap[*indices];
661 for( offset = 0; offset < *nidxs; ++offset )
662 if( (*linidxs)[offset] >= 0 )
670 for(
i = 0;
i < *nidxs - offset; ++
i )
672 (*linidxs)[
i] = (*linidxs)[
i+offset];
673 (*coefs)[
i] = (*coefs) [
i+offset];
710 for( ; nlin > 0; --nlin, ++linidxs, ++lincoefs )
711 *val += *lincoefs *
x[*linidxs];
856 SCIPdebug(
if( isnewx ) {printf(
"\nx =");
for(
i = 0;
i < oracle->
nvars; ++
i) printf(
" %g",
x[
i]); printf(
"\n");} )
860 SCIPdebug( printf(
"g =");
for(
i = 0;
i < oracle->
nvars; ++
i) printf(
" %g", grad[
i]); printf(
"\n"); )
865 SCIPdebugMessage(
"gradient evaluation yield invalid function value %g\n", nlval);
868 for(
i = 0;
i < oracle->
nvars; ++
i )
871 SCIPdebugMessage(
"gradient evaluation yield invalid gradient value %g\n", grad[
i]);
891 for( ; nlin > 0; --nlin, ++linidxs, ++lincoefs )
893 *val += *lincoefs *
x[*linidxs];
894 grad[*linidxs] += *lincoefs;
935 for(
int i = 0;
i < oracle->
nconss; ++
i )
952 if( nvarnnz !=
NULL )
953 for(
int j = 0; j < cons->
nlinidxs; ++j )
965 for(
int j = 0; j < cons->
nlinidxs; ++j )
977 for(
int j = 0; j < oracle->
nvars; ++j )
979 if( nzflag[j] ==
FALSE )
991 if( nvarnnz !=
NULL )
1001 if( *nnz < maxcols )
1046 SCIPdebugMessage(
"%p hess lag sparsity set nzflag for expr\n", (
void*)oracle);
1049 for(
i = 0;
i < oracle->
nvars; ++
i )
1054 for(
i = 0;
i < ntotalnz; ++
i )
1123 &rowidxs, &colidxs, &
h, &nnz) );
1127 SCIPdebugMessage(
"hessian evaluation yield invalid function value %g\n", val);
1131 for(
i = 0;
i < nnz; ++
i )
1147 if( !
SCIPsortedvecFindInt(&hesnzidcs[hesoffset[row]], col, hesoffset[row+1] - hesoffset[row], &pos) )
1149 SCIPerrorMessage(
"Could not find entry (%d, %d) in hessian sparsity\n", row, col);
1153 values[hesoffset[row] + pos] += weight *
h[
i];
1157 if( !
SCIPsortedvecFindInt(&hesnzidcs[hesoffset[col]], row, hesoffset[col+1] - hesoffset[col], &pos) )
1159 SCIPerrorMessage(
"Could not find entry (%d, %d) in hessian sparsity\n", row, col);
1163 values[hesoffset[col] + pos] += weight *
h[
i];
1181 assert(idx >= 0 && idx < 100000);
1186 (void)
SCIPsnprintf(buffer, 64,
"%c%05d%.*s%s", prefix, idx, suffix !=
NULL ? (
int)(57-strlen(suffix)) : 57, name, suffix ? suffix :
"");
1188 (
void)
SCIPsnprintf(buffer, 64,
"%c%05d", prefix, idx);
1194 assert(strlen(name) + (suffix !=
NULL ? strlen(suffix) : 0) <= 64);
1195 (void)
SCIPsnprintf(buffer, 64,
"%s%s", name, suffix !=
NULL ? suffix :
"");
1199 assert(1 + 5 + (suffix !=
NULL ? strlen(suffix) : 0) <= 64);
1200 (void)
SCIPsnprintf(buffer, 64,
"%c%d%s", prefix, idx, suffix !=
NULL ? suffix :
"");
1262 const char* hdlrname;
1269 if( strcmp(hdlrname,
"abs") == 0 )
1274 if( strcmp(hdlrname,
"min") == 0 )
1279 if( strcmp(hdlrname,
"max") == 0 )
1348 if( (*oracle)->name !=
NULL )
1391 return oracle->
name;
1401 const char** varnames
1443 if( varnames !=
NULL )
1452 if( varnames[
i] !=
NULL )
1487 const int* nlininds,
1488 int*
const* lininds,
1492 const char** consnames
1513 for(
c = 0;
c < nconss; ++
c )
1516 nlininds !=
NULL ? nlininds[
c] : 0,
1530 oracle->
nconss += nconss;
1532 if( addednlcon ==
TRUE )
1565 nlin, lininds, linvals, expr, constant, constant,
NULL) );
1624 for(
i = 0;
i < nconss; ++
i )
1662 lastgood = oracle->
nvars - 1;
1663 while( lastgood >= 0 && delstats[lastgood] == 1 )
1670 for(
c = 0;
c < oracle->
nvars; ++
c )
1677 for(
c = oracle->
nvars - 1;
c > lastgood; --
c )
1689 for(
c = 0;
c <= lastgood; ++
c )
1691 if( delstats[
c] == 0 )
1706 delstats[lastgood] =
c;
1710 while( lastgood >
c && delstats[lastgood] == 1)
1716 delstats[lastgood] = -1;
1779 oracle->
nvars = lastgood+1;
1802 lastgood = oracle->
nconss - 1;
1803 while( lastgood >= 0 && delstats[lastgood] == 1)
1823 for(
c = oracle->
nconss - 1;
c > lastgood; --
c )
1833 for(
c = 0;
c <= lastgood; ++
c )
1835 if( delstats[
c] == 0 )
1850 delstats[lastgood] =
c;
1855 while( lastgood >
c && delstats[lastgood] == 1)
1859 delstats[lastgood] = -1;
1865 oracle->
nconss = lastgood+1;
1890 assert(considx < oracle->nconss);
1895 SCIPdebugMessage(
"change %d linear coefficients in cons %d\n", nentries, considx);
1920 for(
i = 0;
i < nentries; ++
i )
1927 SCIPdebugMessage(
"replace coefficient of var %d at pos %d by %g\n", varidxs[
i], pos, newcoefs[
i]);
1932 needsort |= (newcoefs[
i] == 0.0);
1934 if( newcoefs[
i] == 0.0 )
1940 else if( newcoefs[
i] != 0.0 )
1980 assert(considx < oracle->nconss);
2036 return oracle->
nvars;
2098 const int** lincounts,
2099 const int** nlcounts
2129 assert(considx < oracle->nconss);
2131 return oracle->
conss[considx]->
lhs;
2142 assert(considx < oracle->nconss);
2144 return oracle->
conss[considx]->
rhs;
2155 assert(considx < oracle->nconss);
2171 assert(considx < oracle->nconss);
2174 cons = considx == -1 ? oracle->
objective : oracle->
conss[considx];
2175 assert(varpos < cons->nlinidxs);
2190 assert(considx < oracle->nconss);
2217 return evalcapability;
2430 const int** rowoffsets,
2447 if( rowoffsets !=
NULL )
2451 if( colnlflags !=
NULL )
2462 if( rowoffsets !=
NULL )
2466 if( colnlflags !=
NULL )
2484 const int** coloffsets,
2503 if( coloffsets !=
NULL )
2507 if( rownlflags !=
NULL )
2529 for(
i = 0;
i < oracle->
nvars; ++
i )
2532 sumvarnnz += nvarnnz[
i];
2540 for(
i = 0;
i < nnz; ++
i )
2548 oracle->
jacrows[coloffset + nvarnnz[col]] = considx-1;
2555 if( coloffsets !=
NULL )
2559 if( rownlflags !=
NULL )
2602 if( oracle->
nvars == 0 )
2621 if(
obj->nlinidxs > 0 )
2637 for( j = 0; j <
obj->nlinidxs; ++j )
2639 nzflag[
obj->linidxs[j]] =
TRUE;
2668 for( j = 0; j < oracle->
nvars; ++j )
2670 if( nzflag[j] ==
FALSE )
2747 if( convals !=
NULL )
2756 if( convals !=
NULL )
2757 for( l = 0; l < cons->
nlinidxs; ++l )
2766 SCIPdebug(
if( isnewx ) {printf(
"\nx =");
for( l = 0; l < oracle->
nvars; ++l) printf(
" %g",
x[l]); printf(
"\n");} )
2770 SCIPdebug( printf(
"g =");
for( l = oracle->jacoffsets[
i]; l < oracle->jacoffsets[
i+1]; ++l) printf(
" %g", grad[oracle->
jaccols[l]]); printf(
"\n"); )
2774 SCIPdebugMessage(
"gradient evaluation yield invalid function value %g\n", nlval);
2778 if( convals !=
NULL )
2782 for( l = 0; l < cons->
nlinidxs; ++l )
2784 if( convals !=
NULL )
2798 SCIPdebugMessage(
"gradient evaluation yield invalid gradient value %g\n", grad[l]);
2802 jacobi[k++] = grad[oracle->
jaccols[j]];
2804 grad[oracle->
jaccols[j]] = 0.0;
2810 for( l = 0; l < oracle->
nvars; ++l )
2857 if( offset !=
NULL )
2897 for(
i = 0;
i < oracle->
nvars; ++
i )
2900 for( j = 0; j < nnz[
i]; ++j )
2915 if( offset !=
NULL )
3029 for(
i = 0;
i < oracle->
nvars; ++
i )
3088 static const char* nllevelname[4] = {
"LP",
"QCP",
"NLP",
"DNLP" };
3103 havelongvarnames =
FALSE;
3104 for(
i = 0;
i < oracle->
nvars; ++
i )
3107 havelongvarnames =
TRUE;
3111 havelongequnames =
FALSE;
3115 havelongequnames =
TRUE;
3123 for(
i = 0;
i < oracle->
nvars; ++
i )
3131 for(
i = 0;
i < oracle->
nvars; ++
i )
3153 if( initval !=
NULL )
3218 if( nllevel <= 1 && oracle->conss[
i]->expr !=
NULL )
3220 if( nllevel <= 2 && oracle->conss[
i]->expr !=
NULL )
3234 SCIPinfoMessage(
scip, file,
"Solve %s minimizing NLPIORACLEOBJVAR using %s;\n", problemname, nllevelname[nllevel]);
#define SCIP_INTERVAL_INFINITY
#define SCIP_DEFAULT_EPSILON
power and signed power expression handlers
handler for variable index expressions
methods to interpret (evaluate) an expression "fast"
int SCIPgetIndexExprVaridx(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprVaridx(SCIP *scip, SCIP_EXPR *expr)
void SCIPsetIndexExprVaridx(SCIP_EXPR *expr, int newindex)
SCIP_Bool SCIPisExprSignpower(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPexprintCompile(SCIP *scip, SCIP_EXPRINT *exprint, SCIP_EXPR *expr, SCIP_EXPRINTDATA **exprintdata)
SCIP_RETCODE SCIPexprintFreeData(SCIP *scip, SCIP_EXPRINT *exprint, SCIP_EXPR *expr, SCIP_EXPRINTDATA **exprintdata)
SCIP_RETCODE SCIPexprintHessianSparsity(SCIP *scip, SCIP_EXPRINT *exprint, SCIP_EXPR *expr, SCIP_EXPRINTDATA *exprintdata, SCIP_Real *varvals, int **rowidxs, int **colidxs, int *nnz)
SCIP_RETCODE SCIPexprintFree(SCIP *scip, SCIP_EXPRINT **exprint)
SCIP_RETCODE SCIPexprintEval(SCIP *scip, SCIP_EXPRINT *exprint, SCIP_EXPR *expr, SCIP_EXPRINTDATA *exprintdata, SCIP_Real *varvals, SCIP_Real *val)
const char * SCIPexprintGetName(void)
SCIP_EXPRINTCAPABILITY SCIPexprintGetExprCapability(SCIP *scip, SCIP_EXPRINT *exprint, SCIP_EXPR *expr, SCIP_EXPRINTDATA *exprintdata)
SCIP_RETCODE SCIPexprintHessian(SCIP *scip, SCIP_EXPRINT *exprint, SCIP_EXPR *expr, SCIP_EXPRINTDATA *exprintdata, SCIP_Real *varvals, SCIP_Bool new_varvals, SCIP_Real *val, int **rowidxs, int **colidxs, SCIP_Real **hessianvals, int *nnz)
SCIP_RETCODE SCIPexprintCreate(SCIP *scip, SCIP_EXPRINT **exprint)
SCIP_RETCODE SCIPexprintGrad(SCIP *scip, SCIP_EXPRINT *exprint, SCIP_EXPR *expr, SCIP_EXPRINTDATA *exprintdata, SCIP_Real *varvals, SCIP_Bool new_varvals, SCIP_Real *val, SCIP_Real *gradient)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPnlpiOracleEvalObjectiveValue(SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Real *objval)
SCIP_RETCODE SCIPnlpiOracleChgLinearCoefs(SCIP *scip, SCIP_NLPIORACLE *oracle, int considx, int nentries, const int *varidxs, const SCIP_Real *newcoefs)
SCIP_RETCODE SCIPnlpiOracleEvalConstraintInterval(SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_Real infinity, int considx, const SCIP_Real *xmin, const SCIP_Real *xmax, SCIP_Real *conmin, SCIP_Real *conmax)
SCIP_RETCODE SCIPnlpiOracleGetJacobianRowSparsity(SCIP *scip, SCIP_NLPIORACLE *oracle, const int **rowoffsets, const int **cols, const SCIP_Bool **colnlflags, int *nnlnz)
SCIP_RETCODE SCIPnlpiOracleGetHessianLagSparsity(SCIP *scip, SCIP_NLPIORACLE *oracle, const int **offset, const int **allnz, SCIP_Bool colwise)
SCIP_RETCODE SCIPnlpiOracleChgVarBounds(SCIP *scip, SCIP_NLPIORACLE *oracle, int nvars, const int *indices, const SCIP_Real *lbs, const SCIP_Real *ubs)
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_Bool SCIPnlpiOracleIsConstraintNonlinear(SCIP_NLPIORACLE *oracle, int considx)
SCIP_RETCODE SCIPnlpiOracleDelVarSet(SCIP *scip, SCIP_NLPIORACLE *oracle, int *delstats)
SCIP_RETCODE SCIPnlpiOracleEvalConstraintValues(SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Real *convals)
SCIP_RETCODE SCIPnlpiOracleCreate(SCIP *scip, SCIP_NLPIORACLE **oracle)
void SCIPnlpiOracleGetVarCounts(SCIP *scip, SCIP_NLPIORACLE *oracle, const int **lincounts, const int **nlcounts)
char * SCIPnlpiOracleGetConstraintName(SCIP_NLPIORACLE *oracle, int considx)
SCIP_RETCODE SCIPnlpiOracleEvalObjectiveGradient(SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Bool isnewx, SCIP_Real *objval, SCIP_Real *objgrad)
SCIP_RETCODE SCIPnlpiOracleResetEvalTime(SCIP *scip, SCIP_NLPIORACLE *oracle)
SCIP_RETCODE SCIPnlpiOraclePrintProblem(SCIP *scip, SCIP_NLPIORACLE *oracle, FILE *file)
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_Real SCIPnlpiOracleGetConstraintRhs(SCIP_NLPIORACLE *oracle, int considx)
SCIP_Real SCIPnlpiOracleGetEvalTime(SCIP *scip, SCIP_NLPIORACLE *oracle)
SCIP_RETCODE SCIPnlpiOracleChgConsSides(SCIP *scip, SCIP_NLPIORACLE *oracle, int nconss, const int *indices, const SCIP_Real *lhss, const SCIP_Real *rhss)
SCIP_Real SCIPnlpiOracleGetConstraintLhs(SCIP_NLPIORACLE *oracle, int considx)
SCIP_RETCODE SCIPnlpiOracleGetJacobianColSparsity(SCIP *scip, SCIP_NLPIORACLE *oracle, const int **coloffsets, const int **rows, const SCIP_Bool **rownlflags, int *nnlnz)
SCIP_RETCODE SCIPnlpiOracleAddVars(SCIP *scip, SCIP_NLPIORACLE *oracle, int nvars, const SCIP_Real *lbs, const SCIP_Real *ubs, const char **varnames)
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, SCIP_Bool colwise)
SCIP_RETCODE SCIPnlpiOracleEvalConstraintGradient(SCIP *scip, SCIP_NLPIORACLE *oracle, const int considx, const SCIP_Real *x, SCIP_Bool isnewx, SCIP_Real *conval, SCIP_Real *congrad)
int SCIPnlpiOracleGetNVars(SCIP_NLPIORACLE *oracle)
int SCIPnlpiOracleGetNConstraints(SCIP_NLPIORACLE *oracle)
SCIP_RETCODE SCIPnlpiOracleGetObjGradientNnz(SCIP *scip, SCIP_NLPIORACLE *oracle, const int **nz, const SCIP_Bool **nlnz, int *nnz, int *nnlnz)
SCIP_EXPRINTCAPABILITY SCIPnlpiOracleGetEvalCapability(SCIP *scip, SCIP_NLPIORACLE *oracle)
SCIP_Real SCIPnlpiOracleGetObjectiveConstant(SCIP_NLPIORACLE *oracle)
SCIP_RETCODE SCIPnlpiOraclePrintProblemGams(SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_Real *initval, FILE *file)
SCIP_Bool SCIPnlpiOracleIsVarNonlinear(SCIP *scip, SCIP_NLPIORACLE *oracle, int varidx)
SCIP_RETCODE SCIPnlpiOracleEvalJacobian(SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Bool isnewx, SCIP_Real *convals, SCIP_Real *jacobi)
SCIP_RETCODE SCIPnlpiOracleDelConsSet(SCIP *scip, SCIP_NLPIORACLE *oracle, int *delstats)
SCIP_RETCODE SCIPnlpiOracleSetProblemName(SCIP *scip, SCIP_NLPIORACLE *oracle, const char *name)
SCIP_RETCODE SCIPnlpiOracleChgObjConstant(SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_Real objconstant)
SCIP_RETCODE SCIPnlpiOracleEvalConstraintValue(SCIP *scip, SCIP_NLPIORACLE *oracle, int considx, const SCIP_Real *x, SCIP_Real *conval)
char ** SCIPnlpiOracleGetVarNames(SCIP_NLPIORACLE *oracle)
SCIP_Real SCIPnlpiOracleGetConstraintLinearCoef(SCIP_NLPIORACLE *oracle, int considx, int varpos)
SCIP_RETCODE SCIPnlpiOracleEvalObjectiveInterval(SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_Real infinity, const SCIP_Real *xmin, const SCIP_Real *xmax, SCIP_Real *objmin, SCIP_Real *objmax)
const SCIP_Real * SCIPnlpiOracleGetVarLbs(SCIP_NLPIORACLE *oracle)
const SCIP_Real * SCIPnlpiOracleGetVarUbs(SCIP_NLPIORACLE *oracle)
SCIP_RETCODE SCIPnlpiOracleFree(SCIP *scip, SCIP_NLPIORACLE **oracle)
struct SCIP_NlpiOracle SCIP_NLPIORACLE
const char * SCIPnlpiOracleGetProblemName(SCIP_NLPIORACLE *oracle)
SCIP_RETCODE SCIPnlpiOracleChgExpr(SCIP *scip, SCIP_NLPIORACLE *oracle, int considx, SCIP_EXPR *expr)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
const char * SCIPexprhdlrGetName(SCIP_EXPRHDLR *exprhdlr)
void SCIPexprSetActivity(SCIP_EXPR *expr, SCIP_INTERVAL activity, SCIP_Longint activitytag)
SCIP_Bool SCIPexpriterIsEnd(SCIP_EXPRITER *iterator)
SCIP_RETCODE SCIPreleaseExpr(SCIP *scip, SCIP_EXPR **expr)
SCIP_EXPR * SCIPexpriterGetCurrent(SCIP_EXPRITER *iterator)
void SCIPexpriterSetStagesDFS(SCIP_EXPRITER *iterator, SCIP_EXPRITER_STAGE stopstages)
SCIP_EXPR * SCIPexpriterRestartDFS(SCIP_EXPRITER *iterator, SCIP_EXPR *expr)
SCIP_RETCODE SCIPcreateExpriter(SCIP *scip, SCIP_EXPRITER **iterator)
SCIP_RETCODE SCIPprintExpr(SCIP *scip, SCIP_EXPR *expr, FILE *file)
SCIP_EXPR * SCIPexpriterGetNext(SCIP_EXPRITER *iterator)
SCIP_INTERVAL SCIPexprGetActivity(SCIP_EXPR *expr)
void SCIPfreeExpriter(SCIP_EXPRITER **iterator)
void SCIPcaptureExpr(SCIP_EXPR *expr)
SCIP_RETCODE SCIPexpriterInit(SCIP_EXPRITER *iterator, SCIP_EXPR *expr, SCIP_EXPRITER_TYPE type, SCIP_Bool allowrevisit)
SCIP_EXPRHDLR * SCIPexprGetHdlr(SCIP_EXPR *expr)
void SCIPintervalSet(SCIP_INTERVAL *resultant, SCIP_Real value)
SCIP_Bool SCIPintervalIsEmpty(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
struct SCIP_Interval SCIP_INTERVAL
void SCIPintervalMulScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalAdd(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
#define SCIPfreeCleanBufferArray(scip, ptr)
#define SCIPallocCleanBufferArray(scip, ptr, num)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define SCIPallocClearBlockMemory(scip, ptr)
#define SCIPensureBlockMemoryArray(scip, ptr, arraysizeptr, minsize)
#define SCIPallocClearBlockMemoryArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPallocMemory(scip, ptr)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_RETCODE SCIPresetClock(SCIP *scip, SCIP_CLOCK *clck)
void SCIPsetClockEnabled(SCIP_CLOCK *clck, SCIP_Bool enable)
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_Real SCIPgetClockTime(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsortedvecFindInt(int *intarray, int val, int len, int *pos)
void SCIPsortedvecInsertInt(int *intarray, int keyval, int *len, int *pos)
void SCIPsortIntReal(int *intarray, SCIP_Real *realarray, int len)
int SCIPsnprintf(char *t, int len, const char *s,...)
assert(minobj< SCIPgetCutoffbound(scip))
#define BMSfreeMemory(ptr)
#define BMSclearMemory(ptr)
#define BMScopyMemoryArray(ptr, source, num)
#define BMSclearMemoryArray(ptr, num)
static SCIP_RETCODE moveVariable(SCIP *scip, SCIP_NLPIORACLE *oracle, int fromidx, int toidx)
static SCIP_RETCODE ensureIntArraySize(SCIP *scip, int **intarray, int *len, int minsize)
static SCIP_RETCODE freeConstraint(SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_NLPIORACLECONS **cons, SCIP_Bool updatevarcount)
static SCIP_RETCODE hessLagAddExpr(SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_Real weight, const SCIP_Real *x, SCIP_Bool new_x, SCIP_EXPR *expr, SCIP_EXPRINTDATA *exprintdata, int *hesoffset, int *hesnzidcs, SCIP_Real *values, SCIP_Bool colwise)
static SCIP_RETCODE updateVariableCounts(SCIP *scip, SCIP_NLPIORACLE *oracle, int factor, int nlinidxs, const int *linidxs, SCIP_EXPR *expr)
static void freeVariables(SCIP *scip, SCIP_NLPIORACLE *oracle)
static SCIP_RETCODE evalFunctionInterval(SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_NLPIORACLECONS *cons, SCIP_Real infinity, const SCIP_Real *xmin, const SCIP_Real *xmax, SCIP_Real *valmin, SCIP_Real *valmax)
static SCIP_RETCODE hessLagSparsitySetNzFlagForExpr(SCIP *scip, SCIP_NLPIORACLE *oracle, int **nz, int *len, int *nnz, int *nzcount, SCIP_EXPR *expr, SCIP_EXPRINTDATA *exprintdata, int dim, SCIP_Bool colwise)
static void clearDeletedLinearElements(int **linidxs, SCIP_Real **coefs, int *nidxs)
static SCIP_RETCODE ensureConssSize(SCIP *scip, SCIP_NLPIORACLE *oracle, int minsize)
static SCIP_RETCODE computeRowJacobianSparsity(SCIP *scip, SCIP_NLPIORACLE *oracle, int *nnz, int *nvarnnz)
static SCIP_RETCODE createConstraint(SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_NLPIORACLECONS **cons, int nlinidxs, const int *linidxs, const SCIP_Real *lincoefs, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs, const char *name)
static void invalidateJacobiSparsity(SCIP *scip, SCIP_NLPIORACLE *oracle)
static void printName(char *buffer, char *name, int idx, char prefix, const char *suffix, SCIP_Bool longnames)
static SCIP_RETCODE exprIsNonSmooth(SCIP *scip, SCIP_EXPR *expr, SCIP_Bool *nonsmooth)
static SCIP_RETCODE ensureConsLinSize(SCIP *scip, SCIP_NLPIORACLECONS *cons, int minsize)
static void mapIndices(int *indexmap, int nindices, int *indices)
static SCIP_RETCODE printFunction(SCIP *scip, SCIP_NLPIORACLE *oracle, FILE *file, SCIP_NLPIORACLECONS *cons, SCIP_Bool longvarnames)
static SCIP_RETCODE ensureVarsSize(SCIP *scip, SCIP_NLPIORACLE *oracle, int minsize)
static SCIP_RETCODE evalFunctionValue(SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_NLPIORACLECONS *cons, const SCIP_Real *x, SCIP_Real *val)
static void invalidateHessianLagSparsity(SCIP *scip, SCIP_NLPIORACLE *oracle)
static void sortLinearCoefficients(int *nidxs, int *idxs, SCIP_Real *coefs)
static SCIP_RETCODE ensureClearBoolArraySize(SCIP *scip, SCIP_Bool **boolarray, int *len, int minsize)
static SCIP_RETCODE evalFunctionGradient(SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_NLPIORACLECONS *cons, const SCIP_Real *x, SCIP_Bool isnewx, SCIP_Real *RESTRICT val, SCIP_Real *RESTRICT grad)
static SCIP_RETCODE freeConstraints(SCIP *scip, SCIP_NLPIORACLE *oracle)
struct SCIP_NlpiOracleCons SCIP_NLPIORACLECONS
methods to store an NLP and request function, gradient, and Hessian values
SCIP_EXPRINTDATA * exprintdata
SCIP_Bool * jacrownlflags
SCIP_NLPIORACLECONS * objective
SCIP_EXPRINT * exprinterpreter
SCIP_NLPIORACLECONS ** conss
SCIP_Bool * jaccolnlflags
struct SCIP_Clock SCIP_CLOCK
struct SCIP_Expr SCIP_EXPR
struct SCIP_ExprIter SCIP_EXPRITER
#define SCIP_EXPRITER_LEAVEEXPR
struct SCIP_ExprIntData SCIP_EXPRINTDATA
#define SCIP_EXPRINTCAPABILITY_ALL
struct SCIP_ExprInt SCIP_EXPRINT
unsigned int SCIP_EXPRINTCAPABILITY
enum SCIP_Retcode SCIP_RETCODE