nlpi.c
Go to the documentation of this file.
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
58 SCIP_DECL_NLPICHGLINEARCOEFS ((*nlpichglinearcoefs)), /**< change coefficients in linear part of a constraint or objective */
59 SCIP_DECL_NLPICHGQUADCOEFS ((*nlpichgquadcoefs)), /**< change coefficients in quadratic part of a constraint or objective */
60 SCIP_DECL_NLPICHGEXPRTREE ((*nlpichgexprtree)), /**< change nonlinear expression a constraint or objective */
61 SCIP_DECL_NLPICHGNONLINCOEF ((*nlpichgnonlincoef)), /**< change one parameter in nonlinear expressions of a constraint or objective */
62 SCIP_DECL_NLPICHGOBJCONSTANT ((*nlpichgobjconstant)), /**< change the constant offset in the objective */
63 SCIP_DECL_NLPISETINITIALGUESS ((*nlpisetinitialguess)), /**< set initial guess for primal variables */
69 SCIP_DECL_NLPIGETWARMSTARTSIZE ((*nlpigetwarmstartsize)), /**< get size for warmstart object buffer */
123 SCIP_ALLOC( BMSduplicateMemoryArray(&(*nlpi)->description, description, strlen(description)+1) );
274 const int* nlininds, /**< number of linear coefficients for each constraint, may be NULL in case of no linear part */
275 int* const* lininds, /**< indices of variables for linear coefficients for each constraint, may be NULL in case of no linear part */
276 SCIP_Real* const* linvals, /**< values of linear coefficient for each constraint, may be NULL in case of no linear part */
279 SCIP_QUADELEM* const* quadelems, /**< quadratic elements specifying quadratic part for each constraint, entry of array may be NULL in case of no quadratic part,
281 int* const* exprvaridxs, /**< indices of variables in expression tree, maps variable indices in expression
284 SCIP_EXPRTREE* const* exprtrees, /**< exprtrees expression tree for nonquadratic part of constraints, entry of
293 SCIP_CALL( (*nlpi->nlpiaddconstraints)(nlpi, problem, nconss, lhss, rhss, nlininds, lininds, linvals,
307 const SCIP_QUADELEM* quadelems, /**< entries in matrix of quadratic part, may be NULL in case of no quadratic part */
308 const int* exprvaridxs, /**< indices of variables in expression tree, maps variable indices in expression
310 const SCIP_EXPRTREE* exprtree, /**< expression tree for nonquadratic part of objective function, may be NULL in
318 SCIP_CALL( (*nlpi->nlpisetobjective)(nlpi, problem, nlins, lininds, linvals, nquadelems, quadelems,
418 const SCIP_QUADELEM* quadelems /**< new elements in quadratic matrix (replacing already existing ones or adding new ones) */
434 const int* exprvaridxs, /**< indices of variables in expression tree, maps variable indices in expression tree to indices in nlp, or NULL */
482 SCIP_Real* primalvalues, /**< initial primal values for variables, or NULL to clear previous values */
483 SCIP_Real* consdualvalues, /**< initial dual values for constraints, or NULL to clear previous values */
484 SCIP_Real* varlbdualvalues, /**< initial dual values for variable lower bounds, or NULL to clear previous values */
485 SCIP_Real* varubdualvalues /**< initial dual values for variable upper bounds, or NULL to clear previous values */
491 SCIP_CALL( (*nlpi->nlpisetinitialguess)(nlpi, problem, primalvalues, consdualvalues, varlbdualvalues, varubdualvalues) );
535 * 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
540 SCIP_Real** primalvalues, /**< buffer to store pointer to array to primal values, or NULL if not needed */
541 SCIP_Real** consdualvalues, /**< buffer to store pointer to array to dual values of constraints, or NULL if not needed */
542 SCIP_Real** varlbdualvalues, /**< buffer to store pointer to array to dual values of variable lower bounds, or NULL if not needed */
543 SCIP_Real** varubdualvalues, /**< buffer to store pointer to array to dual values of variable lower bounds, or NULL if not needed */
550 SCIP_CALL( (*nlpi->nlpigetsolution)(nlpi, problem, primalvalues, consdualvalues, varlbdualvalues, varubdualvalues, objval) );
652 * if problem is NULL and type == SCIP_NLPPAR_INFINITY, then gets solver-wide value for infinity */
655 SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure, can be NULL only if type == SCIP_NLPPAR_INFINITY */
670 * if problem is NULL and type == SCIP_NLPPAR_INFINITY, then sets solver-wide value for infinity */
673 SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure, can be NULL only if type == SCIP_NLPPAR_INFINITY */
691 const char** sval /**< pointer to store the parameter value, the user must not modify the string */
722 SCIP_MESSAGEHDLR* messagehdlr /**< pointer to message handler, or NULL to suppress all output */
SCIP_RETCODE SCIPnlpiSetWarmstartMemo(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, void *buffer)
Definition: nlpi.c:601
SCIP_RETCODE SCIPnlpiGetStatistics(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:556
data definitions for an NLP solver interface
SCIP_Real SCIPnlpStatisticsGetTotalTime(SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:826
internal methods for NLPI solver interfaces
SCIP_RETCODE SCIPnlpiSetStringPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, const char *sval)
Definition: nlpi.c:704
SCIP_RETCODE SCIPnlpiCreateProblem(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM **problem, const char *name)
Definition: nlpi.c:211
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:537
SCIP_RETCODE SCIPnlpiDelVarSet(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int *dstats, int dstatssize)
Definition: nlpi.c:361
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:268
Definition: struct_message.h:36
Definition: type_expr.h:100
SCIP_RETCODE SCIPnlpiSetMessageHdlr(SCIP_NLPI *nlpi, SCIP_MESSAGEHDLR *messagehdlr)
Definition: nlpi.c:720
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:325
void SCIPnlpStatisticsFree(BMS_BLKMEM *blkmem, SCIP_NLPSTATISTICS **statistics)
Definition: nlpi.c:801
#define SCIP_DECL_NLPIGETPROBLEMPOINTER(x)
Definition: type_nlpi.h:140
SCIP_RETCODE SCIPnlpiSolve(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:497
SCIP_RETCODE SCIPnlpiGetStringPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, const char **sval)
Definition: nlpi.c:687
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:250
Definition: struct_nlpi.h:78
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:343
Definition: type_retcode.h:33
SCIP_RETCODE SCIPnlpiSetInitialGuess(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_Real *primalvalues, SCIP_Real *consdualvalues, SCIP_Real *varlbdualvalues, SCIP_Real *varubdualvalues)
Definition: nlpi.c:479
SCIP_NLPSOLSTAT SCIPnlpiGetSolstat(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:511
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:300
SCIP_RETCODE SCIPnlpiDelConsSet(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int *dstats, int dstatssize)
Definition: nlpi.c:378
SCIP_RETCODE SCIPnlpiFreeProblem(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM **problem)
Definition: nlpi.c:224
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:40
SCIP_RETCODE SCIPnlpiCopy(BMS_BLKMEM *blkmem, SCIP_NLPI *sourcenlpi, SCIP_NLPI **targetnlpi)
Definition: nlpi.c:165
Definition: type_nlpi.h:50
SCIP_RETCODE SCIPnlpiSetIntPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, int ival)
Definition: nlpi.c:636
void SCIPnlpStatisticsSetNIterations(SCIP_NLPSTATISTICS *statistics, int niterations)
Definition: nlpi.c:836
SCIP_NLPTERMSTAT SCIPnlpiGetTermstat(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:523
void SCIPnlpStatisticsSetTotalTime(SCIP_NLPSTATISTICS *statistics, SCIP_Real totaltime)
Definition: nlpi.c:846
SCIP_RETCODE SCIPnlpiChgNonlinCoef(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int considx, int paramidx, SCIP_Real value)
Definition: nlpi.c:447
SCIP_RETCODE SCIPnlpiChgQuadCoefs(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int idx, int nquadelems, const SCIP_QUADELEM *quadelems)
Definition: nlpi.c:413
SCIP_RETCODE SCIPnlpiGetWarmstartSize(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, size_t *size)
Definition: nlpi.c:571
void * SCIPnlpiGetProblemPointer(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:238
public methods for message output
SCIP_RETCODE SCIPnlpStatisticsCreate(BMS_BLKMEM *blkmem, SCIP_NLPSTATISTICS **statistics)
Definition: nlpi.c:784
SCIP_RETCODE SCIPnlpiGetWarmstartMemo(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, void *buffer)
Definition: nlpi.c:586
int SCIPnlpStatisticsGetNIterations(SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:816
SCIP_RETCODE SCIPnlpiChgLinearCoefs(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, const int idx, int nvals, const int *varidxs, const SCIP_Real *vals)
Definition: nlpi.c:395
SCIP_RETCODE SCIPnlpiChgExprtree(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int idxcons, const int *exprvaridxs, const SCIP_EXPRTREE *exprtree)
Definition: nlpi.c:430
SCIP_RETCODE SCIPnlpiGetIntPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, int *ival)
Definition: nlpi.c:619
Definition: struct_expr.h:55
SCIP_RETCODE SCIPnlpiGetRealPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, SCIP_Real *dval)
Definition: nlpi.c:653
SCIP_RETCODE SCIPnlpiChgObjConstant(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_Real objconstant)
Definition: nlpi.c:464
Definition: nlpi_all.c:47
SCIP_RETCODE SCIPnlpiSetRealPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: nlpi.c:671
memory allocation routines
Definition: struct_nlpi.h:35