Scippy

SCIP

Solving Constraint Integer Programs

nlpi_all.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-2022 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 visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file nlpi_all.c
17  * @ingroup DEFPLUGINS_NLPI
18  * @brief NLP interface that uses all available NLP interfaces
19  * @author Benjamin Mueller
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include "scip/nlpi_all.h"
25 #include "scip/scip_mem.h"
26 #include "scip/scip_numerics.h"
27 #include "scip/scip_nlpi.h"
28 
29 #include <string.h>
30 
31 #define NLPI_NAME "all" /**< short concise name of solver */
32 #define NLPI_DESC "NLP interface that uses all available NLP interfaces" /**< description of solver */
33 #define NLPI_PRIORITY -3000 /**< priority of NLP solver */
34 
35 /*
36  * Data structures
37  */
38 
39 struct SCIP_NlpiData
40 {
41  SCIP_NLPI** nlpis; /**< array containing all nlpis */
42  int nnlpis; /**< total number of nlpis */
43 };
44 
46 {
47  SCIP_NLPIPROBLEM** nlpiproblems; /**< array containing all nlpi problems */
48  int nnlpiproblems; /**< total number of nlpi problems */
49  int bestidx; /**< index of NLP solver with the best solution */
50 };
51 
52 #ifdef SCIP_STATISTIC
53 static int _nnlps = 0; /**< number of NLPs that have been solved */
54 #endif
55 
56 /*
57  * Local methods
58  */
59 
60 /*
61  * Callback methods of NLP solver interface
62  */
63 
64 /** copy method of NLP interface (called when SCIP copies plugins) */
65 static
66 SCIP_DECL_NLPICOPY(nlpiCopyAll)
67 {
68  /* include NLPI */
70 
71  return SCIP_OKAY; /*lint !e527*/
72 } /*lint !e715*/
73 
74 /** destructor of NLP interface to free nlpi data */
75 static
76 SCIP_DECL_NLPIFREE(nlpiFreeAll)
77 {
78  assert(nlpi != NULL);
79  assert(nlpidata != NULL);
80  assert(*nlpidata != NULL);
81 
82  SCIPfreeBlockMemoryArrayNull(scip, &(*nlpidata)->nlpis, (*nlpidata)->nnlpis);
83  SCIPfreeBlockMemory(scip, nlpidata);
84  assert(*nlpidata == NULL);
85 
86  return SCIP_OKAY; /*lint !e527*/
87 } /*lint !e715*/
88 
89 /** creates a problem instance */
90 static
91 SCIP_DECL_NLPICREATEPROBLEM(nlpiCreateProblemAll)
92 {
93  SCIP_NLPIDATA* data;
94  int i;
95 
96  assert(nlpi != NULL);
97  assert(problem != NULL);
98 
99  data = SCIPnlpiGetData(nlpi);
100  assert(data != NULL);
101 
103 
104  /* initialize problem */
105  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &(*problem)->nlpiproblems, data->nnlpis) );
106  (*problem)->nnlpiproblems = data->nnlpis;
107 
108  for( i = 0; i < data->nnlpis; ++i )
109  {
110  assert(data->nlpis[i] != NULL);
111  SCIP_CALL( SCIPcreateNlpiProblem(scip, data->nlpis[i], &((*problem)->nlpiproblems[i]), name) );
112  }
113 
114  return SCIP_OKAY;
115 } /*lint !e715*/
116 
117 /** free a problem instance */
118 static
119 SCIP_DECL_NLPIFREEPROBLEM(nlpiFreeProblemAll)
120 {
121  SCIP_NLPIDATA* data;
122  int i;
123 
124  assert(nlpi != NULL);
125  assert(problem != NULL);
126  assert(*problem != NULL);
127 
128  data = SCIPnlpiGetData(nlpi);
129  assert(data != NULL);
130 
131  for( i = 0; i < data->nnlpis; ++i )
132  {
133  assert(data->nlpis[i] != NULL);
134  SCIP_CALL( SCIPfreeNlpiProblem(scip, data->nlpis[i], &(*problem)->nlpiproblems[i]) );
135  }
136 
137  SCIPfreeBlockMemoryArrayNull(scip, &(*problem)->nlpiproblems, data->nnlpis);
138  SCIPfreeBlockMemory(scip, problem);
139 
140  return SCIP_OKAY;
141 } /*lint !e715*/
142 
143 /** add variables */
144 static
145 SCIP_DECL_NLPIADDVARS(nlpiAddVarsAll)
146 {
147  SCIP_NLPIDATA* nlpidata;
148  int i;
149 
150  nlpidata = SCIPnlpiGetData(nlpi);
151  assert(nlpidata != NULL);
152 
153  for( i = 0; i < nlpidata->nnlpis; ++i )
154  {
155  assert(nlpidata->nlpis[i] != NULL);
156  assert(problem->nlpiproblems[i] != NULL);
157 
158  SCIP_CALL( SCIPaddNlpiVars(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], nvars, lbs, ubs, varnames) );
159  }
160 
161  return SCIP_OKAY;
162 } /*lint !e715*/
163 
164 
165 /** add constraints */
166 static
167 SCIP_DECL_NLPIADDCONSTRAINTS(nlpiAddConstraintsAll)
168 {
169  SCIP_NLPIDATA* nlpidata;
170  int i;
171 
172  nlpidata = SCIPnlpiGetData(nlpi);
173  assert(nlpidata != NULL);
174 
175  for( i = 0; i < nlpidata->nnlpis; ++i )
176  {
177  assert(nlpidata->nlpis[i] != NULL);
178  assert(problem->nlpiproblems[i] != NULL);
179 
180  SCIP_CALL( SCIPaddNlpiConstraints(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], nconss, lhss, rhss,
181  nlininds, lininds, linvals, exprs, names) );
182  }
183 
184  return SCIP_OKAY;
185 } /*lint !e715*/
186 
187 /** sets or overwrites objective, a minimization problem is expected */
188 static
189 SCIP_DECL_NLPISETOBJECTIVE(nlpiSetObjectiveAll)
190 {
191  SCIP_NLPIDATA* nlpidata;
192  int i;
193 
194  nlpidata = SCIPnlpiGetData(nlpi);
195  assert(nlpidata != NULL);
196 
197  for( i = 0; i < nlpidata->nnlpis; ++i )
198  {
199  assert(nlpidata->nlpis[i] != NULL);
200  assert(problem->nlpiproblems[i] != NULL);
201 
202  SCIP_CALL( SCIPsetNlpiObjective(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], nlins, lininds, linvals, expr, constant) );
203  }
204 
205  return SCIP_OKAY;
206 } /*lint !e715*/
207 
208 /** change variable bounds */
209 static
210 SCIP_DECL_NLPICHGVARBOUNDS(nlpiChgVarBoundsAll)
211 {
212  SCIP_NLPIDATA* nlpidata;
213  int i;
214 
215  nlpidata = SCIPnlpiGetData(nlpi);
216  assert(nlpidata != NULL);
217 
218  for( i = 0; i < nlpidata->nnlpis; ++i )
219  {
220  assert(nlpidata->nlpis[i] != NULL);
221  assert(problem->nlpiproblems[i] != NULL);
222 
223  SCIP_CALL( SCIPchgNlpiVarBounds(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], nvars, indices, lbs, ubs) );
224  }
225 
226  return SCIP_OKAY;
227 } /*lint !e715*/
228 
229 /** change constraint bounds */
230 static
231 SCIP_DECL_NLPICHGCONSSIDES(nlpiChgConsSidesAll)
232 {
233  SCIP_NLPIDATA* nlpidata;
234  int i;
235 
236  nlpidata = SCIPnlpiGetData(nlpi);
237  assert(nlpidata != NULL);
238 
239  for( i = 0; i < nlpidata->nnlpis; ++i )
240  {
241  assert(nlpidata->nlpis[i] != NULL);
242  assert(problem->nlpiproblems[i] != NULL);
243 
244  SCIP_CALL( SCIPchgNlpiConsSides(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], nconss, indices, lhss, rhss) );
245  }
246 
247  return SCIP_OKAY;
248 } /*lint !e715*/
249 
250 /** delete a set of variables */
251 static
252 SCIP_DECL_NLPIDELVARSET(nlpiDelVarSetAll)
253 {
254  SCIP_NLPIDATA* nlpidata;
255  int* tmpdstats;
256  int i;
257 
258  nlpidata = SCIPnlpiGetData(nlpi);
259  assert(nlpidata != NULL);
260 
261  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &tmpdstats, dstatssize) );
262 
263  for( i = 0; i < nlpidata->nnlpis; ++i )
264  {
265  assert(nlpidata->nlpis[i] != NULL);
266  assert(problem->nlpiproblems[i] != NULL);
267 
268  if( i < nlpidata->nnlpis -1 )
269  {
270  /* restore dstats entries */
271  BMScopyMemoryArray(tmpdstats, dstats, dstatssize);
272 
273  SCIP_CALL( SCIPdelNlpiVarSet(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], tmpdstats, dstatssize) );
274  }
275  else
276  {
277  /* NOTE this works only when all dstats array are the same after calling the nlpidelvarset callback
278  * As long as all solvers use the SCIP NLPI oracle to store the NLP problem data, this is the case.
279  * @TODO Assert that the returned dstats are all the same?
280  */
281  SCIP_CALL( SCIPdelNlpiVarSet(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], dstats, dstatssize) );
282  }
283  }
284 
285  SCIPfreeBlockMemoryArray(scip, &tmpdstats, dstatssize);
286 
287  return SCIP_OKAY;
288 } /*lint !e715*/
289 
290 /** delete a set of constraints */
291 static
292 SCIP_DECL_NLPIDELCONSSET( nlpiDelConstraintSetAll )
293 {
294  SCIP_NLPIDATA* nlpidata;
295  int* tmpdstats;
296  int i;
297 
298  nlpidata = SCIPnlpiGetData(nlpi);
299  assert(nlpidata != NULL);
300 
301  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &tmpdstats, dstatssize) );
302 
303  for( i = 0; i < nlpidata->nnlpis; ++i )
304  {
305  assert(nlpidata->nlpis[i] != NULL);
306  assert(problem->nlpiproblems[i] != NULL);
307 
308  if( i < nlpidata->nnlpis - 1 )
309  {
310  /* restore dstats entries */
311  BMScopyMemoryArray(tmpdstats, dstats, dstatssize);
312 
313  SCIP_CALL( SCIPdelNlpiConsSet(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], tmpdstats, dstatssize) );
314  }
315  else
316  {
317  /* NOTE this works only when all dstats array are the same after calling the nlpidelconsset callback
318  * As long as all solvers use the SCIP NLPI oracle to store the NLP problem data, this is the case.
319  * @TODO Assert that the returned dstats are all the same?
320  */
321  SCIP_CALL( SCIPdelNlpiConsSet(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], dstats, dstatssize) );
322  }
323  }
324 
325  SCIPfreeBlockMemoryArray(scip, &tmpdstats, dstatssize);
326 
327  return SCIP_OKAY;
328 } /*lint !e715*/
329 
330 /** changes (or adds) linear coefficients in a constraint or objective */
331 static
332 SCIP_DECL_NLPICHGLINEARCOEFS(nlpiChgLinearCoefsAll)
333 {
334  SCIP_NLPIDATA* nlpidata;
335  int i;
336 
337  nlpidata = SCIPnlpiGetData(nlpi);
338  assert(nlpidata != NULL);
339 
340  for( i = 0; i < nlpidata->nnlpis; ++i )
341  {
342  assert(nlpidata->nlpis[i] != NULL);
343  assert(problem->nlpiproblems[i] != NULL);
344 
345  SCIP_CALL( SCIPchgNlpiLinearCoefs(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], idx, nvals, varidxs, vals) );
346  }
347 
348  return SCIP_OKAY;
349 } /*lint !e715*/
350 
351 /** replaces the expression of a constraint or objective */
352 static
353 SCIP_DECL_NLPICHGEXPR(nlpiChgExprAll)
354 {
355  SCIP_NLPIDATA* nlpidata;
356  int i;
357 
358  nlpidata = SCIPnlpiGetData(nlpi);
359  assert(nlpidata != NULL);
360 
361  for( i = 0; i < nlpidata->nnlpis; ++i )
362  {
363  assert(nlpidata->nlpis[i] != NULL);
364  assert(problem->nlpiproblems[i] != NULL);
365 
366  SCIP_CALL( SCIPchgNlpiExpr(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], idxcons, expr) );
367  }
368 
369  return SCIP_OKAY;
370 } /*lint !e715*/
371 
372 /** change the constant offset in the objective */
373 static
374 SCIP_DECL_NLPICHGOBJCONSTANT(nlpiChgObjConstantAll)
375 {
376  SCIP_NLPIDATA* nlpidata;
377  int i;
378 
379  nlpidata = SCIPnlpiGetData(nlpi);
380  assert(nlpidata != NULL);
381 
382  for( i = 0; i < nlpidata->nnlpis; ++i )
383  {
384  assert(nlpidata->nlpis[i] != NULL);
385  assert(problem->nlpiproblems[i] != NULL);
386 
387  SCIP_CALL( SCIPchgNlpiObjConstant(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], objconstant) );
388  }
389 
390  return SCIP_OKAY;
391 } /*lint !e715*/
392 
393 /** sets initial guess for primal variables */
394 static
395 SCIP_DECL_NLPISETINITIALGUESS(nlpiSetInitialGuessAll)
396 {
397  SCIP_NLPIDATA* nlpidata;
398  int i;
399 
400  nlpidata = SCIPnlpiGetData(nlpi);
401  assert(nlpidata != NULL);
402 
403  for( i = 0; i < nlpidata->nnlpis; ++i )
404  {
405  assert(nlpidata->nlpis[i] != NULL);
406  assert(problem->nlpiproblems[i] != NULL);
407 
408  SCIP_CALL( SCIPsetNlpiInitialGuess(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], primalvalues, consdualvalues,
409  varlbdualvalues, varubdualvalues) );
410  }
411 
412  return SCIP_OKAY;
413 } /*lint !e715*/
414 
415 /** tries to solve NLP */
416 static
417 SCIP_DECL_NLPISOLVE(nlpiSolveAll)
418 {
419  SCIP_NLPIDATA* nlpidata;
420  SCIP_NLPTERMSTAT besttermstat;
421  SCIP_NLPSOLSTAT bestsolstat;
422  SCIP_Real bestsolval;
423  int i;
424 
425  nlpidata = SCIPnlpiGetData(nlpi);
426  assert(nlpidata != NULL);
427 
428  /* use first solver per default */
429  problem->bestidx = 0;
430 
431  /* initialize best solution values */
432  besttermstat = SCIP_NLPTERMSTAT_OTHER;
433  bestsolstat = SCIP_NLPSOLSTAT_UNKNOWN;
434  bestsolval = SCIPinfinity(scip);
435 
436  for( i = 0; i < nlpidata->nnlpis; ++i )
437  {
438  SCIP_NLPTERMSTAT termstat;
439  SCIP_NLPSOLSTAT solstat;
440  SCIP_Real solval;
441  SCIP_Bool update;
442 
443  assert(nlpidata->nlpis[i] != NULL);
444  assert(problem->nlpiproblems[i] != NULL);
445 
446  /* solve NLP */
447  SCIP_CALL( SCIPsolveNlpiParam(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], param) );
448 
449  termstat = SCIPgetNlpiTermstat(scip, nlpidata->nlpis[i], problem->nlpiproblems[i]);
450  solstat = SCIPgetNlpiSolstat(scip, nlpidata->nlpis[i], problem->nlpiproblems[i]);
451  solval = SCIPinfinity(scip);
452  update = FALSE;
453 
454  /* collect solution value */
455  if( solstat <= SCIP_NLPSOLSTAT_FEASIBLE )
456  {
457  SCIP_CALL( SCIPgetNlpiSolution(scip, nlpidata->nlpis[i], problem->nlpiproblems[i],
458  NULL, NULL, NULL, NULL, &solval) );
459  assert(!SCIPisInfinity(scip, solval));
460  }
461 
462  /* better termination status -> update best solver */
463  if( termstat < besttermstat )
464  update = TRUE;
465 
466  /* no feasible solutions have been found so far -> update best solver */
467  else if( bestsolstat >= SCIP_NLPSOLSTAT_LOCINFEASIBLE && solstat <= SCIP_NLPSOLSTAT_LOCINFEASIBLE )
468  update = TRUE;
469 
470  /* use solver with the better solution value */
471  else if( solval < bestsolval )
472  update = TRUE;
473 
474  /* update best solver */
475  if( update )
476  {
477  besttermstat = termstat;
478  bestsolstat = solstat;
479  bestsolval = solval;
480  problem->bestidx = i;
481  }
482 
483 #ifdef SCIP_STATISTIC
484  {
485  SCIP_NLPSTATISTICS stats;
486 
487  SCIP_CALL( SCIPgetNlpiStatistics(scip, nlpidata->nlpis[i], problem->nlpiproblems[i], &stats) );
488 
489  SCIPstatisticMessage("%d solver %s termstat %d solstat %d solval %e iters %d time %g\n",
490  _nnlps, SCIPnlpiGetName(nlpidata->nlpis[i]), termstat, solstat, solval,
491  stats.niterations, stats.totaltime);
492  }
493 #endif
494 
495  /* don't try more NLP solvers if allowed time is exceeded or SCIP is asked to interrupt */
496  if( termstat == SCIP_NLPTERMSTAT_TIMELIMIT || termstat == SCIP_NLPTERMSTAT_INTERRUPT )
497  break;
498  }
499 
500 #ifdef SCIP_STATISTIC
501  ++_nnlps;
502 #endif
503 
504  return SCIP_OKAY;
505 } /*lint !e715*/
506 
507 /** gives solution status */
508 static
509 SCIP_DECL_NLPIGETSOLSTAT(nlpiGetSolstatAll)
510 {
511  SCIP_NLPIDATA* nlpidata;
512 
513  nlpidata = SCIPnlpiGetData(nlpi);
514  assert(nlpidata != NULL);
515  assert(nlpidata->nlpis != NULL);
516  assert(nlpidata->nlpis[problem->bestidx] != NULL);
517  assert(problem->nlpiproblems != NULL);
518  assert(problem->nlpiproblems[problem->bestidx] != NULL);
519 
520  /* return the solution status of the first nlpi */
521  return SCIPgetNlpiSolstat(scip, nlpidata->nlpis[problem->bestidx], problem->nlpiproblems[problem->bestidx]);
522 }
523 
524 /** gives termination reason */
525 static
526 SCIP_DECL_NLPIGETTERMSTAT(nlpiGetTermstatAll)
527 {
528  SCIP_NLPIDATA* nlpidata;
529 
530  nlpidata = SCIPnlpiGetData(nlpi);
531  assert(nlpidata != NULL);
532  assert(nlpidata->nlpis != NULL);
533  assert(nlpidata->nlpis[problem->bestidx] != NULL);
534  assert(problem->nlpiproblems != NULL);
535  assert(problem->nlpiproblems[problem->bestidx] != NULL);
536 
537  /* return the solution status of the first nlpi */
538  return SCIPgetNlpiTermstat(scip, nlpidata->nlpis[problem->bestidx], problem->nlpiproblems[problem->bestidx]);
539 }
540 
541 /** gives primal and dual solution values */
542 static
543 SCIP_DECL_NLPIGETSOLUTION(nlpiGetSolutionAll)
544 {
545  SCIP_NLPIDATA* nlpidata;
546 
547  nlpidata = SCIPnlpiGetData(nlpi);
548  assert(nlpidata != NULL);
549  assert(nlpidata->nlpis != NULL);
550  assert(nlpidata->nlpis[problem->bestidx] != NULL);
551  assert(problem->nlpiproblems != NULL);
552  assert(problem->nlpiproblems[problem->bestidx] != NULL);
553 
554  /* return the solution status of the first nlpi */
555  SCIP_CALL( SCIPgetNlpiSolution(scip, nlpidata->nlpis[problem->bestidx], problem->nlpiproblems[problem->bestidx],
556  primalvalues, consdualvalues, varlbdualvalues, varubdualvalues, objval) );
557 
558  return SCIP_OKAY;
559 }
560 
561 /** gives solve statistics */
562 static
563 SCIP_DECL_NLPIGETSTATISTICS(nlpiGetStatisticsAll)
564 {
565  SCIP_NLPIDATA* nlpidata;
566 
567  nlpidata = SCIPnlpiGetData(nlpi);
568  assert(nlpidata != NULL);
569  assert(nlpidata->nlpis != NULL);
570  assert(nlpidata->nlpis[problem->bestidx] != NULL);
571  assert(problem->nlpiproblems != NULL);
572  assert(problem->nlpiproblems[problem->bestidx] != NULL);
573 
574  /* collect statistics of the first solver */
575  SCIP_CALL( SCIPgetNlpiStatistics(scip, nlpidata->nlpis[problem->bestidx], problem->nlpiproblems[problem->bestidx],
576  statistics) );
577 
578  return SCIP_OKAY;
579 } /*lint !e715*/
580 
581 /*
582  * NLP solver interface specific interface methods
583  */
584 
585 /** create solver interface for the solver "All" and includes it into SCIP, if at least 2 NLPIs have already been included
586  *
587  * This method should be called after all other NLP solver interfaces have been included.
588  */
590  SCIP* scip /**< SCIP data structure */
591  )
592 {
593  SCIP_NLPIDATA* nlpidata;
594  int i;
595 
596  assert(scip != NULL);
597 
598  /* the number of NLPIs so far must be >= 2 */
599  if( SCIPgetNNlpis(scip) < 2 )
600  return SCIP_OKAY;
601 
602  /* create all solver interface data */
603  SCIP_CALL( SCIPallocClearBlockMemory(scip, &nlpidata) );
604 
605  nlpidata->nnlpis = SCIPgetNNlpis(scip);
606  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &nlpidata->nlpis, nlpidata->nnlpis) );
607 
608  /* copy nlpi pointers TODO should not need that */
609  for( i = 0; i < nlpidata->nnlpis; ++i )
610  nlpidata->nlpis[i] = SCIPgetNlpis(scip)[i];
611 
612  /* create solver interface */
615  nlpiCopyAll, nlpiFreeAll, NULL,
616  nlpiCreateProblemAll, nlpiFreeProblemAll, NULL,
617  nlpiAddVarsAll, nlpiAddConstraintsAll, nlpiSetObjectiveAll,
618  nlpiChgVarBoundsAll, nlpiChgConsSidesAll, nlpiDelVarSetAll, nlpiDelConstraintSetAll,
619  nlpiChgLinearCoefsAll, nlpiChgExprAll,
620  nlpiChgObjConstantAll, nlpiSetInitialGuessAll, nlpiSolveAll, nlpiGetSolstatAll, nlpiGetTermstatAll,
621  nlpiGetSolutionAll, nlpiGetStatisticsAll,
622  nlpidata) );
623 
624  return SCIP_OKAY;
625 }
#define NLPI_DESC
Definition: nlpi_all.c:32
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:101
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:185
SCIP_NLPIDATA * SCIPnlpiGetData(SCIP_NLPI *nlpi)
Definition: nlpi.c:683
#define SCIPallocBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:84
static SCIP_DECL_NLPICHGEXPR(nlpiChgExprAll)
Definition: nlpi_all.c:353
public methods for memory management
#define FALSE
Definition: def.h:87
SCIP_Real SCIPinfinity(SCIP *scip)
#define TRUE
Definition: def.h:86
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
#define SCIPstatisticMessage
Definition: pub_message.h:114
SCIP_NLPIPROBLEM ** nlpiproblems
Definition: nlpi_all.c:47
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip_mem.h:99
const char * SCIPnlpiGetName(SCIP_NLPI *nlpi)
Definition: nlpi.c:693
SCIP_NLPI ** SCIPgetNlpis(SCIP *scip)
Definition: scip_nlpi.c:177
static SCIP_DECL_NLPICOPY(nlpiCopyAll)
Definition: nlpi_all.c:66
public methods for numerical tolerances
int SCIPgetNNlpis(SCIP *scip)
Definition: scip_nlpi.c:190
public methods for NLPI solver interfaces
static SCIP_DECL_NLPIGETSOLSTAT(nlpiGetSolstatAll)
Definition: nlpi_all.c:509
#define NLPI_PRIORITY
Definition: nlpi_all.c:33
struct SCIP_NlpiData SCIP_NLPIDATA
Definition: type_nlpi.h:43
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
Definition: type_nlpi.h:159
static SCIP_DECL_NLPISOLVE(nlpiSolveAll)
Definition: nlpi_all.c:417
SCIP_Real totaltime
Definition: type_nlpi.h:191
#define NULL
Definition: lpi_spx1.cpp:155
#define NLPI_NAME
Definition: nlpi_all.c:31
static SCIP_DECL_NLPISETOBJECTIVE(nlpiSetObjectiveAll)
Definition: nlpi_all.c:189
#define SCIP_CALL(x)
Definition: def.h:384
static SCIP_DECL_NLPIGETSOLUTION(nlpiGetSolutionAll)
Definition: nlpi_all.c:543
static SCIP_DECL_NLPICHGLINEARCOEFS(nlpiChgLinearCoefsAll)
Definition: nlpi_all.c:332
static SCIP_DECL_NLPIGETSTATISTICS(nlpiGetStatisticsAll)
Definition: nlpi_all.c:563
#define SCIP_Bool
Definition: def.h:84
static SCIP_DECL_NLPIDELCONSSET(nlpiDelConstraintSetAll)
Definition: nlpi_all.c:292
static SCIP_DECL_NLPICHGOBJCONSTANT(nlpiChgObjConstantAll)
Definition: nlpi_all.c:374
static SCIP_DECL_NLPIADDCONSTRAINTS(nlpiAddConstraintsAll)
Definition: nlpi_all.c:167
#define BMScopyMemoryArray(ptr, source, num)
Definition: memory.h:127
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
NLP interface that uses all available NLP interfaces.
static SCIP_DECL_NLPIGETTERMSTAT(nlpiGetTermstatAll)
Definition: nlpi_all.c:526
static SCIP_DECL_NLPICREATEPROBLEM(nlpiCreateProblemAll)
Definition: nlpi_all.c:91
static SCIP_DECL_NLPISETINITIALGUESS(nlpiSetInitialGuessAll)
Definition: nlpi_all.c:395
static SCIP_DECL_NLPIFREE(nlpiFreeAll)
Definition: nlpi_all.c:76
#define SCIP_Real
Definition: def.h:177
SCIP_RETCODE SCIPincludeNlpSolverAll(SCIP *scip)
Definition: nlpi_all.c:589
static SCIP_DECL_NLPICHGVARBOUNDS(nlpiChgVarBoundsAll)
Definition: nlpi_all.c:210
static SCIP_DECL_NLPIFREEPROBLEM(nlpiFreeProblemAll)
Definition: nlpi_all.c:119
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
Definition: scip_mem.h:102
SCIP_RETCODE SCIPincludeNlpi(SCIP *scip, 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_NLPICHGEXPR((*nlpichgexpr)), 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_NLPIDATA *nlpidata)
Definition: scip_nlpi.c:98
#define SCIPallocClearBlockMemory(scip, ptr)
Definition: scip_mem.h:82
static SCIP_DECL_NLPICHGCONSSIDES(nlpiChgConsSidesAll)
Definition: nlpi_all.c:231
static SCIP_DECL_NLPIDELVARSET(nlpiDelVarSetAll)
Definition: nlpi_all.c:252
static SCIP_DECL_NLPIADDVARS(nlpiAddVarsAll)
Definition: nlpi_all.c:145