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-2016 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  )
367 {
368  assert(nlpi != NULL);
369  assert(problem != NULL);
370 
371  SCIP_CALL( (*nlpi->nlpidelvarset)(nlpi, problem, dstats) );
372 
373  return SCIP_OKAY;
374 }
375 
376 /** delete a set of constraints */
378  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
379  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
380  int* dstats /**< deletion status of rows; 1 if row should be deleted, 0 if not; afterwards -1
381  * if row was deleted */
382  )
383 {
384  assert(nlpi != NULL);
385  assert(problem != NULL);
386 
387  SCIP_CALL( (*nlpi->nlpidelconsset)(nlpi, problem, dstats) );
388 
389  return SCIP_OKAY;
390 }
391 
392 /** changes or adds linear coefficients in a constraint or objective */
394  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
395  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
396  const int idx, /**< index of constraint or -1 for objective */
397  int nvals, /**< number of values in linear constraint */
398  const int* varidxs, /**< indices of variable */
399  const SCIP_Real* vals /**< new values for coefficient */
400  )
401 {
402  assert(nlpi != NULL);
403  assert(problem != NULL);
404 
405  SCIP_CALL( (*nlpi->nlpichglinearcoefs)(nlpi, problem, idx, nvals, varidxs, vals) );
406 
407  return SCIP_OKAY;
408 }
409 
410 /** changes or adds coefficients in the quadratic part of a constraint or objective */
412  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
413  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
414  int idx, /**< index of constraint or -1 for objective */
415  int nquadelems, /**< number of entries in quadratic constraint to change */
416  const SCIP_QUADELEM* quadelems /**< new elements in quadratic matrix (replacing already existing ones or adding new ones) */
417  )
418 {
419  assert(nlpi != NULL);
420  assert(problem != NULL);
421 
422  SCIP_CALL( (*nlpi->nlpichgquadcoefs)(nlpi, problem, idx, nquadelems, quadelems) );
423 
424  return SCIP_OKAY;
425 }
426 
427 /** change the expression tree in the nonlinear part */
429  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
430  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
431  int idxcons, /**< index of constraint or -1 for objective */
432  const int* exprvaridxs, /**< indices of variables in expression tree, maps variable indices in expression tree to indices in nlp, or NULL */
433  SCIP_EXPRTREE* exprtree /**< new expression tree, or NULL for no tree */
434  )
435 {
436  assert(nlpi != NULL);
437  assert(problem != NULL);
438 
439  SCIP_CALL( (*nlpi->nlpichgexprtree)(nlpi, problem, idxcons, exprvaridxs, exprtree) );
440 
441  return SCIP_OKAY;
442 }
443 
444 /** change the value of one parameter in the nonlinear part */
446  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
447  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
448  int considx, /**< index of constraint or -1 for objective */
449  int paramidx, /**< index of parameter */
450  SCIP_Real value /**< new value for nonlinear parameter */
451  )
452 {
453  assert(nlpi != NULL);
454  assert(problem != NULL);
455 
456  SCIP_CALL( (*nlpi->nlpichgnonlincoef)(nlpi, problem, considx, paramidx, value) );
457 
458  return SCIP_OKAY;
459 }
460 
461 /** change the constant offset in the objective */
463  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
464  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
465  SCIP_Real objconstant /**< new value for objective constant */
466  )
467 {
468  assert(nlpi != NULL);
469  assert(problem != NULL);
470 
471  SCIP_CALL( (*nlpi->nlpichgobjconstant)(nlpi, problem, objconstant) );
472 
473  return SCIP_OKAY;
474 }
475 
476 /** sets initial guess for primal variables */
478  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
479  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
480  SCIP_Real* primalvalues, /**< initial primal values for variables, or NULL to clear previous values */
481  SCIP_Real* consdualvalues, /**< initial dual values for constraints, or NULL to clear previous values */
482  SCIP_Real* varlbdualvalues, /**< initial dual values for variable lower bounds, or NULL to clear previous values */
483  SCIP_Real* varubdualvalues /**< initial dual values for variable upper bounds, or NULL to clear previous values */
484  )
485 {
486  assert(nlpi != NULL);
487  assert(problem != NULL);
488 
489  SCIP_CALL( (*nlpi->nlpisetinitialguess)(nlpi, problem, primalvalues, consdualvalues, varlbdualvalues, varubdualvalues) );
490 
491  return SCIP_OKAY;
492 }
493 
494 /** tries to solve NLP */
496  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
497  SCIP_NLPIPROBLEM* problem /**< pointer to problem data structure */
498  )
499 {
500  assert(nlpi != NULL);
501  assert(problem != NULL);
502 
503  SCIP_CALL( (*nlpi->nlpisolve)(nlpi, problem) );
504 
505  return SCIP_OKAY;
506 }
507 
508 /** gives solution status, return: Solution Status */
510  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
511  SCIP_NLPIPROBLEM* problem /**< pointer to problem data structure */
512  )
513 {
514  assert(nlpi != NULL);
515  assert(problem != NULL);
516 
517  return (*nlpi->nlpigetsolstat)(nlpi, problem);
518 }
519 
520 /** gives termination reason; return: Termination Status */
522  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
523  SCIP_NLPIPROBLEM* problem /**< pointer to problem data structure */
524  )
525 {
526  assert(nlpi != NULL);
527  assert(problem != NULL);
528 
529  return (*nlpi->nlpigettermstat)(nlpi, problem);
530 }
531 
532 /** gives primal and dual solution
533  * 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
534  */
536  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
537  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
538  SCIP_Real** primalvalues, /**< buffer to store pointer to array to primal values, or NULL if not needed */
539  SCIP_Real** consdualvalues, /**< buffer to store pointer to array to dual values of constraints, or NULL if not needed */
540  SCIP_Real** varlbdualvalues, /**< buffer to store pointer to array to dual values of variable lower bounds, or NULL if not needed */
541  SCIP_Real** varubdualvalues /**< buffer to store pointer to array to dual values of variable lower bounds, or NULL if not needed */
542  )
543 {
544  assert(nlpi != NULL);
545  assert(problem != NULL);
546 
547  SCIP_CALL( (*nlpi->nlpigetsolution)(nlpi, problem, primalvalues, consdualvalues, varlbdualvalues, varubdualvalues) );
548 
549  return SCIP_OKAY;
550 }
551 
552 /** gives solve statistics */
554  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
555  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
556  SCIP_NLPSTATISTICS* statistics /**< pointer to store statistics */
557  )
558 {
559  assert(nlpi != NULL);
560  assert(problem != NULL);
561 
562  SCIP_CALL( (*nlpi->nlpigetstatistics)(nlpi, problem, statistics) );
563 
564  return SCIP_OKAY;
565 }
566 
567 /** gives required size of a buffer to store a warmstart object */
569  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
570  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
571  size_t* size /**< pointer to store required size for warmstart buffer */
572  )
573 {
574  assert(nlpi != NULL);
575  assert(problem != NULL);
576 
577  SCIP_CALL( (*nlpi->nlpigetwarmstartsize)(nlpi, problem, size) );
578 
579  return SCIP_OKAY;
580 }
581 
582 /** stores warmstart information in buffer */
584  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
585  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
586  void* buffer /**< memory to store warmstart information */
587  )
588 {
589  assert(nlpi != NULL);
590  assert(problem != NULL);
591 
592  SCIP_CALL( (*nlpi->nlpigetwarmstartmemo)(nlpi, problem, buffer) );
593 
594  return SCIP_OKAY;
595 }
596 
597 /** sets warmstart information in solver */
599  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
600  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
601  void* buffer /**< warmstart information */
602  )
603 {
604  assert(nlpi != NULL);
605  assert(problem != NULL);
606 
607  SCIP_CALL( (*nlpi->nlpisetwarmstartmemo)(nlpi, problem, buffer) );
608 
609  return SCIP_OKAY;
610 }
611 
612 /**@name Parameter Methods */
613 /**@{ */
614 
615 /** gets integer parameter of NLP */
617  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
618  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
619  SCIP_NLPPARAM type, /**< parameter number */
620  int* ival /**< pointer to store the parameter value */
621  )
622 {
623  assert(nlpi != NULL);
624  assert(problem != NULL);
625  assert(ival != NULL);
626 
627  SCIP_CALL( (*nlpi->nlpigetintpar)(nlpi, problem, type, ival) );
628 
629  return SCIP_OKAY;
630 }
631 
632 /** sets integer parameter of NLP */
634  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
635  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
636  SCIP_NLPPARAM type, /**< parameter number */
637  int ival /**< parameter value */
638  )
639 {
640  assert(nlpi != NULL);
641  assert(problem != NULL);
642 
643  SCIP_CALL( (*nlpi->nlpisetintpar)(nlpi, problem, type, ival) );
644 
645  return SCIP_OKAY;
646 }
647 
648 /** gets floating point parameter of NLP
649  * if problem is NULL and type == SCIP_NLPPAR_INFINITY, then gets solver-wide value for infinity */
651  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
652  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure, can be NULL only if type == SCIP_NLPPAR_INFINITY */
653  SCIP_NLPPARAM type, /**< parameter number */
654  SCIP_Real* dval /**< pointer to store the parameter value */
655  )
656 {
657  assert(nlpi != NULL);
658  assert(problem != NULL);
659  assert(dval != NULL);
660 
661  SCIP_CALL( (*nlpi->nlpigetrealpar)(nlpi, problem, type, dval) );
662 
663  return SCIP_OKAY;
664 }
665 
666 /** sets floating point parameter of NLP
667  * if problem is NULL and type == SCIP_NLPPAR_INFINITY, then sets solver-wide value for infinity */
669  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
670  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure, can be NULL only if type == SCIP_NLPPAR_INFINITY */
671  SCIP_NLPPARAM type, /**< parameter number */
672  SCIP_Real dval /**< parameter value */
673  )
674 {
675  assert(nlpi != NULL);
676  assert(problem != NULL || type == SCIP_NLPPAR_INFINITY);
677 
678  SCIP_CALL( (*nlpi->nlpisetrealpar)(nlpi, problem, type, dval) );
679 
680  return SCIP_OKAY;
681 }
682 
683 /** gets string parameter of NLP */
685  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
686  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
687  SCIP_NLPPARAM type, /**< parameter number */
688  const char** sval /**< pointer to store the parameter value, the user must not modify the string */
689  )
690 {
691  assert(nlpi != NULL);
692  assert(problem != NULL);
693  assert(sval != NULL);
694 
695  SCIP_CALL( (*nlpi->nlpigetstringpar)(nlpi, problem, type, sval) );
696 
697  return SCIP_OKAY;
698 }
699 
700 /** sets string parameter of NLP */
702  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
703  SCIP_NLPIPROBLEM* problem, /**< pointer to problem data structure */
704  SCIP_NLPPARAM type, /**< parameter number */
705  const char* sval /**< parameter value */
706  )
707 {
708  assert(nlpi != NULL);
709  assert(problem != NULL);
710 
711  SCIP_CALL( (*nlpi->nlpisetstringpar)(nlpi, problem, type, sval) );
712 
713  return SCIP_OKAY;
714 }
715 
716 /** sets message handler for message output */
718  SCIP_NLPI* nlpi, /**< pointer to NLPI datastructure */
719  SCIP_MESSAGEHDLR* messagehdlr /**< pointer to message handler, or NULL to suppress all output */
720  )
721 {
722  assert(nlpi != NULL);
723 
724  SCIP_CALL( (*nlpi->nlpisetmessagehdlr)(nlpi, messagehdlr) );
725 
726  return SCIP_OKAY;
727 }
728 
729 /** gets data of an NLPI */
731  SCIP_NLPI* nlpi /**< NLP interface structure */
732  )
733 {
734  assert(nlpi != NULL);
735 
736  return nlpi->nlpidata;
737 }
738 
739 /** gets NLP solver name */
740 const char* SCIPnlpiGetName(
741  SCIP_NLPI* nlpi /**< NLP interface structure */
742  )
743 {
744  assert(nlpi != NULL);
745 
746  return nlpi->name;
747 }
748 
749 /** gets NLP solver descriptions */
750 const char* SCIPnlpiGetDesc(
751  SCIP_NLPI* nlpi /**< NLP interface structure */
752  )
753 {
754  assert(nlpi != NULL);
755 
756  return nlpi->description;
757 }
758 
759 /** gets NLP solver priority */
761  SCIP_NLPI* nlpi /**< NLP interface structure */
762  )
763 {
764  assert(nlpi != NULL);
765 
766  return nlpi->priority;
767 }
768 
769 /** sets NLP solver priority */
771  SCIP_NLPI* nlpi, /**< NLP interface structure */
772  int priority /**< new priority of NLPI */
773  )
774 {
775  assert(nlpi != NULL);
776 
777  nlpi->priority = priority;
778 }
779 
780 /** creates an NLP statistics structure */
782  SCIP_NLPSTATISTICS** statistics /**< pointer where to store NLP statistics structure */
783  )
784 {
785  assert(statistics != NULL);
786 
787  if( BMSallocMemory(statistics) == NULL )
788  return SCIP_NOMEMORY;
789  assert(*statistics != NULL);
790 
791  (*statistics)->niterations = -1;
792  (*statistics)->totaltime = -1.0;
793 
794  return SCIP_OKAY;
795 }
796 
797 /** frees an NLP statistics structure */
799  SCIP_NLPSTATISTICS** statistics /**< pointer where to store NLP statistics structure */
800  )
801 {
802  assert(statistics != NULL);
803 
804  BMSfreeMemory(statistics);
805 
806  assert(*statistics == NULL);
807 }
808 
809 /** gets the number of iterations from an NLP statistics structure */
811  SCIP_NLPSTATISTICS* statistics /**< NLP statistics structure */
812  )
813 {
814  assert(statistics != NULL);
815 
816  return statistics->niterations;
817 }
818 
819 /** gets the total time from an NLP statistics structure */
821  SCIP_NLPSTATISTICS* statistics /**< NLP statistics structure */
822  )
823 {
824  assert(statistics != NULL);
825 
826  return statistics->totaltime;
827 }
828 
829 /** sets the number of iterations in an NLP statistics structure */
831  SCIP_NLPSTATISTICS* statistics, /**< NLP statistics structure */
832  int niterations /**< number of iterations to store */
833  )
834 {
835  assert(statistics != NULL);
836  statistics->niterations = niterations;
837 }
838 
839 /** sets the total time in an NLP statistics structure */
841  SCIP_NLPSTATISTICS* statistics, /**< NLP statistics structure */
842  SCIP_Real totaltime /**< solution time to store */
843  )
844 {
845  assert(statistics != NULL);
846  statistics->totaltime = totaltime;
847 }
SCIP_RETCODE SCIPnlpiDelConsSet(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int *dstats)
Definition: nlpi.c:377
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:102
#define SCIP_DECL_NLPIGETSOLVERPOINTER(x)
Definition: type_nlpi.h:112
void * SCIPnlpiGetSolverPointer(SCIP_NLPI *nlpi)
Definition: nlpi.c:201
#define SCIP_DECL_NLPICHGNONLINCOEF(x)
Definition: type_nlpi.h:309
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:85
SCIP_RETCODE SCIPnlpiGetStringPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, const char **sval)
Definition: nlpi.c:684
char * name
Definition: struct_nlpi.h:37
const char * SCIPnlpiGetName(SCIP_NLPI *nlpi)
Definition: nlpi.c:740
data definitions for an NLP solver interface
#define NULL
Definition: lpi_spx.cpp:130
void SCIPnlpiSetPriority(SCIP_NLPI *nlpi, int priority)
Definition: nlpi.c:770
void SCIPnlpStatisticsSetNIterations(SCIP_NLPSTATISTICS *statistics, int niterations)
Definition: nlpi.c:830
internal methods for NLPI solver interfaces
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
#define SCIP_DECL_NLPIGETTERMSTAT(x)
Definition: type_nlpi.h:360
size_t * size
Definition: memory.c:2418
#define SCIP_DECL_NLPISETINTPAR(x)
Definition: type_nlpi.h:453
#define SCIP_DECL_NLPIGETSTRINGPAR(x)
Definition: type_nlpi.h:489
SCIP_RETCODE SCIPnlpiFreeProblem(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM **problem)
Definition: nlpi.c:224
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
#define SCIP_CALL(x)
Definition: def.h:266
#define SCIP_DECL_NLPIGETSOLUTION(x)
Definition: type_nlpi.h:377
SCIP_Real SCIPnlpStatisticsGetTotalTime(SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:820
SCIP_RETCODE SCIPnlpiSetStringPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, const char *sval)
Definition: nlpi.c:701
#define SCIP_DECL_NLPICHGOBJCONSTANT(x)
Definition: type_nlpi.h:319
#define SCIP_DECL_NLPICHGQUADCOEFS(x)
Definition: type_nlpi.h:283
SCIP_RETCODE SCIPnlpiGetSolution(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_Real **primalvalues, SCIP_Real **consdualvalues, SCIP_Real **varlbdualvalues, SCIP_Real **varubdualvalues)
Definition: nlpi.c:535
enum SCIP_NlpParam SCIP_NLPPARAM
Definition: type_nlpi.h:56
SCIP_RETCODE SCIPnlpiGetRealPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, SCIP_Real *dval)
Definition: nlpi.c:650
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_DECL_NLPIADDCONSTRAINTS(x)
Definition: type_nlpi.h:183
SCIP_RETCODE SCIPnlpiCopy(BMS_BLKMEM *blkmem, SCIP_NLPI *sourcenlpi, SCIP_NLPI **targetnlpi)
Definition: nlpi.c:165
SCIP_DECL_NLPIGETPROBLEMPOINTER(nlpiGetProblemPointerIpopt)
Definition: nlpi_ipopt.cpp:658
SCIP_NLPTERMSTAT SCIPnlpiGetTermstat(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:521
#define SCIP_DECL_NLPIGETWARMSTARTSIZE(x)
Definition: type_nlpi.h:402
SCIP_RETCODE SCIPnlpiDelVarSet(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int *dstats)
Definition: nlpi.c:361
SCIP_RETCODE SCIPnlpiFree(SCIP_NLPI **nlpi)
Definition: nlpi.c:181
struct SCIP_NlpiData SCIP_NLPIDATA
Definition: type_nlpi.h:38
#define SCIP_DECL_NLPIGETINTPAR(x)
Definition: type_nlpi.h:443
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
Definition: type_nlpi.h:69
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
SCIP_RETCODE SCIPnlpiChgLinearCoefs(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, const int idx, int nvals, const int *varidxs, const SCIP_Real *vals)
Definition: nlpi.c:393
SCIP_RETCODE SCIPnlpiSetIntPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, int ival)
Definition: nlpi.c:633
SCIP_RETCODE SCIPnlpiCreateProblem(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM **problem, const char *name)
Definition: nlpi.c:211
#define SCIP_DECL_NLPICOPY(x)
Definition: type_nlpi.h:94
#define BMSallocMemory(ptr)
Definition: memory.h:74
SCIP_Real totaltime
Definition: struct_nlpi.h:81
#define SCIP_DECL_NLPICHGVARBOUNDS(x)
Definition: type_nlpi.h:221
#define SCIP_DECL_NLPISETMESSAGEHDLR(x)
Definition: type_nlpi.h:507
SCIP_RETCODE SCIPnlpiChgQuadCoefs(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int idx, int nquadelems, const SCIP_QUADELEM *quadelems)
Definition: nlpi.c:411
SCIP_DECL_SORTPTRCOMP(SCIPnlpiComp)
Definition: nlpi.c:34
#define BMSfreeMemory(ptr)
Definition: memory.h:100
#define SCIP_DECL_NLPIGETSTATISTICS(x)
Definition: type_nlpi.h:390
#define SCIP_DECL_NLPIDELVARSET(x)
Definition: type_nlpi.h:247
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:98
#define SCIP_DECL_NLPISETREALPAR(x)
Definition: type_nlpi.h:476
#define SCIP_DECL_NLPICHGCONSSIDES(x)
Definition: type_nlpi.h:234
SCIP_RETCODE SCIPnlpiSetRealPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: nlpi.c:668
void * SCIPnlpiGetProblemPointer(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:238
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 SCIPnlpiSetInitialGuess(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_Real *primalvalues, SCIP_Real *consdualvalues, SCIP_Real *varlbdualvalues, SCIP_Real *varubdualvalues)
Definition: nlpi.c:477
SCIP_NLPIDATA * SCIPnlpiGetData(SCIP_NLPI *nlpi)
Definition: nlpi.c:730
SCIP_RETCODE SCIPnlpiGetIntPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, int *ival)
Definition: nlpi.c:616
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
SCIP_RETCODE SCIPnlpiSolve(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:495
SCIP_RETCODE SCIPnlpiGetWarmstartMemo(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, void *buffer)
Definition: nlpi.c:583
void SCIPnlpStatisticsFree(SCIP_NLPSTATISTICS **statistics)
Definition: nlpi.c:798
int SCIPnlpiGetPriority(SCIP_NLPI *nlpi)
Definition: nlpi.c:760
SCIP_NLPIDATA * nlpidata
Definition: struct_nlpi.h:74
SCIP_RETCODE SCIPnlpiGetWarmstartSize(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, size_t *size)
Definition: nlpi.c:568
SCIP_RETCODE SCIPnlpiChgExprtree(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int idxcons, const int *exprvaridxs, SCIP_EXPRTREE *exprtree)
Definition: nlpi.c:428
#define SCIP_DECL_NLPICHGEXPRTREE(x)
Definition: type_nlpi.h:295
int SCIPnlpStatisticsGetNIterations(SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:810
public methods for message output
const char * SCIPnlpiGetDesc(SCIP_NLPI *nlpi)
Definition: nlpi.c:750
#define SCIP_DECL_NLPIGETWARMSTARTMEMO(x)
Definition: type_nlpi.h:416
#define SCIP_DECL_NLPIFREE(x)
Definition: type_nlpi.h:101
#define SCIP_DECL_NLPISETINITIALGUESS(x)
Definition: type_nlpi.h:331
#define SCIP_Real
Definition: def.h:127
SCIP_RETCODE SCIPnlpStatisticsCreate(SCIP_NLPSTATISTICS **statistics)
Definition: nlpi.c:781
#define SCIP_DECL_NLPISETSTRINGPAR(x)
Definition: type_nlpi.h:499
#define SCIP_DECL_NLPICREATEPROBLEM(x)
Definition: type_nlpi.h:121
SCIP_RETCODE SCIPnlpiSetWarmstartMemo(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, void *buffer)
Definition: nlpi.c:598
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
#define SCIP_DECL_NLPISOLVE(x)
Definition: type_nlpi.h:340
#define SCIP_DECL_NLPIFREEPROBLEM(x)
Definition: type_nlpi.h:129
int priority
Definition: struct_nlpi.h:39
#define SCIP_DECL_NLPISETOBJECTIVE(x)
Definition: type_nlpi.h:207
#define SCIP_DECL_NLPIGETREALPAR(x)
Definition: type_nlpi.h:466
#define SCIP_DECL_NLPIGETSOLSTAT(x)
Definition: type_nlpi.h:350
char * description
Definition: struct_nlpi.h:38
SCIP_RETCODE SCIPnlpiChgNonlinCoef(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int considx, int paramidx, SCIP_Real value)
Definition: nlpi.c:445
#define SCIP_DECL_NLPISETWARMSTARTMEMO(x)
Definition: type_nlpi.h:427
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:392
void SCIPnlpStatisticsSetTotalTime(SCIP_NLPSTATISTICS *statistics, SCIP_Real totaltime)
Definition: nlpi.c:840
SCIP_RETCODE SCIPnlpiGetStatistics(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:553
#define SCIP_ALLOC(x)
Definition: def.h:277
#define SCIP_DECL_NLPIDELCONSSET(x)
Definition: type_nlpi.h:259
SCIP_RETCODE SCIPnlpiChgObjConstant(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_Real objconstant)
Definition: nlpi.c:462
SCIP_RETCODE SCIPnlpiSetMessageHdlr(SCIP_NLPI *nlpi, SCIP_MESSAGEHDLR *messagehdlr)
Definition: nlpi.c:717
SCIP_NLPSOLSTAT SCIPnlpiGetSolstat(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:509
#define SCIP_DECL_NLPICHGLINEARCOEFS(x)
Definition: type_nlpi.h:271
#define SCIP_DECL_NLPIADDVARS(x)
Definition: type_nlpi.h:153
memory allocation routines