nlpi.c
Go to the documentation of this file.
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
59 SCIP_DECL_NLPICHGLINEARCOEFS ((*nlpichglinearcoefs)), /**< change coefficients in linear part of a constraint or objective */
60 SCIP_DECL_NLPICHGQUADCOEFS ((*nlpichgquadcoefs)), /**< change coefficients in quadratic part of a constraint or objective */
61 SCIP_DECL_NLPICHGEXPRTREE ((*nlpichgexprtree)), /**< change nonlinear expression a constraint or objective */
62 SCIP_DECL_NLPICHGNONLINCOEF ((*nlpichgnonlincoef)), /**< change one parameter in nonlinear expressions of a constraint or objective */
63 SCIP_DECL_NLPICHGOBJCONSTANT ((*nlpichgobjconstant)), /**< change the constant offset in the objective */
64 SCIP_DECL_NLPISETINITIALGUESS ((*nlpisetinitialguess)), /**< set initial guess for primal variables */
70 SCIP_DECL_NLPIGETWARMSTARTSIZE ((*nlpigetwarmstartsize)), /**< get size for warmstart object buffer */
124 SCIP_ALLOC( BMSduplicateMemoryArray(&(*nlpi)->description, description, strlen(description)+1) );
275 const int* nlininds, /**< number of linear coefficients for each constraint, may be NULL in case of no linear part */
276 int* const* lininds, /**< indices of variables for linear coefficients for each constraint, may be NULL in case of no linear part */
277 SCIP_Real* const* linvals, /**< values of linear coefficient for each constraint, may be NULL in case of no linear part */
280 SCIP_QUADELEM* const* quadelems, /**< quadratic elements specifying quadratic part for each constraint, entry of array may be NULL in case of no quadratic part,
282 int* const* exprvaridxs, /**< indices of variables in expression tree, maps variable indices in expression
285 SCIP_EXPRTREE* const* exprtrees, /**< exprtrees expression tree for nonquadratic part of constraints, entry of
294 SCIP_CALL( (*nlpi->nlpiaddconstraints)(nlpi, problem, nconss, lhss, rhss, nlininds, lininds, linvals,
308 const SCIP_QUADELEM* quadelems, /**< entries in matrix of quadratic part, may be NULL in case of no quadratic part */
309 const int* exprvaridxs, /**< indices of variables in expression tree, maps variable indices in expression
311 const SCIP_EXPRTREE* exprtree, /**< expression tree for nonquadratic part of objective function, may be NULL in
319 SCIP_CALL( (*nlpi->nlpisetobjective)(nlpi, problem, nlins, lininds, linvals, nquadelems, quadelems,
419 const SCIP_QUADELEM* quadelems /**< new elements in quadratic matrix (replacing already existing ones or adding new ones) */
435 const int* exprvaridxs, /**< indices of variables in expression tree, maps variable indices in expression tree to indices in nlp, or NULL */
483 SCIP_Real* primalvalues, /**< initial primal values for variables, or NULL to clear previous values */
484 SCIP_Real* consdualvalues, /**< initial dual values for constraints, or NULL to clear previous values */
485 SCIP_Real* varlbdualvalues, /**< initial dual values for variable lower bounds, or NULL to clear previous values */
486 SCIP_Real* varubdualvalues /**< initial dual values for variable upper bounds, or NULL to clear previous values */
492 SCIP_CALL( (*nlpi->nlpisetinitialguess)(nlpi, problem, primalvalues, consdualvalues, varlbdualvalues, varubdualvalues) );
536 * for a ranged constraint, the dual variable is positive if the right hand side is active and negative if the left hand side is active
541 SCIP_Real** primalvalues, /**< buffer to store pointer to array to primal values, or NULL if not needed */
542 SCIP_Real** consdualvalues, /**< buffer to store pointer to array to dual values of constraints, or NULL if not needed */
543 SCIP_Real** varlbdualvalues, /**< buffer to store pointer to array to dual values of variable lower bounds, or NULL if not needed */
544 SCIP_Real** varubdualvalues, /**< buffer to store pointer to array to dual values of variable lower bounds, or NULL if not needed */
551 SCIP_CALL( (*nlpi->nlpigetsolution)(nlpi, problem, primalvalues, consdualvalues, varlbdualvalues, varubdualvalues, objval) );
653 * if problem is NULL and type == SCIP_NLPPAR_INFINITY, then gets solver-wide value for infinity */
656 SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure, can be NULL only if type == SCIP_NLPPAR_INFINITY */
671 * if problem is NULL and type == SCIP_NLPPAR_INFINITY, then sets solver-wide value for infinity */
674 SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure, can be NULL only if type == SCIP_NLPPAR_INFINITY */
692 const char** sval /**< pointer to store the parameter value, the user must not modify the string */
724 SCIP_MESSAGEHDLR* messagehdlr /**< pointer to message handler, or NULL to suppress all output */
SCIP_RETCODE SCIPnlpiGetRealPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, SCIP_Real *dval)
Definition: nlpi.c:654
SCIP_RETCODE SCIPnlpiAddVars(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int nvars, const SCIP_Real *lbs, const SCIP_Real *ubs, const char **varnames)
Definition: nlpi.c:251
data definitions for an NLP solver interface
SCIP_RETCODE SCIPnlpiGetWarmstartMemo(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, void *buffer)
Definition: nlpi.c:587
internal methods for NLPI solver interfaces
SCIP_RETCODE SCIPnlpiCreateProblem(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM **problem, const char *name)
Definition: nlpi.c:212
SCIP_RETCODE SCIPnlpiChgVarBounds(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int nvars, const int *indices, const SCIP_Real *lbs, const SCIP_Real *ubs)
Definition: nlpi.c:326
SCIP_RETCODE SCIPnlpiSetStringPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, const char *sval)
Definition: nlpi.c:705
Definition: struct_message.h:36
SCIP_RETCODE SCIPnlpiDelVarSet(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int *dstats, int dstatssize)
Definition: nlpi.c:362
Definition: type_expr.h:100
SCIP_RETCODE SCIPnlpiSetRealPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: nlpi.c:672
void * SCIPnlpiGetProblemPointer(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:239
#define SCIP_DECL_NLPIGETPROBLEMPOINTER(x)
Definition: type_nlpi.h:140
SCIP_RETCODE SCIPnlpiSetObjective(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int nlins, const int *lininds, const SCIP_Real *linvals, int nquadelems, const SCIP_QUADELEM *quadelems, const int *exprvaridxs, const SCIP_EXPRTREE *exprtree, const SCIP_Real constant)
Definition: nlpi.c:301
SCIP_RETCODE SCIPnlpiSetMessageHdlr(SCIP_NLPI *nlpi, SCIP_MESSAGEHDLR *messagehdlr)
Definition: nlpi.c:722
SCIP_RETCODE SCIPnlpiAddConstraints(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, 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 **names)
Definition: nlpi.c:269
SCIP_RETCODE SCIPnlpiGetStatistics(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:557
void SCIPnlpStatisticsFree(BMS_BLKMEM *blkmem, SCIP_NLPSTATISTICS **statistics)
Definition: nlpi.c:803
SCIP_RETCODE SCIPnlpiGetStringPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, const char **sval)
Definition: nlpi.c:688
Definition: struct_nlpi.h:78
SCIP_RETCODE SCIPnlpiGetSolution(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_Real **primalvalues, SCIP_Real **consdualvalues, SCIP_Real **varlbdualvalues, SCIP_Real **varubdualvalues, SCIP_Real *objval)
Definition: nlpi.c:538
SCIP_NLPSOLSTAT SCIPnlpiGetSolstat(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:512
void SCIPnlpStatisticsSetNIterations(SCIP_NLPSTATISTICS *statistics, int niterations)
Definition: nlpi.c:838
SCIP_RETCODE SCIPnlpiDelConsSet(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int *dstats, int dstatssize)
Definition: nlpi.c:379
Definition: type_retcode.h:33
SCIP_RETCODE SCIPnlpiChgNonlinCoef(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int considx, int paramidx, SCIP_Real value)
Definition: nlpi.c:448
void SCIPnlpStatisticsSetTotalTime(SCIP_NLPSTATISTICS *statistics, SCIP_Real totaltime)
Definition: nlpi.c:848
SCIP_RETCODE SCIPnlpiSetInitialGuess(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_Real *primalvalues, SCIP_Real *consdualvalues, SCIP_Real *varlbdualvalues, SCIP_Real *varubdualvalues)
Definition: nlpi.c:480
SCIP_RETCODE SCIPnlpiChgExprtree(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int idxcons, const int *exprvaridxs, const SCIP_EXPRTREE *exprtree)
Definition: nlpi.c:431
Definition: type_nlpi.h:50
int SCIPnlpStatisticsGetNIterations(SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:818
SCIP_RETCODE SCIPnlpiGetWarmstartSize(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, size_t *size)
Definition: nlpi.c:572
SCIP_RETCODE SCIPnlpiSetIntPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, int ival)
Definition: nlpi.c:637
SCIP_RETCODE SCIPnlpiSolve(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:498
SCIP_RETCODE SCIPnlpiChgLinearCoefs(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, const int idx, int nvals, const int *varidxs, const SCIP_Real *vals)
Definition: nlpi.c:396
SCIP_RETCODE SCIPnlpiCreate(SCIP_NLPI **nlpi, const char *name, const char *description, int priority, SCIP_DECL_NLPICOPY((*nlpicopy)), SCIP_DECL_NLPIFREE((*nlpifree)), SCIP_DECL_NLPIGETSOLVERPOINTER((*nlpigetsolverpointer)), SCIP_DECL_NLPICREATEPROBLEM((*nlpicreateproblem)), SCIP_DECL_NLPIFREEPROBLEM((*nlpifreeproblem)), SCIP_DECL_NLPIGETPROBLEMPOINTER((*nlpigetproblempointer)), SCIP_DECL_NLPIADDVARS((*nlpiaddvars)), SCIP_DECL_NLPIADDCONSTRAINTS((*nlpiaddconstraints)), SCIP_DECL_NLPISETOBJECTIVE((*nlpisetobjective)), SCIP_DECL_NLPICHGVARBOUNDS((*nlpichgvarbounds)), SCIP_DECL_NLPICHGCONSSIDES((*nlpichgconssides)), SCIP_DECL_NLPIDELVARSET((*nlpidelvarset)), SCIP_DECL_NLPIDELCONSSET((*nlpidelconsset)), SCIP_DECL_NLPICHGLINEARCOEFS((*nlpichglinearcoefs)), SCIP_DECL_NLPICHGQUADCOEFS((*nlpichgquadcoefs)), SCIP_DECL_NLPICHGEXPRTREE((*nlpichgexprtree)), SCIP_DECL_NLPICHGNONLINCOEF((*nlpichgnonlincoef)), SCIP_DECL_NLPICHGOBJCONSTANT((*nlpichgobjconstant)), SCIP_DECL_NLPISETINITIALGUESS((*nlpisetinitialguess)), SCIP_DECL_NLPISOLVE((*nlpisolve)), SCIP_DECL_NLPIGETSOLSTAT((*nlpigetsolstat)), SCIP_DECL_NLPIGETTERMSTAT((*nlpigettermstat)), SCIP_DECL_NLPIGETSOLUTION((*nlpigetsolution)), SCIP_DECL_NLPIGETSTATISTICS((*nlpigetstatistics)), SCIP_DECL_NLPIGETWARMSTARTSIZE((*nlpigetwarmstartsize)), SCIP_DECL_NLPIGETWARMSTARTMEMO((*nlpigetwarmstartmemo)), SCIP_DECL_NLPISETWARMSTARTMEMO((*nlpisetwarmstartmemo)), SCIP_DECL_NLPIGETINTPAR((*nlpigetintpar)), SCIP_DECL_NLPISETINTPAR((*nlpisetintpar)), SCIP_DECL_NLPIGETREALPAR((*nlpigetrealpar)), SCIP_DECL_NLPISETREALPAR((*nlpisetrealpar)), SCIP_DECL_NLPIGETSTRINGPAR((*nlpigetstringpar)), SCIP_DECL_NLPISETSTRINGPAR((*nlpisetstringpar)), SCIP_DECL_NLPISETMESSAGEHDLR((*nlpisetmessagehdlr)), SCIP_NLPIDATA *nlpidata)
Definition: nlpi.c:41
SCIP_Real SCIPnlpStatisticsGetTotalTime(SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:828
SCIP_RETCODE SCIPnlpiChgConsSides(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int nconss, const int *indices, const SCIP_Real *lhss, const SCIP_Real *rhss)
Definition: nlpi.c:344
SCIP_RETCODE SCIPnlpiChgObjConstant(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_Real objconstant)
Definition: nlpi.c:465
SCIP_RETCODE SCIPnlpiFreeProblem(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM **problem)
Definition: nlpi.c:225
SCIP_RETCODE SCIPnlpiSetWarmstartMemo(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, void *buffer)
Definition: nlpi.c:602
public methods for message output
SCIP_NLPTERMSTAT SCIPnlpiGetTermstat(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:524
SCIP_RETCODE SCIPnlpStatisticsCreate(BMS_BLKMEM *blkmem, SCIP_NLPSTATISTICS **statistics)
Definition: nlpi.c:786
Definition: struct_expr.h:55
SCIP_RETCODE SCIPnlpiChgQuadCoefs(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int idx, int nquadelems, const SCIP_QUADELEM *quadelems)
Definition: nlpi.c:414
Definition: nlpi_all.c:47
SCIP_RETCODE SCIPnlpiCopy(BMS_BLKMEM *blkmem, SCIP_NLPI *sourcenlpi, SCIP_NLPI **targetnlpi)
Definition: nlpi.c:166
SCIP_RETCODE SCIPnlpiGetIntPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, int *ival)
Definition: nlpi.c:620
memory allocation routines
Definition: struct_nlpi.h:35