Scippy

SCIP

Solving Constraint Integer Programs

nlp.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-2019 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 scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file nlp.h
17  * @ingroup INTERNALAPI
18  * @brief internal methods for NLP management
19  * @author Thorsten Gellermann
20  * @author Stefan Vigerske
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #ifndef __SCIP_NLP_H__
26 #define __SCIP_NLP_H__
27 
28 
29 #include <stdio.h>
30 
31 #include "scip/def.h"
32 #include "blockmemshell/memory.h"
33 #include "scip/type_event.h"
34 #include "scip/type_set.h"
35 #include "scip/type_stat.h"
36 #include "scip/type_misc.h"
37 #include "scip/type_lp.h"
38 #include "scip/type_var.h"
39 #include "scip/type_prob.h"
40 #include "scip/type_sol.h"
41 #include "scip/type_primal.h"
42 #include "scip/pub_nlp.h"
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /**@name Expressions and Expression tree methods */
49 /**@{ */
50 
51 /** removes fixed variables from an expression tree, so that at exit all variables are active */
53  SCIP_EXPRTREE* tree, /**< expression tree */
54  SCIP_SET* set, /**< global SCIP settings */
55  SCIP_Bool* changed, /**< buffer to store whether the tree was changed, i.e., whether there was a fixed variable */
56  int* varpos, /**< array of length at least tree->nvars to store new indices of previously existing variables in expression tree, or -1 if variable was removed; set to NULL if not of interest */
57  int* newvarsstart /**< buffer to store index in tree->vars array where new variables begin, or NULL if not of interest */
58  );
59 
60 /**@} */
61 
62 /**@name Nonlinear row methods */
63 /**@{ */
64 
65 /** create a new nonlinear row
66  * the new row is already captured
67  */
69  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
70  BMS_BLKMEM* blkmem, /**< block memory */
71  SCIP_SET* set, /**< global SCIP settings */
72  const char* name, /**< name of nonlinear row */
73  SCIP_Real constant, /**< constant */
74  int nlinvars, /**< number of linear variables */
75  SCIP_VAR** linvars, /**< linear variables, or NULL if nlinvars == 0 */
76  SCIP_Real* lincoefs, /**< linear coefficients, or NULL if nlinvars == 0 */
77  int nquadvars, /**< number variables in quadratic terms */
78  SCIP_VAR** quadvars, /**< variables in quadratic terms, or NULL if nquadvars == 0 */
79  int nquadelems, /**< number of entries in quadratic term matrix */
80  SCIP_QUADELEM* quadelems, /**< elements of quadratic term matrix, or NULL if nquadelems == 0 */
81  SCIP_EXPRTREE* exprtree, /**< expression tree, or NULL */
82  SCIP_Real lhs, /**< left hand side */
83  SCIP_Real rhs, /**< right hand side */
84  SCIP_EXPRCURV curvature /**< curvature of the nonlinear row */
85  );
86 
87 /** create a nonlinear row that is a copy of a given row
88  * the new row is already captured
89  */
91  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
92  BMS_BLKMEM* blkmem, /**< block memory */
93  SCIP_SET* set, /**< global SCIP settings */
94  SCIP_NLROW* sourcenlrow /**< nonlinear row to copy */
95  );
96 
97 /** create a new nonlinear row from a linear row
98  * the new row is already captured
99  */
101  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
102  BMS_BLKMEM* blkmem, /**< block memory */
103  SCIP_SET* set, /**< global SCIP settings */
104  SCIP_ROW* row /**< the linear row to copy */
105  );
106 
107 /** frees a nonlinear row */
109  SCIP_NLROW** nlrow, /**< pointer to NLP row */
110  BMS_BLKMEM* blkmem /**< block memory */
111  );
112 
113 /** output nonlinear row to file stream */
115  SCIP_NLROW* nlrow, /**< NLP row */
116  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
117  FILE* file /**< output file (or NULL for standard output) */
118  );
119 
120 /** increases usage counter of NLP nonlinear row */
121 void SCIPnlrowCapture(
122  SCIP_NLROW* nlrow /**< nonlinear row to capture */
123  );
124 
125 /** decreases usage counter of NLP nonlinear row */
127  SCIP_NLROW** nlrow, /**< nonlinear row to free */
128  BMS_BLKMEM* blkmem, /**< block memory */
129  SCIP_SET* set /**< global SCIP settings */
130  );
131 
132 /** ensures, that linear coefficient array of nonlinear row can store at least num entries */
134  SCIP_NLROW* nlrow, /**< NLP row */
135  BMS_BLKMEM* blkmem, /**< block memory */
136  SCIP_SET* set, /**< global SCIP settings */
137  int num /**< minimum number of entries to store */
138  );
139 
140 /** adds a previously non existing linear coefficient to an NLP nonlinear row */
142  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
143  BMS_BLKMEM* blkmem, /**< block memory */
144  SCIP_SET* set, /**< global SCIP settings */
145  SCIP_STAT* stat, /**< problem statistics data */
146  SCIP_NLP* nlp, /**< current NLP data */
147  SCIP_VAR* var, /**< variable */
148  SCIP_Real val /**< value of coefficient */
149  );
150 
151 /** deletes linear coefficient from nonlinear row */
153  SCIP_NLROW* nlrow, /**< nonlinear row to be changed */
154  SCIP_SET* set, /**< global SCIP settings */
155  SCIP_STAT* stat, /**< problem statistics data */
156  SCIP_NLP* nlp, /**< current NLP data */
157  SCIP_VAR* var /**< coefficient to be deleted */
158  );
159 
160 /** changes or adds a linear coefficient to a nonlinear row */
162  SCIP_NLROW* nlrow, /**< nonlinear row */
163  BMS_BLKMEM* blkmem, /**< block memory */
164  SCIP_SET* set, /**< global SCIP settings */
165  SCIP_STAT* stat, /**< problem statistics data */
166  SCIP_NLP* nlp, /**< current NLP data */
167  SCIP_VAR* var, /**< variable */
168  SCIP_Real coef /**< new value of coefficient */
169  );
170 
171 /** ensures, that quadratic variables array of nonlinear row can store at least num entries */
173  SCIP_NLROW* nlrow, /**< NLP row */
174  BMS_BLKMEM* blkmem, /**< block memory */
175  SCIP_SET* set, /**< global SCIP settings */
176  int num /**< minimum number of entries to store */
177  );
178 
179 /** adds variable to quadvars array of row */
181  SCIP_NLROW* nlrow, /**< nonlinear row */
182  BMS_BLKMEM* blkmem, /**< block memory */
183  SCIP_SET* set, /**< global SCIP settings */
184  SCIP_VAR* var /**< variable to search for */
185  );
186 
187 /** ensures, that quadratic elements array of nonlinear row can store at least num entries */
189  SCIP_NLROW* nlrow, /**< NLP row */
190  BMS_BLKMEM* blkmem, /**< block memory */
191  SCIP_SET* set, /**< global SCIP settings */
192  int num /**< minimum number of entries to store */
193  );
194 
195 /** adds a previously non existing quadratic element to an NLP nonlinear row */
197  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
198  BMS_BLKMEM* blkmem, /**< block memory */
199  SCIP_SET* set, /**< global SCIP settings */
200  SCIP_STAT* stat, /**< problem statistics data */
201  SCIP_NLP* nlp, /**< current NLP data */
202  SCIP_QUADELEM elem /**< quadratic element to add */
203  );
204 
205 /** deletes quadratic element from nonlinear row */
207  SCIP_NLROW* nlrow, /**< nonlinear row to be changed */
208  SCIP_SET* set, /**< global SCIP settings */
209  SCIP_STAT* stat, /**< problem statistics data */
210  SCIP_NLP* nlp, /**< current NLP data */
211  int idx1, /**< index of first variable in element */
212  int idx2 /**< index of second variable in element */
213  );
214 
215 /** changes or adds a quadratic element to a nonlinear row */
217  SCIP_NLROW* nlrow, /**< nonlinear row */
218  BMS_BLKMEM* blkmem, /**< block memory */
219  SCIP_SET* set, /**< global SCIP settings */
220  SCIP_STAT* stat, /**< problem statistics data */
221  SCIP_NLP* nlp, /**< current NLP data */
222  SCIP_QUADELEM elem /**< new quadratic element */
223  );
224 
225 /** replaces or deletes an expression tree in nonlinear row */
227  SCIP_NLROW* nlrow, /**< nonlinear row */
228  BMS_BLKMEM* blkmem, /**< block memory */
229  SCIP_SET* set, /**< global SCIP settings */
230  SCIP_STAT* stat, /**< problem statistics data */
231  SCIP_NLP* nlp, /**< current NLP data */
232  SCIP_EXPRTREE* exprtree /**< new expression tree, or NULL to delete current one */
233  );
234 
235 /** changes a parameter in an expression of a nonlinear row */
237  SCIP_NLROW* nlrow, /**< nonlinear row */
238  BMS_BLKMEM* blkmem, /**< block memory */
239  SCIP_SET* set, /**< global SCIP settings */
240  SCIP_STAT* stat, /**< problem statistics data */
241  SCIP_NLP* nlp, /**< current NLP data */
242  int paramidx, /**< index of parameter in expression tree's parameter array */
243  SCIP_Real paramval /**< new value of parameter */
244  );
245 
246 /** changes all parameters in an expression of a nonlinear row */
248  SCIP_NLROW* nlrow, /**< nonlinear row */
249  BMS_BLKMEM* blkmem, /**< block memory */
250  SCIP_SET* set, /**< global SCIP settings */
251  SCIP_STAT* stat, /**< problem statistics data */
252  SCIP_NLP* nlp, /**< current NLP data */
253  SCIP_Real* paramvals /**< new values of parameters */
254  );
255 
256 /** changes constant of nonlinear row */
258  SCIP_NLROW* nlrow, /**< nonlinear row */
259  SCIP_SET* set, /**< global SCIP settings */
260  SCIP_STAT* stat, /**< problem statistics data */
261  SCIP_NLP* nlp, /**< current NLP data */
262  SCIP_Real constant /**< new constant */
263  );
264 
265 /** changes left hand side of nonlinear row */
267  SCIP_NLROW* nlrow, /**< nonlinear row */
268  SCIP_SET* set, /**< global SCIP settings */
269  SCIP_STAT* stat, /**< problem statistics data */
270  SCIP_NLP* nlp, /**< current NLP data */
271  SCIP_Real lhs /**< new left hand side */
272  );
273 
274 /** changes right hand side of nonlinear row */
276  SCIP_NLROW* nlrow, /**< nonlinear row */
277  SCIP_SET* set, /**< global SCIP settings */
278  SCIP_STAT* stat, /**< problem statistics data */
279  SCIP_NLP* nlp, /**< current NLP data */
280  SCIP_Real rhs /**< new right hand side */
281  );
282 
283 /** removes (or substitutes) all fixed, negated, aggregated, multi-aggregated variables from the linear, quadratic, and nonquadratic terms of a nonlinear row */
285  SCIP_NLROW* nlrow, /**< nonlinear row */
286  BMS_BLKMEM* blkmem, /**< block memory */
287  SCIP_SET* set, /**< global SCIP settings */
288  SCIP_STAT* stat, /**< problem statistics data */
289  SCIP_NLP* nlp /**< current NLP data */
290  );
291 
292 /** recalculates the current activity of a nonlinear row in the current NLP solution */
294  SCIP_NLROW* nlrow, /**< nonlinear row */
295  SCIP_SET* set, /**< global SCIP settings */
296  SCIP_STAT* stat, /**< problem statistics */
297  SCIP_NLP* nlp /**< current NLP data */
298  );
299 
300 /** gives the activity of a nonlinear row in the current NLP solution */
302  SCIP_NLROW* nlrow, /**< nonlinear row */
303  SCIP_SET* set, /**< global SCIP settings */
304  SCIP_STAT* stat, /**< problem statistics */
305  SCIP_NLP* nlp, /**< current NLP data */
306  SCIP_Real* activity /**< buffer to store activity value */
307  );
308 
309 /** gives the feasibility of a nonlinear row in the current NLP solution: negative value means infeasibility */
311  SCIP_NLROW* nlrow, /**< nonlinear row */
312  SCIP_SET* set, /**< global SCIP settings */
313  SCIP_STAT* stat, /**< problem statistics */
314  SCIP_NLP* nlp, /**< current NLP data */
315  SCIP_Real* feasibility /**< buffer to store feasibility value */
316  );
317 
318 /** calculates the current pseudo activity of a nonlinear row */
320  SCIP_NLROW* nlrow, /**< nonlinear row */
321  SCIP_SET* set, /**< global SCIP settings */
322  SCIP_STAT* stat /**< problem statistics */
323  );
324 
325 /** returns the pseudo activity of a nonlinear row in the current pseudo solution */
327  SCIP_NLROW* nlrow, /**< nonlinear row */
328  SCIP_SET* set, /**< global SCIP settings */
329  SCIP_STAT* stat, /**< problem statistics */
330  SCIP_Real* pseudoactivity /**< buffer to store pseudo activity value */
331  );
332 
333 /** returns the pseudo feasibility of a nonlinear row in the current pseudo solution: negative value means infeasibility */
335  SCIP_NLROW* nlrow, /**< nonlinear row */
336  SCIP_SET* set, /**< global SCIP settings */
337  SCIP_STAT* stat, /**< problem statistics */
338  SCIP_Real* pseudofeasibility /**< buffer to store pseudo feasibility value */
339  );
340 
341 /** returns the activity of a nonlinear row for a given solution */
343  SCIP_NLROW* nlrow, /**< nonlinear row */
344  SCIP_SET* set, /**< global SCIP settings */
345  SCIP_STAT* stat, /**< problem statistics data */
346  SCIP_SOL* sol, /**< primal CIP solution */
347  SCIP_Real* activity /**< buffer to store activity value */
348  );
349 
350 /** returns the feasibility of a nonlinear row for the given solution */
352  SCIP_NLROW* nlrow, /**< nonlinear row */
353  SCIP_SET* set, /**< global SCIP settings */
354  SCIP_STAT* stat, /**< problem statistics data */
355  SCIP_SOL* sol, /**< primal CIP solution */
356  SCIP_Real* feasibility /**< buffer to store feasibility value */
357  );
358 
359 /** returns the minimal activity of a nonlinear row w.r.t. the variables' bounds */
361  SCIP_NLROW* nlrow, /**< nonlinear row */
362  SCIP_SET* set, /**< global SCIP settings */
363  SCIP_STAT* stat, /**< problem statistics data */
364  SCIP_Real* minactivity, /**< buffer to store minimal activity, or NULL */
365  SCIP_Real* maxactivity /**< buffer to store maximal activity, or NULL */
366  );
367 
368 /** returns whether the nonlinear row is redundant w.r.t. the variables' bounds */
370  SCIP_NLROW* nlrow, /**< nonlinear row */
371  SCIP_SET* set, /**< global SCIP settings */
372  SCIP_STAT* stat, /**< problem statistics data */
373  SCIP_Bool* isredundant /**< buffer to store whether row is redundant */
374  );
375 
376 /**@} */
377 
378 /**@name NLP methods */
379 /**@{ */
380 
381 /** includes event handler that is used by NLP */
383  SCIP_SET* set, /**< global SCIP settings */
384  BMS_BLKMEM* blkmem /**< block memory */
385  );
386 
387 /** construct a new empty NLP */
389  SCIP_NLP** nlp, /**< NLP handler, call by reference */
390  BMS_BLKMEM* blkmem, /**< block memory */
391  SCIP_SET* set, /**< global SCIP settings */
392  SCIP_STAT* stat, /**< problem statistics */
393  const char* name, /**< problem name */
394  int nvars_estimate /**< an estimate on the number of variables that may be added to the NLP later */
395  );
396 
397 /** frees NLP data object */
399  SCIP_NLP** nlp, /**< pointer to NLP data object */
400  BMS_BLKMEM* blkmem, /**< block memory */
401  SCIP_SET* set, /**< global SCIP settings */
402  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
403  SCIP_LP* lp /**< SCIP LP, needed for releasing variables */
404  );
405 
406 /** resets the NLP to the empty NLP by removing all variables and rows from NLP,
407  * releasing all rows, and flushing the changes to the NLP solver
408  */
410  SCIP_NLP* nlp, /**< NLP data */
411  BMS_BLKMEM* blkmem, /**< block memory */
412  SCIP_SET* set, /**< global SCIP settings */
413  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
414  SCIP_LP* lp /**< SCIP LP, needed for releasing variables */
415  );
416 
417 /** currently a dummy function that always returns TRUE */
419  SCIP_NLP* nlp /**< NLP data */
420  );
421 
422 /** ensures, that variables array of NLP can store at least num entries */
424  SCIP_NLP* nlp, /**< NLP data */
425  BMS_BLKMEM* blkmem, /**< block memory */
426  SCIP_SET* set, /**< global SCIP settings */
427  int num /**< minimum number of entries to store */
428  );
429 
430 /** adds a variable to the NLP and captures the variable */
432  SCIP_NLP* nlp, /**< NLP data */
433  BMS_BLKMEM* blkmem, /**< block memory */
434  SCIP_SET* set, /**< global SCIP settings */
435  SCIP_VAR* var /**< variable */
436  );
437 
438 /** adds a set of variables to the NLP and captures the variables */
440  SCIP_NLP* nlp, /**< NLP data */
441  BMS_BLKMEM* blkmem, /**< block memory */
442  SCIP_SET* set, /**< global SCIP settings */
443  int nvars, /**< number of variables to add */
444  SCIP_VAR** vars /**< variables to add */
445  );
446 
447 /** deletes a variable from the NLP and releases the variable */
449  SCIP_NLP* nlp, /**< NLP data */
450  BMS_BLKMEM* blkmem, /**< block memory */
451  SCIP_SET* set, /**< global SCIP settings */
452  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
453  SCIP_LP* lp, /**< SCIP LP, needed to release variable */
454  SCIP_VAR* var /**< variable */
455  );
456 
457 /** ensures, that nonlinear rows array of NLP can store at least num entries */
459  SCIP_NLP* nlp, /**< NLP data */
460  BMS_BLKMEM* blkmem, /**< block memory */
461  SCIP_SET* set, /**< global SCIP settings */
462  int num /**< minimum number of entries to store */
463  );
464 
465 /** adds a nonlinear row to the NLP and captures it
466  * all variables of the row need to be present in the NLP */
468  SCIP_NLP* nlp, /**< NLP data */
469  BMS_BLKMEM* blkmem, /**< block memory */
470  SCIP_SET* set, /**< global SCIP settings */
471  SCIP_STAT* stat, /**< problem statistics data */
472  SCIP_NLROW* nlrow /**< nonlinear row */
473  );
474 
475 /** adds nonlinear rows to the NLP and captures them
476  * all variables of the row need to be present in the NLP */
478  SCIP_NLP* nlp, /**< NLP data */
479  BMS_BLKMEM* blkmem, /**< block memory */
480  SCIP_SET* set, /**< global SCIP settings */
481  SCIP_STAT* stat, /**< problem statistics data */
482  int nnlrows, /**< number of rows to add */
483  SCIP_NLROW** nlrows /**< rows to add */
484  );
485 
486 /** deletes a nonlinear row from the NLP
487  * does nothing if nonlinear row is not in NLP */
489  SCIP_NLP* nlp, /**< NLP data */
490  BMS_BLKMEM* blkmem, /**< block memory */
491  SCIP_SET* set, /**< global SCIP settings */
492  SCIP_NLROW* nlrow /**< nonlinear row */
493  );
494 
495 /** applies all cached changes to the NLP solver */
497  SCIP_NLP* nlp, /**< current NLP data */
498  BMS_BLKMEM* blkmem, /**< block memory */
499  SCIP_SET* set /**< global SCIP settings */
500  );
501 
502 /** solves the NLP */
504  SCIP_NLP* nlp, /**< NLP data */
505  BMS_BLKMEM* blkmem, /**< block memory buffers */
506  SCIP_SET* set, /**< global SCIP settings */
507  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
508  SCIP_STAT* stat /**< problem statistics */
509  );
510 
511 /** gets objective value of current NLP */
513  SCIP_NLP* nlp /**< current NLP data */
514  );
515 
516 /** gives current pseudo objective value */
518  SCIP_NLP* nlp, /**< current NLP data */
519  SCIP_SET* set, /**< global SCIP settings */
520  SCIP_STAT* stat, /**< problem statistics */
521  SCIP_Real* pseudoobjval /**< buffer to store pseudo objective value */
522  );
523 
524 /** gets fractional variables of last NLP solution along with solution values and fractionalities
525  */
527  SCIP_NLP* nlp, /**< NLP data structure */
528  BMS_BLKMEM* blkmem, /**< block memory */
529  SCIP_SET* set, /**< global SCIP settings */
530  SCIP_STAT* stat, /**< problem statistics */
531  SCIP_VAR*** fracvars, /**< pointer to store the array of NLP fractional variables, or NULL */
532  SCIP_Real** fracvarssol, /**< pointer to store the array of NLP fractional variables solution values, or NULL */
533  SCIP_Real** fracvarsfrac, /**< pointer to store the array of NLP fractional variables fractionalities, or NULL */
534  int* nfracvars, /**< pointer to store the number of NLP fractional variables , or NULL */
535  int* npriofracvars /**< pointer to store the number of NLP fractional variables with maximal branching priority, or NULL */
536  );
537 
538 /** removes all redundant nonlinear rows */
540  SCIP_NLP* nlp, /**< current NLP data */
541  BMS_BLKMEM* blkmem, /**< block memory buffers */
542  SCIP_SET* set, /**< global SCIP settings */
543  SCIP_STAT* stat /**< problem statistics */
544  );
545 
546 /** set initial guess (approximate primal solution) for next solve
547  *
548  * array initguess must be NULL or have length at least SCIPnlpGetNVars()
549  */
551  SCIP_NLP* nlp, /**< current NLP data */
552  BMS_BLKMEM* blkmem, /**< block memory buffers */
553  SCIP_Real* initguess /**< new initial guess, or NULL to clear previous one */
554  );
555 
556 /** writes NLP to a file */
558  SCIP_NLP* nlp, /**< current NLP data */
559  SCIP_SET* set, /**< global SCIP settings */
560  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
561  const char* fname /**< file name */
562  );
563 
564 /*
565  * NLP diving methods
566  */
567 
568 /** signals start of diving */
570  SCIP_NLP* nlp, /**< current NLP data */
571  BMS_BLKMEM* blkmem, /**< block memory buffers */
572  SCIP_SET* set /**< global SCIP settings */
573  );
574 
575 /** resets the bound and objective changes made during diving and disables diving mode */
577  SCIP_NLP* nlp, /**< current NLP data */
578  BMS_BLKMEM* blkmem, /**< block memory buffers */
579  SCIP_SET* set /**< global SCIP settings */
580  );
581 
582 /** changes coefficient of variable in diving NLP */
584  SCIP_NLP* nlp, /**< current NLP data */
585  BMS_BLKMEM* blkmem, /**< block memory */
586  SCIP_SET* set, /**< global SCIP settings */
587  SCIP_STAT* stat, /**< problem statistics data */
588  SCIP_VAR* var, /**< variable which coefficient to change */
589  SCIP_Real coef /**< new linear coefficient of variable in objective */
590  );
591 
592 /** changes bounds of variable in diving NLP */
594  SCIP_NLP* nlp, /**< current NLP data */
595  SCIP_VAR* var, /**< variable which bounds to change */
596  SCIP_Real lb, /**< new lower bound of variable */
597  SCIP_Real ub /**< new upper bound of variable */
598  );
599 
600 /** changes bounds of a set of variables in diving NLP */
602  SCIP_NLP* nlp, /**< current NLP data */
603  SCIP_SET* set, /**< global SCIP settings */
604  int nvars, /**< number of variables which bounds to change */
605  SCIP_VAR** vars, /**< variables which bounds to change */
606  SCIP_Real* lbs, /**< new lower bounds of variables */
607  SCIP_Real* ubs /**< new upper bounds of variables */
608  );
609 
610 /** returns whether the objective function has been changed during diving */
612  SCIP_NLP* nlp /**< current NLP data */
613  );
614 
615 /** solves diving NLP */
617  SCIP_NLP* nlp, /**< current NLP data */
618  BMS_BLKMEM* blkmem, /**< block memory buffers */
619  SCIP_SET* set, /**< global SCIP settings */
620  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
621  SCIP_STAT* stat /**< problem statistics */
622  );
623 
624 /** gets array with variables of the NLP */
626  SCIP_NLP* nlp /**< current NLP data */
627  );
628 
629 /** gets current number of variables in NLP */
630 int SCIPnlpGetNVars(
631  SCIP_NLP* nlp /**< current NLP data */
632  );
633 
634 /** computes for each variables the number of NLP rows in which the variable appears in a nonlinear var */
636  SCIP_NLP* nlp, /**< current NLP data */
637  int* nlcount /**< an array of length at least SCIPnlpGetNVars() to store nonlinearity counts of variables */
638  );
639 
640 /** indicates whether there exists a row that contains a continuous variable in a nonlinear term
641  *
642  * @note The method may have to touch every row and nonlinear term to compute its result.
643  */
645  SCIP_NLP* nlp /**< current NLP data */
646  );
647 
648 /** gives dual solution values associated with lower bounds of NLP variables */
650  SCIP_NLP* nlp /**< current NLP data */
651  );
652 
653 /** gives dual solution values associated with upper bounds of NLP variables */
655  SCIP_NLP* nlp /**< current NLP data */
656  );
657 
658 /** gets array with nonlinear rows of the NLP */
660  SCIP_NLP* nlp /**< current NLP data */
661  );
662 
663 /** gets current number of nonlinear rows in NLP */
665  SCIP_NLP* nlp /**< current NLP data */
666  );
667 
668 /** gets the NLP solver interface */
670  SCIP_NLP* nlp /**< current NLP data */
671  );
672 
673 /** gets the NLP problem in the solver interface */
675  SCIP_NLP* nlp /**< current NLP data */
676  );
677 
678 /** indicates whether NLP is currently in diving mode */
680  SCIP_NLP* nlp /**< current NLP data */
681  );
682 
683 /** gets solution status of current NLP */
685  SCIP_NLP* nlp /**< current NLP data */
686  );
687 
688 /** gets termination status of last NLP solve */
690  SCIP_NLP* nlp /**< current NLP data */
691  );
692 
693 /** gives statistics (number of iterations, solving time, ...) of last NLP solve */
695  SCIP_NLP* nlp, /**< pointer to NLP datastructure */
696  SCIP_NLPSTATISTICS* statistics /**< pointer to store statistics */
697  );
698 
699 /** indicates whether a feasible solution for the current NLP is available
700  * thus, returns whether the solution status <= feasible */
702  SCIP_NLP* nlp /**< current NLP data */
703  );
704 
705 /** gets integer parameter of NLP */
707  SCIP_NLP* nlp, /**< pointer to NLP datastructure */
708  SCIP_NLPPARAM type, /**< parameter number */
709  int* ival /**< pointer to store the parameter value */
710  );
711 
712 /** sets integer parameter of NLP */
714  SCIP_NLP* nlp, /**< pointer to NLP datastructure */
715  SCIP_NLPPARAM type, /**< parameter number */
716  int ival /**< parameter value */
717  );
718 
719 /** gets floating point parameter of NLP */
721  SCIP_NLP* nlp, /**< pointer to NLP datastructure */
722  SCIP_NLPPARAM type, /**< parameter number */
723  SCIP_Real* dval /**< pointer to store the parameter value */
724  );
725 
726 /** sets floating point parameter of NLP */
728  SCIP_NLP* nlp, /**< pointer to NLP datastructure */
729  SCIP_NLPPARAM type, /**< parameter number */
730  SCIP_Real dval /**< parameter value */
731  );
732 
733 /** gets string parameter of NLP */
735  SCIP_NLP* nlp, /**< pointer to NLP datastructure */
736  SCIP_NLPPARAM type, /**< parameter number */
737  const char** sval /**< pointer to store the parameter value */
738  );
739 
740 /** sets string parameter of NLP */
742  SCIP_NLP* nlp, /**< pointer to NLP datastructure */
743  SCIP_NLPPARAM type, /**< parameter number */
744  const char* sval /**< parameter value */
745  );
746 
747 /**@} */
748 
749 #ifdef __cplusplus
750 }
751 #endif
752 
753 #endif /* __SCIP_NLP_H__ */
SCIP_RETCODE SCIPnlpDelVar(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_VAR *var)
Definition: nlp.c:5379
SCIP_RETCODE SCIPnlpFree(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: nlp.c:5186
SCIP_RETCODE SCIPnlrowEnsureQuadVarsSize(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:2525
SCIP_RETCODE SCIPnlpSetStringPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, const char *sval)
Definition: nlp.c:6112
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:84
int SCIPnlpGetNVars(SCIP_NLP *nlp)
Definition: nlp.c:5803
SCIP_RETCODE SCIPnlpEndDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:6162
type definitions for miscellaneous datastructures
SCIP_RETCODE SCIPnlrowFree(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem)
Definition: nlp.c:2253
SCIP_NLPTERMSTAT SCIPnlpGetTermstat(SCIP_NLP *nlp)
Definition: nlp.c:5992
SCIP_RETCODE SCIPnlrowChgConstant(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real constant)
Definition: nlp.c:2773
SCIP_RETCODE SCIPnlrowChgExprtreeParam(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, int paramidx, SCIP_Real paramval)
Definition: nlp.c:2728
int SCIPnlpGetNNlRows(SCIP_NLP *nlp)
Definition: nlp.c:5942
SCIP_RETCODE SCIPnlrowGetSolFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: nlp.c:3159
SCIP_RETCODE SCIPnlrowAddQuadVar(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_VAR *var)
Definition: nlp.c:2549
SCIP_RETCODE SCIPnlrowCreateCopy(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_NLROW *sourcenlrow)
Definition: nlp.c:2150
SCIP_NLPI * SCIPnlpGetNLPI(SCIP_NLP *nlp)
Definition: nlp.c:5952
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPnlpEnsureVarsSize(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:5294
type definitions for global SCIP settings
SCIP_Bool SCIPnlpIsDiving(SCIP_NLP *nlp)
Definition: nlp.c:5972
SCIP_RETCODE SCIPnlpAddVar(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_VAR *var)
Definition: nlp.c:5328
SCIP_Real SCIPnlpGetObjval(SCIP_NLP *nlp)
Definition: nlp.c:5590
SCIP_RETCODE SCIPnlpChgVarObjDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_Real coef)
Definition: nlp.c:6223
SCIP_RETCODE SCIPnlrowDelQuadElement(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, int idx1, int idx2)
Definition: nlp.c:2623
SCIP_RETCODE SCIPnlrowRecalcNLPActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp)
Definition: nlp.c:2849
SCIP_RETCODE SCIPnlpGetRealPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, SCIP_Real *dval)
Definition: nlp.c:6062
SCIP_RETCODE SCIPnlpAddVars(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, int nvars, SCIP_VAR **vars)
Definition: nlp.c:5354
SCIP_RETCODE SCIPnlpChgVarBoundsDive(SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: nlp.c:6283
enum SCIP_NlpParam SCIP_NLPPARAM
Definition: type_nlpi.h:56
SCIP_Real * SCIPnlpGetVarsLbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:5912
SCIP_NLPIPROBLEM * SCIPnlpGetNLPIProblem(SCIP_NLP *nlp)
Definition: nlp.c:5962
SCIP_RETCODE SCIPnlrowCreateFromRow(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_ROW *row)
Definition: nlp.c:2185
SCIP_RETCODE SCIPnlrowPrint(SCIP_NLROW *nlrow, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: nlp.c:2290
void SCIPnlrowCapture(SCIP_NLROW *nlrow)
Definition: nlp.c:2345
type definitions for problem statistics
SCIP_RETCODE SCIPexprtreeRemoveFixedVars(SCIP_EXPRTREE *tree, SCIP_SET *set, SCIP_Bool *changed, int *varpos, int *newvarsstart)
Definition: nlp.c:224
type definitions for LP management
SCIP_RETCODE SCIPnlpWrite(SCIP_NLP *nlp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *fname)
Definition: nlp.c:5742
SCIP_RETCODE SCIPnlrowGetActivityBounds(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: nlp.c:3180
SCIP_RETCODE SCIPnlrowCreate(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadvars, SCIP_VAR **quadvars, int nquadelems, SCIP_QUADELEM *quadelems, SCIP_EXPRTREE *exprtree, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
Definition: nlp.c:2001
SCIP_RETCODE SCIPnlrowEnsureQuadElementsSize(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:2584
SCIP_RETCODE SCIPnlpSetRealPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: nlp.c:6079
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
Definition: type_nlpi.h:69
SCIP_RETCODE SCIPnlpReset(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: nlp.c:5245
SCIP_RETCODE SCIPnlrowIsRedundant(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool *isredundant)
Definition: nlp.c:3211
SCIP_RETCODE SCIPnlrowChgExprtreeParams(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *paramvals)
Definition: nlp.c:2751
SCIP_RETCODE SCIPnlrowChgRhs(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real rhs)
Definition: nlp.c:2813
SCIP_RETCODE SCIPnlrowGetNLPFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *feasibility)
Definition: nlp.c:2953
SCIP_RETCODE SCIPnlpGetVarsNonlinearity(SCIP_NLP *nlp, int *nlcount)
Definition: nlp.c:5813
SCIP_RETCODE SCIPnlpInclude(SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: nlp.c:5040
SCIP_RETCODE SCIPnlpRemoveRedundantNlRows(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:5663
SCIP_RETCODE SCIPnlrowAddLinearCoef(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real val)
Definition: nlp.c:2406
SCIP_RETCODE SCIPnlpCreate(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, const char *name, int nvars_estimate)
Definition: nlp.c:5065
type definitions for problem variables
SCIP_RETCODE SCIPnlrowRecalcPseudoActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:2973
SCIP_RETCODE SCIPnlpStartDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:6132
SCIP_Bool SCIPnlpHasContinuousNonlinearity(SCIP_NLP *nlp)
Definition: nlp.c:5874
type definitions for managing events
public methods for NLP management
SCIP_Bool SCIPnlpIsDivingObjChanged(SCIP_NLP *nlp)
Definition: nlp.c:6355
SCIP_RETCODE SCIPnlrowDelLinearCoef(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_VAR *var)
Definition: nlp.c:2454
#define SCIP_Bool
Definition: def.h:70
SCIP_RETCODE SCIPnlpGetIntPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, int *ival)
Definition: nlp.c:6029
SCIP_RETCODE SCIPnlpSolveDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat)
Definition: nlp.c:6363
SCIP_Real * SCIPnlpGetVarsUbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:5922
SCIP_RETCODE SCIPnlrowAddQuadElement(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_QUADELEM elem)
Definition: nlp.c:2608
SCIP_RETCODE SCIPnlrowGetPseudoActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *pseudoactivity)
Definition: nlp.c:3028
SCIP_NLROW ** SCIPnlpGetNlRows(SCIP_NLP *nlp)
Definition: nlp.c:5932
SCIP_RETCODE SCIPnlpGetStringPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, const char **sval)
Definition: nlp.c:6095
SCIP_RETCODE SCIPnlrowGetPseudoFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *pseudofeasibility)
Definition: nlp.c:3054
SCIP_RETCODE SCIPnlrowChgLhs(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real lhs)
Definition: nlp.c:2793
SCIP_RETCODE SCIPnlrowRelease(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:2357
type definitions for storing primal CIP solutions
type definitions for storing and manipulating the main problem
SCIP_RETCODE SCIPnlrowChgQuadElem(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_QUADELEM elem)
Definition: nlp.c:2657
enum SCIP_ExprCurv SCIP_EXPRCURV
Definition: type_expr.h:95
SCIP_RETCODE SCIPnlpEnsureNlRowsSize(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:5415
SCIP_RETCODE SCIPnlpDelNlRow(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_NLROW *nlrow)
Definition: nlp.c:5495
SCIP_RETCODE SCIPnlpFlush(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:5526
SCIP_RETCODE SCIPnlpChgVarsBoundsDive(SCIP_NLP *nlp, SCIP_SET *set, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: nlp.c:6311
SCIP_RETCODE SCIPnlpSetInitialGuess(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_Real *initguess)
Definition: nlp.c:5709
#define SCIP_Real
Definition: def.h:164
SCIP_Bool SCIPnlpHasSolution(SCIP_NLP *nlp)
Definition: nlp.c:6019
SCIP_RETCODE SCIPnlrowChgLinearCoef(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real coef)
Definition: nlp.c:2487
SCIP_RETCODE SCIPnlpSetIntPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, int ival)
Definition: nlp.c:6046
SCIP_NLPSOLSTAT SCIPnlpGetSolstat(SCIP_NLP *nlp)
Definition: nlp.c:5982
SCIP_RETCODE SCIPnlpGetStatistics(SCIP_NLP *nlp, SCIP_NLPSTATISTICS *statistics)
Definition: nlp.c:6002
SCIP_RETCODE SCIPnlpSolve(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat)
Definition: nlp.c:5563
SCIP_RETCODE SCIPnlrowRemoveFixedVars(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp)
Definition: nlp.c:2833
type definitions for collecting primal CIP solutions and primal informations
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPnlrowEnsureLinearSize(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:2381
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:427
SCIP_RETCODE SCIPnlpGetFracVars(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR ***fracvars, SCIP_Real **fracvarssol, SCIP_Real **fracvarsfrac, int *nfracvars, int *npriofracvars)
Definition: nlp.c:5629
SCIP_RETCODE SCIPnlrowChgExprtree(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_EXPRTREE *exprtree)
Definition: nlp.c:2689
SCIP_RETCODE SCIPnlpGetPseudoObjval(SCIP_NLP *nlp, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *pseudoobjval)
Definition: nlp.c:5600
SCIP_RETCODE SCIPnlrowGetNLPActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *activity)
Definition: nlp.c:2926
SCIP_Bool SCIPnlpHasCurrentNodeNLP(SCIP_NLP *nlp)
Definition: nlp.c:5286
SCIP_RETCODE SCIPnlpAddNlRows(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, int nnlrows, SCIP_NLROW **nlrows)
Definition: nlp.c:5467
SCIP_RETCODE SCIPnlrowGetSolActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *activity)
Definition: nlp.c:3074
SCIP_RETCODE SCIPnlpAddNlRow(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLROW *nlrow)
Definition: nlp.c:5443
SCIP_VAR ** SCIPnlpGetVars(SCIP_NLP *nlp)
Definition: nlp.c:5793
memory allocation routines