Scippy

SCIP

Solving Constraint Integer Programs

nlpi.c
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2018 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file nlpi.c
17  * @brief methods for handling nlp interface
18  * @author Stefan Vigerske
19  * @author Thorsten Gellermann
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include <stdio.h>
25 #include <assert.h>
26 #include <string.h>
27 
28 #include "scip/pub_message.h"
29 #include "nlpi/nlpi.h"
30 #include "nlpi/struct_nlpi.h"
31 #include "blockmemshell/memory.h"
32 
33 /** compares two NLPIs w.r.t. their priority */
34 SCIP_DECL_SORTPTRCOMP(SCIPnlpiComp)
35 { /*lint --e{715}*/
36  return ((SCIP_NLPI*)elem2)->priority - ((SCIP_NLPI*)elem1)->priority;
37 }
38 
39 /** creates an NLP solver interface */
41  SCIP_NLPI** nlpi, /**< pointer to NLP interface data structure */
42  const char* name, /**< name of NLP interface */
43  const char* description, /**< description of NLP interface */
44  int priority, /**< priority of NLP interface */
45  SCIP_DECL_NLPICOPY ((*nlpicopy)), /**< copying an NLPI */
46  SCIP_DECL_NLPIFREE ((*nlpifree)), /**< free NLPI user data */
47  SCIP_DECL_NLPIGETSOLVERPOINTER ((*nlpigetsolverpointer)), /**< get solver pointer */
48  SCIP_DECL_NLPICREATEPROBLEM ((*nlpicreateproblem)), /**< create a new problem instance */
49  SCIP_DECL_NLPIFREEPROBLEM ((*nlpifreeproblem)), /**< free a problem instance */
50  SCIP_DECL_NLPIGETPROBLEMPOINTER ((*nlpigetproblempointer)), /**< get problem pointer */
51  SCIP_DECL_NLPIADDVARS ((*nlpiaddvars)), /**< add variables */
52  SCIP_DECL_NLPIADDCONSTRAINTS ((*nlpiaddconstraints)), /**< add constraints */
53  SCIP_DECL_NLPISETOBJECTIVE ((*nlpisetobjective)), /**< set objective */
54  SCIP_DECL_NLPICHGVARBOUNDS ((*nlpichgvarbounds)), /**< change variable bounds */
55  SCIP_DECL_NLPICHGCONSSIDES ((*nlpichgconssides)), /**< change constraint sides */
56  SCIP_DECL_NLPIDELVARSET ((*nlpidelvarset)), /**< delete a set of constraints */
57  SCIP_DECL_NLPIDELCONSSET ((*nlpidelconsset)), /**< delete a set of constraints */
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 */
64  SCIP_DECL_NLPISOLVE ((*nlpisolve)), /**< solve NLP */
65  SCIP_DECL_NLPIGETSOLSTAT ((*nlpigetsolstat)), /**< get solution status */
66  SCIP_DECL_NLPIGETTERMSTAT ((*nlpigettermstat)), /**< get termination status */
67  SCIP_DECL_NLPIGETSOLUTION ((*nlpigetsolution)), /**< get solution */
68  SCIP_DECL_NLPIGETSTATISTICS ((*nlpigetstatistics)), /**< get solve statistics */
69  SCIP_DECL_NLPIGETWARMSTARTSIZE ((*nlpigetwarmstartsize)), /**< get size for warmstart object buffer */
70  SCIP_DECL_NLPIGETWARMSTARTMEMO ((*nlpigetwarmstartmemo)), /**< get warmstart object */
71  SCIP_DECL_NLPISETWARMSTARTMEMO ((*nlpisetwarmstartmemo)), /**< set warmstart object */
72  SCIP_DECL_NLPIGETINTPAR ((*nlpigetintpar)), /**< get value of integer parameter */
73  SCIP_DECL_NLPISETINTPAR ((*nlpisetintpar)), /**< set value of integer parameter */
74  SCIP_DECL_NLPIGETREALPAR ((*nlpigetrealpar)), /**< get value of floating point parameter */
75  SCIP_DECL_NLPISETREALPAR ((*nlpisetrealpar)), /**< set value of floating point parameter */
76  SCIP_DECL_NLPIGETSTRINGPAR ((*nlpigetstringpar)), /**< get value of string parameter */
77  SCIP_DECL_NLPISETSTRINGPAR ((*nlpisetstringpar)), /**< set value of string parameter */
78  SCIP_DECL_NLPISETMESSAGEHDLR ((*nlpisetmessagehdlr)), /**< set message handler */
79  SCIP_NLPIDATA* nlpidata /**< NLP interface local data */
80  )
81 { /*lint --e{715}*/
82  assert(nlpi != NULL);
83 
84  assert(name != NULL);
85  assert(description != NULL);
86  assert(nlpicopy != NULL);
87  assert(nlpifree != NULL);
88  assert(nlpigetsolverpointer != NULL);
89  assert(nlpicreateproblem != NULL);
90  assert(nlpifreeproblem != NULL);
91  assert(nlpigetproblempointer != NULL);
92  assert(nlpiaddvars != NULL);
93  assert(nlpiaddconstraints != NULL);
94  assert(nlpisetobjective != NULL);
95  assert(nlpichgvarbounds != NULL);
96  assert(nlpichgconssides != NULL);
97  assert(nlpidelconsset != NULL);
98  assert(nlpichglinearcoefs != NULL);
99  assert(nlpichgquadcoefs != NULL);
100  assert(nlpichgexprtree != NULL);
101  assert(nlpichgnonlincoef != NULL);
102  assert(nlpichgobjconstant != NULL);
103  assert(nlpisetinitialguess != NULL);
104  assert(nlpisolve != NULL);
105  assert(nlpigetsolstat != NULL);
106  assert(nlpigettermstat != NULL);
107  assert(nlpigetsolution != NULL);
108  assert(nlpigetstatistics != NULL);
109  assert(nlpigetwarmstartsize != NULL);
110  assert(nlpigetwarmstartmemo != NULL);
111  assert(nlpisetwarmstartmemo != NULL);
112  assert(nlpigetintpar != NULL);
113  assert(nlpisetintpar != NULL);
114  assert(nlpigetrealpar != NULL);
115  assert(nlpisetrealpar != NULL);
116  assert(nlpigetstringpar != NULL);
117  assert(nlpisetstringpar != NULL);
118  assert(nlpisetmessagehdlr != NULL);
119 
120  SCIP_ALLOC( BMSallocMemory(nlpi) );
121 
122  SCIP_ALLOC( BMSduplicateMemoryArray(&(*nlpi)->name, name, strlen(name)+1) );
123  SCIP_ALLOC( BMSduplicateMemoryArray(&(*nlpi)->description, description, strlen(description)+1) );
124  (*nlpi)->priority = priority;
125  (*nlpi)->nlpicopy = nlpicopy;
126  (*nlpi)->nlpifree = nlpifree;
127  (*nlpi)->nlpigetsolverpointer = nlpigetsolverpointer;
128  (*nlpi)->nlpicreateproblem = nlpicreateproblem;
129  (*nlpi)->nlpifreeproblem = nlpifreeproblem;
130  (*nlpi)->nlpigetproblempointer = nlpigetproblempointer;
131  (*nlpi)->nlpiaddvars = nlpiaddvars;
132  (*nlpi)->nlpiaddconstraints = nlpiaddconstraints;
133  (*nlpi)->nlpisetobjective = nlpisetobjective;
134  (*nlpi)->nlpichgvarbounds = nlpichgvarbounds;
135  (*nlpi)->nlpichgconssides = nlpichgconssides;
136  (*nlpi)->nlpidelvarset = nlpidelvarset;
137  (*nlpi)->nlpidelconsset = nlpidelconsset;
138  (*nlpi)->nlpichglinearcoefs = nlpichglinearcoefs;
139  (*nlpi)->nlpichgquadcoefs = nlpichgquadcoefs;
140  (*nlpi)->nlpichgexprtree = nlpichgexprtree;
141  (*nlpi)->nlpichgnonlincoef = nlpichgnonlincoef;
142  (*nlpi)->nlpichgobjconstant = nlpichgobjconstant;
143  (*nlpi)->nlpisetinitialguess = nlpisetinitialguess;
144  (*nlpi)->nlpisolve = nlpisolve;
145  (*nlpi)->nlpigetsolstat = nlpigetsolstat;
146  (*nlpi)->nlpigettermstat = nlpigettermstat;
147  (*nlpi)->nlpigetsolution = nlpigetsolution;
148  (*nlpi)->nlpigetstatistics = nlpigetstatistics;
149  (*nlpi)->nlpigetwarmstartsize = nlpigetwarmstartsize;
150  (*nlpi)->nlpigetwarmstartmemo = nlpigetwarmstartmemo;
151  (*nlpi)->nlpisetwarmstartmemo = nlpisetwarmstartmemo;
152  (*nlpi)->nlpigetintpar = nlpigetintpar;
153  (*nlpi)->nlpisetintpar = nlpisetintpar;
154  (*nlpi)->nlpigetrealpar = nlpigetrealpar;
155  (*nlpi)->nlpisetrealpar = nlpisetrealpar;
156  (*nlpi)->nlpigetstringpar = nlpigetstringpar;
157  (*nlpi)->nlpisetstringpar = nlpisetstringpar;
158  (*nlpi)->nlpisetmessagehdlr = nlpisetmessagehdlr;
159  (*nlpi)->nlpidata = nlpidata;
160 
161  return SCIP_OKAY;
162 }
163 
164 /** copies an NLPI */
166  BMS_BLKMEM* blkmem, /**< block memory in target SCIP */
167  SCIP_NLPI* sourcenlpi, /**< pointer to NLPI data structure to copy */
168  SCIP_NLPI** targetnlpi /**< buffer to store pointer to copied NLPI data structure */
169  )
170 {
171  assert(blkmem != NULL);
172  assert(sourcenlpi != NULL);
173  assert(targetnlpi != NULL);
174 
175  SCIP_CALL( (*sourcenlpi->nlpicopy)(blkmem, sourcenlpi, targetnlpi) );
176 
177  return SCIP_OKAY;
178 }
179 
180 /** frees NLPI user data */
182  SCIP_NLPI** nlpi /**< pointer to NLPI data structure */
183  )
184 {
185  assert(nlpi != NULL);
186  assert(*nlpi != NULL);
187 
188  SCIP_CALL( (*(*nlpi)->nlpifree)((*nlpi)) );
189  BMSfreeMemoryArray(&(*nlpi)->name);
190  BMSfreeMemoryArray(&(*nlpi)->description);
191  BMSfreeMemory(nlpi);
192 
193  assert(*nlpi == NULL);
194 
195  return SCIP_OKAY;
196 }
197 
198 /** gets pointer for NLP solver
199  * @return void pointer to solver
200  */
202  SCIP_NLPI* nlpi /**< pointer to NLPI datastructure */
203  )
204 {
205  assert(nlpi != NULL);
206 
207  return (*nlpi->nlpigetsolverpointer)(nlpi);
208 }
209 
210 /** creates a problem instance */
212  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
213  SCIP_NLPIPROBLEM** problem, /**< pointer to store problem data */
214  const char* name /**< name of problem, can be NULL */
215  )
216 {
217  assert(nlpi != NULL);
218  assert(problem != NULL);
219 
220  return (*nlpi->nlpicreateproblem)(nlpi, problem, name);
221 }
222 
223 /** frees a problem instance */
225  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
226  SCIP_NLPIPROBLEM** problem /**< pointer where problem data is stored */
227  )
228 {
229  assert(nlpi != NULL);
230  assert(problem != NULL);
231 
232  return (*nlpi->nlpifreeproblem)(nlpi, problem);
233 }
234 
235 /** gets pointer to solver-internal problem instance
236  * @return void pointer to problem instance
237  */
239  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
240  SCIP_NLPIPROBLEM* problem /**< pointer where problem data is stored */
241  )
242 {
243  assert(nlpi != NULL);
244  assert(problem != NULL);
245 
246  return (*nlpi->nlpigetproblempointer)(nlpi, problem);
247 }
248 
249 /** add variables to nlpi */
251  SCIP_NLPI* nlpi, /**< pointer to NLPI data structure */
252  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
253  int nvars, /**< number of variables */
254  const SCIP_Real* lbs, /**< lower bounds of variables, can be NULL if -infinity */
255  const SCIP_Real* ubs, /**< ubs upper bounds of variables, can be NULL if +infinity */
256  const char** varnames /**< varnames names of variables, can be NULL */
257  )
258 {
259  assert(nlpi != NULL);
260  assert(problem != NULL);
261 
262  SCIP_CALL( (*nlpi->nlpiaddvars)(nlpi, problem, nvars, lbs, ubs, varnames) );
263 
264  return SCIP_OKAY;
265 }
266 
267 /** add constraints to nlpi */
269  SCIP_NLPI* nlpi, /**< pointer to NLPI data structure */
270  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
271  int nconss, /**< number of added constraints */
272  const SCIP_Real* lhss, /**< left hand sides of constraints */
273  const SCIP_Real* rhss, /**< right hand sides of constraints */
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 */
277  const int* nquadelems, /**< number of elements in matrix of quadratic part for each constraint,
278  * may be NULL in case of no quadratic part in any constraint */
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,
280  * may be NULL in case of no quadratic part in any constraint */
281  int* const* exprvaridxs, /**< indices of variables in expression tree, maps variable indices in expression
282  * tree to indices in nlp, entry of array may be NULL in case of no expression
283  * tree, may be NULL in case of no expression tree in any constraint */
284  SCIP_EXPRTREE* const* exprtrees, /**< exprtrees expression tree for nonquadratic part of constraints, entry of
285  * array may be NULL in case of no nonquadratic part, may be NULL in case of no
286  * nonquadratic part in any constraint */
287  const char** names /**< names of constraints, may be NULL or entries may be NULL */
288  )
289 {
290  assert(nlpi != NULL);
291  assert(problem != NULL);
292 
293  SCIP_CALL( (*nlpi->nlpiaddconstraints)(nlpi, problem, nconss, lhss, rhss, nlininds, lininds, linvals,
294  nquadelems, quadelems, exprvaridxs, exprtrees, names) );
295 
296  return SCIP_OKAY;
297 }
298 
299 /** sets or overwrites objective, a minimization problem is expected */
301  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
302  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
303  int nlins, /**< number of linear variables */
304  const int* lininds, /**< variable indices, may be NULL in case of no linear part */
305  const SCIP_Real* linvals, /**< coefficient values, may be NULL in case of no linear part */
306  int nquadelems, /**< number of entries in matrix of quadratic part */
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
309  * tree to indices in nlp, may be NULL in case of no expression tree */
310  const SCIP_EXPRTREE* exprtree, /**< expression tree for nonquadratic part of objective function, may be NULL in
311  * case of no nonquadratic part */
312  const SCIP_Real constant /**< objective value offset*/
313  )
314 {
315  assert(nlpi != NULL);
316  assert(problem != NULL);
317 
318  SCIP_CALL( (*nlpi->nlpisetobjective)(nlpi, problem, nlins, lininds, linvals, nquadelems, quadelems,
319  exprvaridxs, exprtree, constant) );
320 
321  return SCIP_OKAY;
322 }
323 
324 /** change variable bounds */
326  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
327  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
328  int nvars, /**< number of variables to change bounds */
329  const int* indices, /**< indices of variables to change bounds */
330  const SCIP_Real* lbs, /**< new lower bounds */
331  const SCIP_Real* ubs /**< new upper bounds */
332  )
333 {
334  assert(nlpi != NULL);
335  assert(problem != NULL);
336 
337  SCIP_CALL( (*nlpi->nlpichgvarbounds)(nlpi, problem, nvars, indices, lbs, ubs) );
338 
339  return SCIP_OKAY;
340 }
341 
342 /** change constraint bounds */
344  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
345  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
346  int nconss, /**< number of constraints to change sides */
347  const int* indices, /**< indices of constraints to change sides */
348  const SCIP_Real* lhss, /**< new left hand sides */
349  const SCIP_Real* rhss /**< new right hand sides */
350  )
351 {
352  assert(nlpi != NULL);
353  assert(problem != NULL);
354 
355  SCIP_CALL( (*nlpi->nlpichgconssides)(nlpi, problem, nconss, indices, lhss, rhss) );
356 
357  return SCIP_OKAY;
358 }
359 
360 /** delete a set of variables */
362  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
363  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
364  int* dstats, /**< deletion status of vars; 1 if var should be deleted, 0 if not; afterwards -1
365  * if var was deleted */
366  int dstatssize /**< size of the dstats array */
367  )
368 {
369  assert(nlpi != NULL);
370  assert(problem != NULL);
371 
372  SCIP_CALL( (*nlpi->nlpidelvarset)(nlpi, problem, dstats, dstatssize) );
373 
374  return SCIP_OKAY;
375 }
376 
377 /** delete a set of constraints */
379  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
380  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
381  int* dstats, /**< deletion status of rows; 1 if row should be deleted, 0 if not; afterwards -1
382  * if row was deleted */
383  int dstatssize /**< size of the dstats array */
384  )
385 {
386  assert(nlpi != NULL);
387  assert(problem != NULL);
388 
389  SCIP_CALL( (*nlpi->nlpidelconsset)(nlpi, problem, dstats, dstatssize) );
390 
391  return SCIP_OKAY;
392 }
393 
394 /** changes or adds linear coefficients in a constraint or objective */
396  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
397  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
398  const int idx, /**< index of constraint or -1 for objective */
399  int nvals, /**< number of values in linear constraint */
400  const int* varidxs, /**< indices of variable */
401  const SCIP_Real* vals /**< new values for coefficient */
402  )
403 {
404  assert(nlpi != NULL);
405  assert(problem != NULL);
406 
407  SCIP_CALL( (*nlpi->nlpichglinearcoefs)(nlpi, problem, idx, nvals, varidxs, vals) );
408 
409  return SCIP_OKAY;
410 }
411 
412 /** changes or adds coefficients in the quadratic part of a constraint or objective */
414  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
415  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
416  int idx, /**< index of constraint or -1 for objective */
417  int nquadelems, /**< number of entries in quadratic constraint to change */
418  const SCIP_QUADELEM* quadelems /**< new elements in quadratic matrix (replacing already existing ones or adding new ones) */
419  )
420 {
421  assert(nlpi != NULL);
422  assert(problem != NULL);
423 
424  SCIP_CALL( (*nlpi->nlpichgquadcoefs)(nlpi, problem, idx, nquadelems, quadelems) );
425 
426  return SCIP_OKAY;
427 }
428 
429 /** change the expression tree in the nonlinear part */
431  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
432  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
433  int idxcons, /**< index of constraint or -1 for objective */
434  const int* exprvaridxs, /**< indices of variables in expression tree, maps variable indices in expression tree to indices in nlp, or NULL */
435  const SCIP_EXPRTREE* exprtree /**< new expression tree, or NULL for no tree */
436  )
437 {
438  assert(nlpi != NULL);
439  assert(problem != NULL);
440 
441  SCIP_CALL( (*nlpi->nlpichgexprtree)(nlpi, problem, idxcons, exprvaridxs, exprtree) );
442 
443  return SCIP_OKAY;
444 }
445 
446 /** change the value of one parameter in the nonlinear part */
448  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
449  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
450  int considx, /**< index of constraint or -1 for objective */
451  int paramidx, /**< index of parameter */
452  SCIP_Real value /**< new value for nonlinear parameter */
453  )
454 {
455  assert(nlpi != NULL);
456  assert(problem != NULL);
457 
458  SCIP_CALL( (*nlpi->nlpichgnonlincoef)(nlpi, problem, considx, paramidx, value) );
459 
460  return SCIP_OKAY;
461 }
462 
463 /** change the constant offset in the objective */
465  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
466  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
467  SCIP_Real objconstant /**< new value for objective constant */
468  )
469 {
470  assert(nlpi != NULL);
471  assert(problem != NULL);
472 
473  SCIP_CALL( (*nlpi->nlpichgobjconstant)(nlpi, problem, objconstant) );
474 
475  return SCIP_OKAY;
476 }
477 
478 /** sets initial guess for primal variables */
480  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
481  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
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 */
486  )
487 {
488  assert(nlpi != NULL);
489  assert(problem != NULL);
490 
491  SCIP_CALL( (*nlpi->nlpisetinitialguess)(nlpi, problem, primalvalues, consdualvalues, varlbdualvalues, varubdualvalues) );
492 
493  return SCIP_OKAY;
494 }
495 
496 /** tries to solve NLP */
498  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
499  SCIP_NLPIPROBLEM* problem /**< pointer to problem data structure */
500  )
501 {
502  assert(nlpi != NULL);
503  assert(problem != NULL);
504 
505  SCIP_CALL( (*nlpi->nlpisolve)(nlpi, problem) );
506 
507  return SCIP_OKAY;
508 }
509 
510 /** gives solution status, return: Solution Status */
512  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
513  SCIP_NLPIPROBLEM* problem /**< pointer to problem data structure */
514  )
515 {
516  assert(nlpi != NULL);
517  assert(problem != NULL);
518 
519  return (*nlpi->nlpigetsolstat)(nlpi, problem);
520 }
521 
522 /** gives termination reason; return: Termination Status */
524  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
525  SCIP_NLPIPROBLEM* problem /**< pointer to problem data structure */
526  )
527 {
528  assert(nlpi != NULL);
529  assert(problem != NULL);
530 
531  return (*nlpi->nlpigettermstat)(nlpi, problem);
532 }
533 
534 /** gives primal and dual solution
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
536  */
538  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
539  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
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 */
544  SCIP_Real* objval /**< buffer to store the objective value, or NULL if not needed */
545  )
546 {
547  assert(nlpi != NULL);
548  assert(problem != NULL);
549 
550  SCIP_CALL( (*nlpi->nlpigetsolution)(nlpi, problem, primalvalues, consdualvalues, varlbdualvalues, varubdualvalues, objval) );
551 
552  return SCIP_OKAY;
553 }
554 
555 /** gives solve statistics */
557  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
558  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
559  SCIP_NLPSTATISTICS* statistics /**< pointer to store statistics */
560  )
561 {
562  assert(nlpi != NULL);
563  assert(problem != NULL);
564 
565  SCIP_CALL( (*nlpi->nlpigetstatistics)(nlpi, problem, statistics) );
566 
567  return SCIP_OKAY;
568 }
569 
570 /** gives required size of a buffer to store a warmstart object */
572  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
573  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
574  size_t* size /**< pointer to store required size for warmstart buffer */
575  )
576 {
577  assert(nlpi != NULL);
578  assert(problem != NULL);
579 
580  SCIP_CALL( (*nlpi->nlpigetwarmstartsize)(nlpi, problem, size) );
581 
582  return SCIP_OKAY;
583 }
584 
585 /** stores warmstart information in buffer */
587  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
588  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
589  void* buffer /**< memory to store warmstart information */
590  )
591 {
592  assert(nlpi != NULL);
593  assert(problem != NULL);
594 
595  SCIP_CALL( (*nlpi->nlpigetwarmstartmemo)(nlpi, problem, buffer) );
596 
597  return SCIP_OKAY;
598 }
599 
600 /** sets warmstart information in solver */
602  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
603  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
604  void* buffer /**< warmstart information */
605  )
606 {
607  assert(nlpi != NULL);
608  assert(problem != NULL);
609 
610  SCIP_CALL( (*nlpi->nlpisetwarmstartmemo)(nlpi, problem, buffer) );
611 
612  return SCIP_OKAY;
613 }
614 
615 /**@name Parameter Methods */
616 /**@{ */
617 
618 /** gets integer parameter of NLP */
620  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
621  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
622  SCIP_NLPPARAM type, /**< parameter number */
623  int* ival /**< pointer to store the parameter value */
624  )
625 {
626  assert(nlpi != NULL);
627  assert(problem != NULL);
628  assert(ival != NULL);
629 
630  SCIP_CALL( (*nlpi->nlpigetintpar)(nlpi, problem, type, ival) );
631 
632  return SCIP_OKAY;
633 }
634 
635 /** sets integer parameter of NLP */
637  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
638  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
639  SCIP_NLPPARAM type, /**< parameter number */
640  int ival /**< parameter value */
641  )
642 {
643  assert(nlpi != NULL);
644  assert(problem != NULL);
645 
646  SCIP_CALL( (*nlpi->nlpisetintpar)(nlpi, problem, type, ival) );
647 
648  return SCIP_OKAY;
649 }
650 
651 /** gets floating point parameter of NLP
652  * if problem is NULL and type == SCIP_NLPPAR_INFINITY, then gets solver-wide value for infinity */
654  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
655  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure, can be NULL only if type == SCIP_NLPPAR_INFINITY */
656  SCIP_NLPPARAM type, /**< parameter number */
657  SCIP_Real* dval /**< pointer to store the parameter value */
658  )
659 {
660  assert(nlpi != NULL);
661  assert(problem != NULL || type == SCIP_NLPPAR_INFINITY);
662  assert(dval != NULL);
663 
664  SCIP_CALL( (*nlpi->nlpigetrealpar)(nlpi, problem, type, dval) );
665 
666  return SCIP_OKAY;
667 }
668 
669 /** sets floating point parameter of NLP
670  * if problem is NULL and type == SCIP_NLPPAR_INFINITY, then sets solver-wide value for infinity */
672  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
673  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure, can be NULL only if type == SCIP_NLPPAR_INFINITY */
674  SCIP_NLPPARAM type, /**< parameter number */
675  SCIP_Real dval /**< parameter value */
676  )
677 {
678  assert(nlpi != NULL);
679  assert(problem != NULL || type == SCIP_NLPPAR_INFINITY);
680 
681  SCIP_CALL( (*nlpi->nlpisetrealpar)(nlpi, problem, type, dval) );
682 
683  return SCIP_OKAY;
684 }
685 
686 /** gets string parameter of NLP */
688  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
689  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
690  SCIP_NLPPARAM type, /**< parameter number */
691  const char** sval /**< pointer to store the parameter value, the user must not modify the string */
692  )
693 {
694  assert(nlpi != NULL);
695  assert(problem != NULL);
696  assert(sval != NULL);
697 
698  SCIP_CALL( (*nlpi->nlpigetstringpar)(nlpi, problem, type, sval) );
699 
700  return SCIP_OKAY;
701 }
702 
703 /** sets string parameter of NLP */
705  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
706  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
707  SCIP_NLPPARAM type, /**< parameter number */
708  const char* sval /**< parameter value */
709  )
710 {
711  assert(nlpi != NULL);
712  assert(problem != NULL);
713 
714  SCIP_CALL( (*nlpi->nlpisetstringpar)(nlpi, problem, type, sval) );
715 
716  return SCIP_OKAY;
717 }
718 
719 /** sets message handler for message output */
721  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
722  SCIP_MESSAGEHDLR* messagehdlr /**< pointer to message handler, or NULL to suppress all output */
723  )
724 {
725  assert(nlpi != NULL);
726 
727  SCIP_CALL( (*nlpi->nlpisetmessagehdlr)(nlpi, messagehdlr) );
728 
729  return SCIP_OKAY;
730 }
731 
732 /** gets data of an NLPI */
734  SCIP_NLPI* nlpi /**< NLP interface structure */
735  )
736 {
737  assert(nlpi != NULL);
738 
739  return nlpi->nlpidata;
740 }
741 
742 /** gets NLP solver name */
743 const char* SCIPnlpiGetName(
744  SCIP_NLPI* nlpi /**< NLP interface structure */
745  )
746 {
747  assert(nlpi != NULL);
748 
749  return nlpi->name;
750 }
751 
752 /** gets NLP solver descriptions */
753 const char* SCIPnlpiGetDesc(
754  SCIP_NLPI* nlpi /**< NLP interface structure */
755  )
756 {
757  assert(nlpi != NULL);
758 
759  return nlpi->description;
760 }
761 
762 /** gets NLP solver priority */
764  SCIP_NLPI* nlpi /**< NLP interface structure */
765  )
766 {
767  assert(nlpi != NULL);
768 
769  return nlpi->priority;
770 }
771 
772 /** sets NLP solver priority */
774  SCIP_NLPI* nlpi, /**< NLP interface structure */
775  int priority /**< new priority of NLPI */
776  )
777 {
778  assert(nlpi != NULL);
779 
780  nlpi->priority = priority;
781 }
782 
783 /** creates an NLP statistics structure */
785  BMS_BLKMEM* blkmem, /**< block memory */
786  SCIP_NLPSTATISTICS** statistics /**< pointer where to store NLP statistics structure */
787  )
788 {
789  assert(blkmem != NULL);
790  assert(statistics != NULL);
791 
792  SCIP_ALLOC( BMSallocBlockMemory(blkmem, statistics) );
793 
794  (*statistics)->niterations = -1;
795  (*statistics)->totaltime = -1.0;
796 
797  return SCIP_OKAY;
798 }
799 
800 /** frees an NLP statistics structure */
802  BMS_BLKMEM* blkmem, /**< block memory */
803  SCIP_NLPSTATISTICS** statistics /**< pointer where to store NLP statistics structure */
804  )
805 {
806  assert(blkmem != NULL);
807  assert(statistics != NULL);
808  assert(*statistics != NULL);
809 
810  BMSfreeBlockMemory(blkmem, statistics);
811 
812  assert(*statistics == NULL);
813 }
814 
815 /** gets the number of iterations from an NLP statistics structure */
817  SCIP_NLPSTATISTICS* statistics /**< NLP statistics structure */
818  )
819 {
820  assert(statistics != NULL);
821 
822  return statistics->niterations;
823 }
824 
825 /** gets the total time from an NLP statistics structure */
827  SCIP_NLPSTATISTICS* statistics /**< NLP statistics structure */
828  )
829 {
830  assert(statistics != NULL);
831 
832  return statistics->totaltime;
833 }
834 
835 /** sets the number of iterations in an NLP statistics structure */
837  SCIP_NLPSTATISTICS* statistics, /**< NLP statistics structure */
838  int niterations /**< number of iterations to store */
839  )
840 {
841  assert(statistics != NULL);
842  statistics->niterations = niterations;
843 }
844 
845 /** sets the total time in an NLP statistics structure */
847  SCIP_NLPSTATISTICS* statistics, /**< NLP statistics structure */
848  SCIP_Real totaltime /**< solution time to store */
849  )
850 {
851  assert(statistics != NULL);
852  statistics->totaltime = totaltime;
853 }
SCIP_RETCODE SCIPnlpiSetWarmstartMemo(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, void *buffer)
Definition: nlpi.c:601
#define SCIP_DECL_NLPIGETSOLVERPOINTER(x)
Definition: type_nlpi.h:111
#define SCIP_DECL_NLPICHGNONLINCOEF(x)
Definition: type_nlpi.h:310
SCIP_RETCODE SCIPnlpiGetStatistics(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:556
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:84
void * SCIPnlpiGetSolverPointer(SCIP_NLPI *nlpi)
Definition: nlpi.c:201
char * name
Definition: struct_nlpi.h:37
data definitions for an NLP solver interface
int SCIPnlpiGetPriority(SCIP_NLPI *nlpi)
Definition: nlpi.c:763
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
#define SCIP_DECL_NLPIGETTERMSTAT(x)
Definition: type_nlpi.h:361
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
#define SCIP_DECL_NLPISETINTPAR(x)
Definition: type_nlpi.h:455
#define SCIP_DECL_NLPIGETSTRINGPAR(x)
Definition: type_nlpi.h:491
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
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
#define SCIP_DECL_NLPIGETSOLUTION(x)
Definition: type_nlpi.h:379
const char * SCIPnlpiGetName(SCIP_NLPI *nlpi)
Definition: nlpi.c:743
#define SCIP_DECL_NLPICHGOBJCONSTANT(x)
Definition: type_nlpi.h:320
#define SCIP_DECL_NLPICHGQUADCOEFS(x)
Definition: type_nlpi.h:284
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
enum SCIP_NlpParam SCIP_NLPPARAM
Definition: type_nlpi.h:56
void SCIPnlpStatisticsFree(BMS_BLKMEM *blkmem, SCIP_NLPSTATISTICS **statistics)
Definition: nlpi.c:801
#define BMSfreeMemory(ptr)
Definition: memory.h:127
#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
#define SCIP_DECL_NLPIADDCONSTRAINTS(x)
Definition: type_nlpi.h:182
SCIP_RETCODE SCIPnlpiFree(SCIP_NLPI **nlpi)
Definition: nlpi.c:181
#define SCIP_DECL_NLPIGETWARMSTARTSIZE(x)
Definition: type_nlpi.h:404
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:129
struct SCIP_NlpiData SCIP_NLPIDATA
Definition: type_nlpi.h:38
#define SCIP_DECL_NLPIGETINTPAR(x)
Definition: type_nlpi.h:445
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
Definition: type_nlpi.h:69
#define SCIP_DECL_NLPICOPY(x)
Definition: type_nlpi.h:93
SCIP_Real totaltime
Definition: struct_nlpi.h:81
#define SCIP_DECL_NLPICHGVARBOUNDS(x)
Definition: type_nlpi.h:220
#define SCIP_DECL_NLPISETMESSAGEHDLR(x)
Definition: type_nlpi.h:509
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
#define SCIP_CALL(x)
Definition: def.h:350
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
#define SCIP_DECL_NLPIGETSTATISTICS(x)
Definition: type_nlpi.h:392
SCIP_DECL_SORTPTRCOMP(SCIPnlpiComp)
Definition: nlpi.c:34
#define SCIP_DECL_NLPIDELVARSET(x)
Definition: type_nlpi.h:247
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
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:125
#define SCIP_DECL_NLPISETREALPAR(x)
Definition: type_nlpi.h:478
SCIP_RETCODE SCIPnlpiDelConsSet(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int *dstats, int dstatssize)
Definition: nlpi.c:378
#define SCIP_DECL_NLPICHGCONSSIDES(x)
Definition: type_nlpi.h:233
#define BMSfreeBlockMemory(mem, ptr)
Definition: memory.h:446
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
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
SCIP_NLPIDATA * nlpidata
Definition: struct_nlpi.h:74
void * SCIPnlpiGetProblemPointer(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:238
SCIP_NLPIDATA * SCIPnlpiGetData(SCIP_NLPI *nlpi)
Definition: nlpi.c:733
#define SCIP_DECL_NLPICHGEXPRTREE(x)
Definition: type_nlpi.h:296
public methods for message output
SCIP_RETCODE SCIPnlpStatisticsCreate(BMS_BLKMEM *blkmem, SCIP_NLPSTATISTICS **statistics)
Definition: nlpi.c:784
void SCIPnlpiSetPriority(SCIP_NLPI *nlpi, int priority)
Definition: nlpi.c:773
#define SCIP_DECL_NLPIGETWARMSTARTMEMO(x)
Definition: type_nlpi.h:418
#define SCIP_DECL_NLPIFREE(x)
Definition: type_nlpi.h:100
#define SCIP_DECL_NLPISETINITIALGUESS(x)
Definition: type_nlpi.h:332
#define SCIP_Real
Definition: def.h:149
#define SCIP_DECL_NLPISETSTRINGPAR(x)
Definition: type_nlpi.h:501
#define SCIP_DECL_NLPICREATEPROBLEM(x)
Definition: type_nlpi.h:120
#define BMSallocMemory(ptr)
Definition: memory.h:101
#define SCIP_DECL_NLPISOLVE(x)
Definition: type_nlpi.h:341
SCIP_RETCODE SCIPnlpiGetWarmstartMemo(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, void *buffer)
Definition: nlpi.c:586
#define SCIP_DECL_NLPIFREEPROBLEM(x)
Definition: type_nlpi.h:128
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
int priority
Definition: struct_nlpi.h:39
#define SCIP_DECL_NLPISETOBJECTIVE(x)
Definition: type_nlpi.h:206
#define BMSallocBlockMemory(mem, ptr)
Definition: memory.h:433
#define SCIP_DECL_NLPIGETREALPAR(x)
Definition: type_nlpi.h:468
#define SCIP_DECL_NLPIGETSOLSTAT(x)
Definition: type_nlpi.h:351
char * description
Definition: struct_nlpi.h:38
#define SCIP_DECL_NLPISETWARMSTARTMEMO(x)
Definition: type_nlpi.h:429
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:419
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
#define SCIP_ALLOC(x)
Definition: def.h:361
const char * SCIPnlpiGetDesc(SCIP_NLPI *nlpi)
Definition: nlpi.c:753
#define SCIP_DECL_NLPIDELCONSSET(x)
Definition: type_nlpi.h:260
#define SCIP_DECL_NLPICHGLINEARCOEFS(x)
Definition: type_nlpi.h:272
SCIP_RETCODE SCIPnlpiSetRealPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: nlpi.c:671
#define SCIP_DECL_NLPIADDVARS(x)
Definition: type_nlpi.h:152
memory allocation routines