Scippy

SCIP

Solving Constraint Integer Programs

type_nlpi.h
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 type_nlpi.h
17  * @ingroup TYPEDEFINITIONS
18  * @brief type definitions for NLP solver interfaces
19  * @author Stefan Vigerske
20  * @author Thorsten Gellermann
21  */
22 
23 /** @defgroup DEFPLUGINS_NLPI Default NLP solver interfaces
24  * @ingroup DEFPLUGINS
25  * @brief implementation files (.c/.cpp files) of the default NLP solver interfaces of SCIP
26  */
27 
28 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
29 
30 #ifndef __SCIP_TYPE_NLPI_H__
31 #define __SCIP_TYPE_NLPI_H__
32 
33 #include "scip/def.h"
34 #include "scip/type_scip.h"
35 #include "scip/type_expr.h"
36 #include "scip/type_nlp.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 typedef struct SCIP_Nlpi SCIP_NLPI; /**< NLP solver interface */
43 typedef struct SCIP_NlpiData SCIP_NLPIDATA; /**< locally defined NLP solver interface data */
44 typedef struct SCIP_NlpiProblem SCIP_NLPIPROBLEM; /**< locally defined NLP solver interface data for a specific problem instance */
45 
46 /** NLP solver fast-fail levels */
48 {
49  SCIP_NLPPARAM_FASTFAIL_OFF = 0, /**< never stop if progress is still possible */
50  SCIP_NLPPARAM_FASTFAIL_CONSERVATIVE = 1, /**< stop if it seems unlikely that an improving point can be found */
51  SCIP_NLPPARAM_FASTFAIL_AGGRESSIVE = 2 /**< stop if convergence rate is low */
52 };
53 /** NLP solver fast-fail levels */
55 
56 /** parameters for NLP solve */
58 {
59  SCIP_Real lobjlimit; /**< lower objective limit (cutoff) */
60  SCIP_Real feastol; /**< feasibility tolerance (maximal allowed absolute violation of constraints and variable bounds) */
61  SCIP_Real opttol; /**< optimality tolerance (maximal allowed absolute violation of optimality conditions) */
62  SCIP_Real solvertol; /**< solver-specific tolerance on accuracy, e.g., maximal violation of feasibility and optimality in scaled problem (0.0: use solver default) */
63  SCIP_Real timelimit; /**< time limit in seconds: use SCIP_REAL_MAX to use remaining time available for SCIP solve (limits/time - currenttime) */
64  int iterlimit; /**< iteration limit */
65  unsigned short verblevel; /**< verbosity level of output of NLP solver to the screen: 0 off, 1 normal, 2 debug, > 2 more debug */
66  SCIP_NLPPARAM_FASTFAIL fastfail; /**< whether the NLP solver should stop early if convergence is slow */
67  SCIP_Bool expectinfeas; /**< whether to expect an infeasible problem */
68  SCIP_Bool warmstart; /**< whether to try to use solution of previous solve as starting point (if available) */
69  const char* caller; /**< name of file from which NLP is solved (it's fine to set this to NULL) */
70 };
71 /** parameters for NLP solve */
73 
74 /** default verbosity level in NLP parameters */
75 #if defined(SCIP_DEBUG) || defined(SCIP_MOREDEBUG) || defined(SCIP_EVENMOREDEBUG)
76 #define SCIP_NLPPARAM_DEFAULT_VERBLEVEL 1
77 #else
78 #define SCIP_NLPPARAM_DEFAULT_VERBLEVEL 0
79 #endif
80 
81 #if !defined(_MSC_VER) || _MSC_VER >= 1800
82 /** default values for parameters
83  *
84  * Typical use for this define is the initialization of a SCIP_NLPPARAM struct, e.g.,
85  *
86  * SCIP_NLPPARAM nlpparam = { SCIP_NLPPARAM_DEFAULT(scip); } //lint !e446
87  *
88  * or
89  *
90  * SCIP_NLPPARAM nlpparam;
91  * nlpparam = (SCIP_NLPPARAM){ SCIP_NLPPARAM_DEFAULT(scip); } //lint !e446
92  */
93 #define SCIP_NLPPARAM_DEFAULT_INITS(scip) \
94  .lobjlimit = SCIP_REAL_MIN, \
95  .feastol = SCIPfeastol(scip), \
96  .opttol = SCIPdualfeastol(scip), \
97  .solvertol = 0.0, \
98  .timelimit = SCIP_REAL_MAX, \
99  .iterlimit = INT_MAX, \
100  .verblevel = SCIP_NLPPARAM_DEFAULT_VERBLEVEL, \
101  .fastfail = SCIP_NLPPARAM_FASTFAIL_CONSERVATIVE, \
102  .expectinfeas= FALSE, \
103  .warmstart = FALSE, \
104  .caller = __FILE__
105 
106 /** default values for parameters
107  *
108  * Typical use for this define is the initialization of a SCIP_NLPPARAM struct, e.g.,
109  *
110  * SCIP_NLPPARAM nlpparam = SCIP_NLPPARAM_DEFAULT(scip); //lint !e446
111  *
112  * or
113  *
114  * SCIP_NLPPARAM nlpparam;
115  * nlpparam = SCIP_NLPPARAM_DEFAULT(scip); //lint !e446
116  */
117 #define SCIP_NLPPARAM_DEFAULT(scip) (SCIP_NLPPARAM){ SCIP_NLPPARAM_DEFAULT_INITS(scip) }
118 
119 #else
120 /** default NLP parameters with static initialization; required for SCIPsolveNlpi macro with ancient MSVC */
121 static const SCIP_NLPPARAM SCIP_NLPPARAM_DEFAULT_STATIC = {
123 };
124 #define SCIP_NLPPARAM_DEFAULT(scip) SCIP_NLPPARAM_DEFAULT_STATIC
125 #endif
126 
127 /** macro to help printing values of SCIP_NLPPARAM struct
128  *
129  * Typical use for this define is something like
130  *
131  * SCIPdebugMsg(scip, "calling NLP solver with parameters " SCIP_NLPPARAM_PRINT(param));
132  */
133 #define SCIP_NLPPARAM_PRINT(param) \
134  "lobjlimit = %g, " \
135  "feastol = %g, " \
136  "opttol = %g, " \
137  "solvertol = %g, " \
138  "timelimit = %g, " \
139  "iterlimit = %d, " \
140  "verblevel = %hd, " \
141  "fastfail = %d, " \
142  "expectinfeas = %d, " \
143  "warmstart = %d, " \
144  "called by %s\n", \
145  (param).lobjlimit, (param).feastol, (param).opttol, (param).solvertol, (param).timelimit, (param).iterlimit, \
146  (param).verblevel, (param).fastfail, (param).expectinfeas, (param).warmstart, (param).caller != NULL ? (param).caller : "unknown"
147 
148 /** NLP solution status */
150 {
151  SCIP_NLPSOLSTAT_GLOBOPT = 0, /**< solved to global optimality */
152  SCIP_NLPSOLSTAT_LOCOPT = 1, /**< solved to local optimality */
153  SCIP_NLPSOLSTAT_FEASIBLE = 2, /**< feasible solution found */
154  SCIP_NLPSOLSTAT_LOCINFEASIBLE = 3, /**< solution found is local infeasible */
155  SCIP_NLPSOLSTAT_GLOBINFEASIBLE = 4, /**< problem is proven infeasible */
156  SCIP_NLPSOLSTAT_UNBOUNDED = 5, /**< problem is unbounded */
157  SCIP_NLPSOLSTAT_UNKNOWN = 6 /**< unknown solution status (e.g., problem not solved yet) */
158 };
159 typedef enum SCIP_NlpSolStat SCIP_NLPSOLSTAT; /**< NLP solution status */
160 
161 /** NLP solver termination status */
163 {
164  SCIP_NLPTERMSTAT_OKAY = 0, /**< terminated successfully */
165  SCIP_NLPTERMSTAT_TIMELIMIT = 1, /**< time limit exceeded */
166  SCIP_NLPTERMSTAT_ITERLIMIT = 2, /**< iteration limit exceeded */
167  SCIP_NLPTERMSTAT_LOBJLIMIT = 3, /**< lower objective limit reached */
168  SCIP_NLPTERMSTAT_INTERRUPT = 4, /**< SCIP has been asked to stop (SCIPinterruptSolve() called) */
169  SCIP_NLPTERMSTAT_NUMERICERROR = 5, /**< stopped on numerical error */
170  SCIP_NLPTERMSTAT_EVALERROR = 6, /**< stopped on function evaluation error */
171  SCIP_NLPTERMSTAT_OUTOFMEMORY = 7, /**< memory exceeded */
172  SCIP_NLPTERMSTAT_LICENSEERROR = 8, /**< problems with license of NLP solver */
173  SCIP_NLPTERMSTAT_OTHER = 9 /**< other error (= this should never happen) */
174 #if defined(GCC_VERSION) && GCC_VERSION >= 600 && !defined(__INTEL_COMPILER) /* _attribute__ ((deprecated)) within enums not allowed for older GCCs; ICC ignores attributes */
175  ,/* for some backward compatibility */
176  SCIP_NLPTERMSTAT_TILIM SCIP_DEPRECATED = SCIP_NLPTERMSTAT_TIMELIMIT,
177  SCIP_NLPTERMSTAT_ITLIM SCIP_DEPRECATED = SCIP_NLPTERMSTAT_ITERLIMIT,
178  SCIP_NLPTERMSTAT_LOBJLIM SCIP_DEPRECATED = SCIP_NLPTERMSTAT_LOBJLIMIT,
179  SCIP_NLPTERMSTAT_NUMERR SCIP_DEPRECATED = SCIP_NLPTERMSTAT_NUMERICERROR,
180  SCIP_NLPTERMSTAT_EVALERR SCIP_DEPRECATED = SCIP_NLPTERMSTAT_EVALERROR,
181  SCIP_NLPTERMSTAT_MEMERR SCIP_DEPRECATED = SCIP_NLPTERMSTAT_OUTOFMEMORY,
182  SCIP_NLPTERMSTAT_LICERR SCIP_DEPRECATED = SCIP_NLPTERMSTAT_LICENSEERROR
183 #endif
184 };
185 typedef enum SCIP_NlpTermStat SCIP_NLPTERMSTAT; /**< NLP solver termination status */
186 
187 /** Statistics from an NLP solve */
189 {
190  int niterations; /**< number of iterations the NLP solver spend in the last solve command */
191  SCIP_Real totaltime; /**< total time in CPU sections the NLP solver spend in the last solve command */
192  SCIP_Real evaltime; /**< time spend in evaluation of functions and their derivatives (only measured if timing/nlpieval = TRUE) */
193 
194  SCIP_Real consviol; /**< maximal absolute constraint violation in current solution, or SCIP_INVALID if not available */
195  SCIP_Real boundviol; /**< maximal absolute variable bound violation in current solution, or SCIP_INVALID if not available */
196 };
197 typedef struct SCIP_NlpStatistics SCIP_NLPSTATISTICS; /**< NLP solve statistics */
198 
199 /** copy method of NLP interface (called when SCIP copies plugins)
200  *
201  * Implementation of this callback is optional.
202  *
203  * \param[in] scip target SCIP where to include copy of NLPI
204  * \param[in] sourcenlpi the NLP interface to copy
205  */
206 #define SCIP_DECL_NLPICOPY(x) SCIP_RETCODE x (\
207  SCIP* scip, \
208  SCIP_NLPI* sourcenlpi)
209 
210 /** frees the data of the NLP interface
211  *
212  * \param[in] scip SCIP data structure
213  * \param[in] nlpi datastructure for solver interface
214  * \param[in] nlpidata NLPI data to free
215  */
216 #define SCIP_DECL_NLPIFREE(x) SCIP_RETCODE x (\
217  SCIP* scip, \
218  SCIP_NLPI* nlpi, \
219  SCIP_NLPIDATA** nlpidata)
220 
221 /** gets pointer to solver-internal NLP solver
222  *
223  * Implementation of this callback is optional.
224  *
225  * Depending on the solver interface, a solver pointer may exist for every NLP problem instance.
226  * For this case, a nlpiproblem can be passed in as well.
227  *
228  * \param[in] scip SCIP data structure
229  * \param[in] nlpi datastructure for solver interface
230  * \param[in] problem datastructure for problem instance, or NULL
231  *
232  * \return void pointer to solver
233  */
234 #define SCIP_DECL_NLPIGETSOLVERPOINTER(x) void* x (\
235  SCIP* scip, \
236  SCIP_NLPI* nlpi, \
237  SCIP_NLPIPROBLEM* problem)
238 
239 /** creates a problem instance
240  *
241  * \param[in] scip SCIP data structure
242  * \param[in] nlpi datastructure for solver interface
243  * \param[out] problem pointer to store the problem data
244  * \param[in] name name of problem, can be NULL
245  */
246 #define SCIP_DECL_NLPICREATEPROBLEM(x) SCIP_RETCODE x (\
247  SCIP* scip, \
248  SCIP_NLPI* nlpi, \
249  SCIP_NLPIPROBLEM** problem, \
250  const char* name)
251 
252 /** free a problem instance
253  *
254  * \param[in] scip SCIP data structure
255  * \param[in] nlpi datastructure for solver interface
256  * \param[in] problem pointer where problem data is stored
257  */
258 #define SCIP_DECL_NLPIFREEPROBLEM(x) SCIP_RETCODE x (\
259  SCIP* scip, \
260  SCIP_NLPI* nlpi, \
261  SCIP_NLPIPROBLEM** problem)
262 
263 /** gets pointer to solver-internal problem instance
264  *
265  * Implementation of this callback is optional.
266  *
267  * \param[in] scip SCIP data structure
268  * \param[in] nlpi datastructure for solver interface
269  * \param[in] problem datastructure for problem instance
270  *
271  * \return void pointer to problem instance
272  */
273 #define SCIP_DECL_NLPIGETPROBLEMPOINTER(x) void* x (\
274  SCIP* scip, \
275  SCIP_NLPI* nlpi, \
276  SCIP_NLPIPROBLEM* problem)
277 
278 /** adds variables
279  *
280  * \param[in] scip SCIP data structure
281  * \param[in] nlpi datastructure for solver interface
282  * \param[in] problem datastructure for problem instance
283  * \param[in] nvars number of variables
284  * \param[in] lbs lower bounds of variables, can be NULL if -infinity
285  * \param[in] ubs upper bounds of variables, can be NULL if +infinity
286  * \param[in] varnames names of variables, can be NULL
287  */
288 #define SCIP_DECL_NLPIADDVARS(x) SCIP_RETCODE x (\
289  SCIP* scip, \
290  SCIP_NLPI* nlpi, \
291  SCIP_NLPIPROBLEM* problem, \
292  int nvars, \
293  const SCIP_Real* lbs, \
294  const SCIP_Real* ubs, \
295  const char** varnames)
296 
297 /** add constraints
298  *
299  * \param[in] scip SCIP data structure
300  * \param[in] nlpi datastructure for solver interface
301  * \param[in] problem datastructure for problem instance
302  * \param[in] ncons number of added constraints
303  * \param[in] lhss left hand sides of constraints, can be NULL if -infinity
304  * \param[in] rhss right hand sides of constraints, can be NULL if +infinity
305  * \param[in] nlininds number of linear coefficients for each constraint; may be NULL in case of no linear part
306  * \param[in] lininds indices of variables for linear coefficients for each constraint; may be NULL in case of no linear part
307  * \param[in] linvals values of linear coefficient for each constraint; may be NULL in case of no linear part
308  * \param[in] exprs expressions for nonlinear part of constraints; may be NULL or entries may be NULL when no nonlinear parts
309  * \param[in] names names of constraints; may be NULL or entries may be NULL
310  */
311 #define SCIP_DECL_NLPIADDCONSTRAINTS(x) SCIP_RETCODE x (\
312  SCIP* scip, \
313  SCIP_NLPI* nlpi, \
314  SCIP_NLPIPROBLEM* problem, \
315  int nconss, \
316  const SCIP_Real* lhss, \
317  const SCIP_Real* rhss, \
318  const int* nlininds, \
319  int* const* lininds, \
320  SCIP_Real* const* linvals, \
321  SCIP_EXPR** exprs, \
322  const char** names)
323 
324 /** sets or overwrites objective, a minimization problem is expected
325  *
326  * \param[in] scip SCIP data structure
327  * \param[in] nlpi datastructure for solver interface
328  * \param[in] problem datastructure for problem instance
329  * \param[in] nlins number of linear variables
330  * \param[in] lininds variable indices; may be NULL in case of no linear part
331  * \param[in] linvals coefficient values; may be NULL in case of no linear part
332  * \param[in] expr expression for nonlinear part of objective function; may be NULL in case of no nonlinear part
333  * \param[in] constant objective value offset
334  */
335 #define SCIP_DECL_NLPISETOBJECTIVE(x) SCIP_RETCODE x (\
336  SCIP* scip, \
337  SCIP_NLPI* nlpi, \
338  SCIP_NLPIPROBLEM* problem, \
339  int nlins, \
340  const int* lininds, \
341  const SCIP_Real* linvals, \
342  SCIP_EXPR* expr, \
343  const SCIP_Real constant)
344 
345 /** change variable bounds
346  *
347  * \param[in] scip SCIP data structure
348  * \param[in] nlpi datastructure for solver interface
349  * \param[in] problem datastructure for problem instance
350  * \param[in] nvars number of variables to change bounds
351  * \param[in] indices indices of variables to change bounds
352  * \param[in] lbs new lower bounds
353  * \param[in] ubs new upper bounds
354  */
355 #define SCIP_DECL_NLPICHGVARBOUNDS(x) SCIP_RETCODE x (\
356  SCIP* scip, \
357  SCIP_NLPI* nlpi, \
358  SCIP_NLPIPROBLEM* problem, \
359  const int nvars, \
360  const int* indices, \
361  const SCIP_Real* lbs, \
362  const SCIP_Real* ubs)
363 
364 /** change constraint sides
365  *
366  * \param[in] scip SCIP data structure
367  * \param[in] nlpi datastructure for solver interface
368  * \param[in] problem datastructure for problem instance
369  * \param[in] nconss number of constraints to change sides
370  * \param[in] indices indices of constraints to change sides
371  * \param[in] lhss new left hand sides
372  * \param[in] rhss new right hand sides
373  */
374 #define SCIP_DECL_NLPICHGCONSSIDES(x) SCIP_RETCODE x (\
375  SCIP* scip, \
376  SCIP_NLPI* nlpi, \
377  SCIP_NLPIPROBLEM* problem, \
378  int nconss, \
379  const int* indices, \
380  const SCIP_Real* lhss, \
381  const SCIP_Real* rhss)
382 
383 /** delete a set of variables
384  *
385  * \param[in] scip SCIP data structure
386  * \param[in] nlpi datastructure for solver interface
387  * \param[in] problem datastructure for problem instance
388  * \param[in,out] dstats deletion status of vars on input (1 if var should be deleted, 0 if not); new position of var on output, -1 if var was deleted
389  * \param[in] dstatssize size of the dstats array
390  */
391 #define SCIP_DECL_NLPIDELVARSET(x) SCIP_RETCODE x (\
392  SCIP* scip, \
393  SCIP_NLPI* nlpi, \
394  SCIP_NLPIPROBLEM* problem, \
395  int* dstats, \
396  int dstatssize)
397 
398 /** delete a set of constraints
399  *
400  * \param[in] scip SCIP data structure
401  * \param[in] nlpi datastructure for solver interface
402  * \param[in] problem datastructure for problem instance
403  * \param[in,out] dstats deletion status of constraints on input (1 if constraint should be deleted, 0 if not); new position of constraint on output, -1 if constraint was deleted
404  * \param[in] dstatssize size of the dstats array
405  */
406 #define SCIP_DECL_NLPIDELCONSSET(x) SCIP_RETCODE x (\
407  SCIP* scip, \
408  SCIP_NLPI* nlpi, \
409  SCIP_NLPIPROBLEM* problem, \
410  int* dstats, \
411  int dstatssize)
412 
413 /** changes (or adds) linear coefficients in a constraint or objective
414  *
415  * \param[in] scip SCIP data structure
416  * \param[in] nlpi datastructure for solver interface
417  * \param[in] problem datastructure for problem instance
418  * \param[in] idx index of constraint or -1 for objective
419  * \param[in] nvals number of values in linear constraint to change
420  * \param[in] varidxs indices of variables which coefficient to change
421  * \param[in] vals new values for coefficients
422  */
423 #define SCIP_DECL_NLPICHGLINEARCOEFS(x) SCIP_RETCODE x (\
424  SCIP* scip, \
425  SCIP_NLPI* nlpi, \
426  SCIP_NLPIPROBLEM* problem, \
427  int idx, \
428  int nvals, \
429  const int* varidxs, \
430  const SCIP_Real* vals)
431 
432 /** replaces the expression of a constraint or objective
433  *
434  * \param[in] scip SCIP data structure
435  * \param[in] nlpi datastructure for solver interface
436  * \param[in] problem datastructure for problem instance
437  * \param[in] idxcons index of constraint or -1 for objective
438  * \param[in] expr new expression for constraint or objective, or NULL to only remove previous tree
439  */
440 #define SCIP_DECL_NLPICHGEXPR(x) SCIP_RETCODE x (\
441  SCIP* scip, \
442  SCIP_NLPI* nlpi, \
443  SCIP_NLPIPROBLEM* problem, \
444  int idxcons, \
445  SCIP_EXPR* expr)
446 
447 /** changes the constant offset in the objective
448  *
449  * \param[in] scip SCIP data structure
450  * \param[in] nlpi datastructure for solver interface
451  * \param[in] problem datastructure for problem instance
452  * \param[in] objconstant new value for objective constant
453  */
454 #define SCIP_DECL_NLPICHGOBJCONSTANT(x) SCIP_RETCODE x (\
455  SCIP* scip, \
456  SCIP_NLPI* nlpi, \
457  SCIP_NLPIPROBLEM* problem, \
458  SCIP_Real objconstant)
459 
460 /** sets initial guess
461  *
462  * Implementation of this callback is optional.
463  *
464  * \param[in] scip SCIP data structure
465  * \param[in] nlpi datastructure for solver interface
466  * \param[in] problem datastructure for problem instance
467  * \param[in] primalvalues initial primal values for variables, or NULL to clear previous values
468  * \param[in] consdualvalues initial dual values for constraints, or NULL to clear previous values
469  * \param[in] varlbdualvalues initial dual values for variable lower bounds, or NULL to clear previous values
470  * \param[in] varubdualvalues initial dual values for variable upper bounds, or NULL to clear previous values
471  */
472 #define SCIP_DECL_NLPISETINITIALGUESS(x) SCIP_RETCODE x (\
473  SCIP* scip, \
474  SCIP_NLPI* nlpi, \
475  SCIP_NLPIPROBLEM* problem, \
476  SCIP_Real* primalvalues, \
477  SCIP_Real* consdualvalues, \
478  SCIP_Real* varlbdualvalues, \
479  SCIP_Real* varubdualvalues)
480 
481 /** tries to solve NLP
482  *
483  * \param[in] scip SCIP data structure
484  * \param[in] nlpi datastructure for solver interface
485  * \param[in] problem datastructure for problem instance
486  * \param[in] param parameters (e.g., working limits) to use
487  */
488 #define SCIP_DECL_NLPISOLVE(x) SCIP_RETCODE x (\
489  SCIP* scip, \
490  SCIP_NLPI* nlpi, \
491  SCIP_NLPIPROBLEM* problem, \
492  SCIP_NLPPARAM param)
493 
494 /** gives solution status
495  *
496  * \param[in] scip SCIP data structure
497  * \param[in] nlpi datastructure for solver interface
498  * \param[in] problem datastructure for problem instance
499  *
500  * \return Solution Status
501  */
502 #define SCIP_DECL_NLPIGETSOLSTAT(x) SCIP_NLPSOLSTAT x (\
503  SCIP* scip, \
504  SCIP_NLPI* nlpi, \
505  SCIP_NLPIPROBLEM* problem)
506 
507 /** gives termination reason
508  *
509  * \param[in] scip SCIP data structure
510  * \param[in] nlpi datastructure for solver interface
511  * \param[in] problem datastructure for problem instance
512  *
513  * \return Termination Status
514  */
515 #define SCIP_DECL_NLPIGETTERMSTAT(x) SCIP_NLPTERMSTAT x (\
516  SCIP* scip, \
517  SCIP_NLPI* nlpi, \
518  SCIP_NLPIPROBLEM* problem)
519 
520 /** gives primal and dual solution values
521  *
522  * Solver can return NULL in dual values if not available,
523  * but if solver provides dual values for one side of variable bounds, then it must also provide those for the other side.
524  *
525  * 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.
526  *
527  * \param[in] scip SCIP data structure
528  * \param[in] nlpi datastructure for solver interface
529  * \param[in] problem datastructure for problem instance
530  * \param[out] primalvalues buffer to store pointer to array to primal values, or NULL if not needed
531  * \param[out] consdualvalues buffer to store pointer to array to dual values of constraints, or NULL if not needed
532  * \param[out] varlbdualvalues buffer to store pointer to array to dual values of variable lower bounds, or NULL if not needed
533  * \param[out] varubdualvalues buffer to store pointer to array to dual values of variable lower bounds, or NULL if not needed
534  * \param[out] objval pointer to store the objective value, or NULL if not needed
535  */
536 #define SCIP_DECL_NLPIGETSOLUTION(x) SCIP_RETCODE x (\
537  SCIP* scip, \
538  SCIP_NLPI* nlpi, \
539  SCIP_NLPIPROBLEM* problem, \
540  SCIP_Real** primalvalues, \
541  SCIP_Real** consdualvalues, \
542  SCIP_Real** varlbdualvalues, \
543  SCIP_Real** varubdualvalues, \
544  SCIP_Real* objval)
545 
546 /** gives solve statistics
547  *
548  * \param[in] scip SCIP data structure
549  * \param[in] nlpi datastructure for solver interface
550  * \param[in] problem datastructure for problem instance
551  * \param[out] statistics buffer where to store statistics
552  */
553 #define SCIP_DECL_NLPIGETSTATISTICS(x) SCIP_RETCODE x (\
554  SCIP* scip, \
555  SCIP_NLPI* nlpi, \
556  SCIP_NLPIPROBLEM* problem, \
557  SCIP_NLPSTATISTICS* statistics)
558 
559 #ifdef __cplusplus
560 }
561 #endif
562 
563 #endif /*__SCIP_TYPE_NLPI_H__ */
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:185
SCIP_Real opttol
Definition: type_nlpi.h:61
type definitions for NLP management
SCIP_Bool warmstart
Definition: type_nlpi.h:68
enum SCIP_NlpParam_FastFail SCIP_NLPPARAM_FASTFAIL
Definition: type_nlpi.h:54
SCIP_Real feastol
Definition: type_nlpi.h:60
#define FALSE
Definition: def.h:87
unsigned short verblevel
Definition: type_nlpi.h:65
SCIP_Real solvertol
Definition: type_nlpi.h:62
#define SCIP_NLPPARAM_DEFAULT_VERBLEVEL
Definition: type_nlpi.h:78
SCIP_Real timelimit
Definition: type_nlpi.h:63
struct SCIP_NlpiData SCIP_NLPIDATA
Definition: type_nlpi.h:43
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
Definition: type_nlpi.h:159
type definitions for SCIP&#39;s main datastructure
SCIP_NlpTermStat
Definition: type_nlpi.h:162
SCIP_Bool expectinfeas
Definition: type_nlpi.h:67
SCIP_Real totaltime
Definition: type_nlpi.h:191
#define SCIP_DEFAULT_FEASTOL
Definition: def.h:185
#define SCIP_Bool
Definition: def.h:84
SCIP_Real boundviol
Definition: type_nlpi.h:195
const char * caller
Definition: type_nlpi.h:69
SCIP_Real lobjlimit
Definition: type_nlpi.h:59
#define SCIP_REAL_MAX
Definition: def.h:178
#define SCIP_REAL_MIN
Definition: def.h:179
SCIP_Real consviol
Definition: type_nlpi.h:194
SCIP_Real evaltime
Definition: type_nlpi.h:192
#define SCIP_DEFAULT_DUALFEASTOL
Definition: def.h:188
type and macro definitions related to algebraic expressions
#define SCIP_Real
Definition: def.h:177
SCIP_NlpSolStat
Definition: type_nlpi.h:149
SCIP_NlpParam_FastFail
Definition: type_nlpi.h:47
common defines and data types used in all packages of SCIP
SCIP_NLPPARAM_FASTFAIL fastfail
Definition: type_nlpi.h:66