Scippy

SCIP

Solving Constraint Integer Programs

scip.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 scip.c
17  * @brief SCIP callable library
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  * @author Stefan Heinz
22  * @author Gregor Hendel
23  * @author Thorsten Koch
24  * @author Alexander Martin
25  * @author Marc Pfetsch
26  * @author Michael Winkler
27  * @author Kati Wolter
28  *
29  * @todo check all checkStage() calls, use bit flags instead of the SCIP_Bool parameters
30  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include <ctype.h>
36 #include <stdarg.h>
37 #include <assert.h>
38 #include <string.h>
39 
40 #ifdef WITH_ZLIB
41 #include <zlib.h>
42 #endif
43 
44 #include "scip/def.h"
45 #include "scip/retcode.h"
46 #include "scip/set.h"
47 #include "scip/paramset.h"
48 #include "scip/stat.h"
49 #include "scip/clock.h"
50 #include "scip/visual.h"
51 #include "scip/interrupt.h"
52 #include "scip/mem.h"
53 #include "scip/misc.h"
54 #include "scip/history.h"
55 #include "scip/event.h"
56 #include "scip/lp.h"
57 #include "scip/nlp.h"
58 #include "scip/var.h"
59 #include "scip/implics.h"
60 #include "scip/prob.h"
61 #include "scip/sol.h"
62 #include "scip/primal.h"
63 #include "scip/reopt.h"
64 #include "scip/tree.h"
65 #include "scip/pricestore.h"
66 #include "scip/sepastore.h"
67 #include "scip/cutpool.h"
68 #include "scip/solve.h"
69 #include "scip/scipgithash.h"
70 #include "scip/scip.h"
71 #include "lpi/lpi.h"
72 
73 #include "scip/branch.h"
74 #include "scip/conflict.h"
75 #include "scip/cons.h"
76 #include "scip/dialog.h"
77 #include "scip/disp.h"
78 #include "scip/heur.h"
79 #include "scip/compr.h"
80 #include "scip/nodesel.h"
81 #include "scip/reader.h"
82 #include "scip/presol.h"
83 #include "scip/pricer.h"
84 #include "scip/relax.h"
85 #include "scip/sepa.h"
86 #include "scip/prop.h"
87 #include "nlpi/nlpi.h"
88 #include "nlpi/exprinterpret.h"
89 #include "scip/debug.h"
90 #include "scip/dialog_default.h"
91 #include "scip/message_default.h"
92 
93 /* We include the linear constraint handler to be able to copy a (multi)aggregation of variables (to a linear constraint).
94  * The better way would be to handle the distinction between original and transformed variables via a flag 'isoriginal'
95  * in the variable data structure. This would allow to have (multi)aggregated variables in the original problem.
96  *
97  * A second reason for including the linear constraint handler is for copying cuts to linear constraints.
98  */
99 #include "scip/cons_linear.h"
100 
101 /* We need to include the branching and the heurtistics for reoptimization after creating the reoptimization because we
102  * do not want to use these plugins by default if reoptimization is disabled. */
103 #include "scip/branch_nodereopt.h"
104 #include "scip/heur_reoptsols.h"
106 #include "scip/heur_ofins.h"
107 
108 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
109  * this structure except the interface methods in scip.c.
110  * In optimized mode, the structure is included in scip.h, because some of the methods
111  * are implemented as defines for performance reasons (e.g. the numerical comparisons)
112  */
113 #ifndef NDEBUG
114 #include "scip/struct_scip.h"
115 #endif
116 
117 /*
118  * Local methods
119  */
120 
121 
122 /** checks, if SCIP is in one of the feasible stages */
123 #ifndef NDEBUG
124 static
126  SCIP* scip, /**< SCIP data structure */
127  const char* method, /**< method that was called */
128  SCIP_Bool init, /**< may method be called in the INIT stage? */
129  SCIP_Bool problem, /**< may method be called in the PROBLEM stage? */
130  SCIP_Bool transforming, /**< may method be called in the TRANSFORMING stage? */
131  SCIP_Bool transformed, /**< may method be called in the TRANSFORMED stage? */
132  SCIP_Bool initpresolve, /**< may method be called in the INITPRESOLVE stage? */
133  SCIP_Bool presolving, /**< may method be called in the PRESOLVING stage? */
134  SCIP_Bool exitpresolve, /**< may method be called in the EXITPRESOLE stage? */
135  SCIP_Bool presolved, /**< may method be called in the PRESOLVED stage? */
136  SCIP_Bool initsolve, /**< may method be called in the INITSOLVE stage? */
137  SCIP_Bool solving, /**< may method be called in the SOLVING stage? */
138  SCIP_Bool solved, /**< may method be called in the SOLVED stage? */
139  SCIP_Bool exitsolve, /**< may method be called in the EXITSOLVE stage? */
140  SCIP_Bool freetrans, /**< may method be called in the FREETRANS stage? */
141  SCIP_Bool freescip /**< may method be called in the FREE stage? */
142  )
143 {
144  assert(scip != NULL);
145  assert(method != NULL);
146 
147  /*SCIPdebugMessage("called method <%s> at stage %d ------------------------------------------------\n",
148  method, scip->set->stage);*/
149 
150  assert(scip->mem != NULL);
151  assert(scip->set != NULL);
152  assert(scip->interrupt != NULL);
153  assert(scip->dialoghdlr != NULL);
154  assert(scip->totaltime != NULL);
155 
156  switch( scip->set->stage )
157  {
158  case SCIP_STAGE_INIT:
159  assert(scip->stat == NULL);
160  assert(scip->origprob == NULL);
161  assert(scip->eventfilter == NULL);
162  assert(scip->eventqueue == NULL);
163  assert(scip->branchcand == NULL);
164  assert(scip->lp == NULL);
165  assert(scip->nlp == NULL);
166  assert(scip->primal == NULL);
167  assert(scip->tree == NULL);
168  assert(scip->conflict == NULL);
169  assert(scip->transprob == NULL);
170  assert(scip->pricestore == NULL);
171  assert(scip->sepastore == NULL);
172  assert(scip->cutpool == NULL);
173  assert(scip->delayedcutpool == NULL);
174 
175  if( !init )
176  {
177  SCIPerrorMessage("cannot call method <%s> in initialization stage\n", method);
178  return SCIP_INVALIDCALL;
179  }
180  return SCIP_OKAY;
181 
182  case SCIP_STAGE_PROBLEM:
183  assert(scip->stat != NULL);
184  assert(scip->origprob != NULL);
185  assert(scip->eventfilter == NULL);
186  assert(scip->eventqueue == NULL);
187  assert(scip->branchcand == NULL);
188  assert(scip->lp == NULL);
189  assert(scip->nlp == NULL);
190  assert(scip->primal == NULL);
191  assert(scip->tree == NULL);
192  assert(scip->conflict == NULL);
193  assert(scip->transprob == NULL);
194  assert(scip->pricestore == NULL);
195  assert(scip->sepastore == NULL);
196  assert(scip->cutpool == NULL);
197  assert(scip->delayedcutpool == NULL);
198 
199  if( !problem )
200  {
201  SCIPerrorMessage("cannot call method <%s> in problem creation stage\n", method);
202  return SCIP_INVALIDCALL;
203  }
204  return SCIP_OKAY;
205 
207  assert(scip->stat != NULL);
208  assert(scip->origprob != NULL);
209  assert(scip->eventfilter != NULL);
210  assert(scip->eventqueue != NULL);
211  assert(scip->branchcand != NULL);
212  assert(scip->lp != NULL);
213  assert(scip->primal != NULL);
214  assert(scip->tree != NULL);
215  assert(scip->conflict != NULL);
216  assert(scip->transprob != NULL);
217  assert(scip->pricestore == NULL);
218  assert(scip->sepastore == NULL);
219  assert(scip->cutpool == NULL);
220  assert(scip->delayedcutpool == NULL);
221 
222  if( !transforming )
223  {
224  SCIPerrorMessage("cannot call method <%s> in problem transformation stage\n", method);
225  return SCIP_INVALIDCALL;
226  }
227  return SCIP_OKAY;
228 
230  assert(scip->stat != NULL);
231  assert(scip->origprob != NULL);
232  assert(scip->eventfilter != NULL);
233  assert(scip->eventqueue != NULL);
234  assert(scip->branchcand != NULL);
235  assert(scip->lp != NULL);
236  assert(scip->primal != NULL);
237  assert(scip->tree != NULL);
238  assert(scip->conflict != NULL);
239  assert(scip->transprob != NULL);
240  assert(scip->pricestore == NULL);
241  assert(scip->sepastore == NULL);
242  assert(scip->cutpool == NULL);
243  assert(scip->delayedcutpool == NULL);
244 
245  if( !transformed )
246  {
247  SCIPerrorMessage("cannot call method <%s> in problem transformed stage\n", method);
248  return SCIP_INVALIDCALL;
249  }
250  return SCIP_OKAY;
251 
253  assert(scip->stat != NULL);
254  assert(scip->origprob != NULL);
255  assert(scip->eventfilter != NULL);
256  assert(scip->eventqueue != NULL);
257  assert(scip->branchcand != NULL);
258  assert(scip->lp != NULL);
259  assert(scip->primal != NULL);
260  assert(scip->tree != NULL);
261  assert(scip->conflict != NULL);
262  assert(scip->transprob != NULL);
263  assert(scip->pricestore == NULL);
264  assert(scip->sepastore == NULL);
265  assert(scip->cutpool == NULL);
266  assert(scip->delayedcutpool == NULL);
267 
268  if( !initpresolve )
269  {
270  SCIPerrorMessage("cannot call method <%s> in init presolving stage\n", method);
271  return SCIP_INVALIDCALL;
272  }
273  return SCIP_OKAY;
274 
276  assert(scip->stat != NULL);
277  assert(scip->origprob != NULL);
278  assert(scip->eventfilter != NULL);
279  assert(scip->eventqueue != NULL);
280  assert(scip->branchcand != NULL);
281  assert(scip->lp != NULL);
282  assert(scip->primal != NULL);
283  assert(scip->tree != NULL);
284  assert(scip->conflict != NULL);
285  assert(scip->transprob != NULL);
286  assert(scip->pricestore == NULL);
287  assert(scip->sepastore == NULL);
288  assert(scip->cutpool == NULL);
289  assert(scip->delayedcutpool == NULL);
290 
291  if( !presolving )
292  {
293  SCIPerrorMessage("cannot call method <%s> in presolving stage\n", method);
294  return SCIP_INVALIDCALL;
295  }
296  return SCIP_OKAY;
297 
299  assert(scip->stat != NULL);
300  assert(scip->origprob != NULL);
301  assert(scip->eventfilter != NULL);
302  assert(scip->eventqueue != NULL);
303  assert(scip->branchcand != NULL);
304  assert(scip->lp != NULL);
305  assert(scip->primal != NULL);
306  assert(scip->tree != NULL);
307  assert(scip->conflict != NULL);
308  assert(scip->transprob != NULL);
309  assert(scip->pricestore == NULL);
310  assert(scip->sepastore == NULL);
311  assert(scip->cutpool == NULL);
312  assert(scip->delayedcutpool == NULL);
313 
314  if( !exitpresolve )
315  {
316  SCIPerrorMessage("cannot call method <%s> in exit presolving stage\n", method);
317  return SCIP_INVALIDCALL;
318  }
319  return SCIP_OKAY;
320 
322  assert(scip->stat != NULL);
323  assert(scip->origprob != NULL);
324  assert(scip->eventfilter != NULL);
325  assert(scip->eventqueue != NULL);
326  assert(scip->branchcand != NULL);
327  assert(scip->lp != NULL);
328  assert(scip->primal != NULL);
329  assert(scip->tree != NULL);
330  assert(scip->conflict != NULL);
331  assert(scip->transprob != NULL);
332  assert(scip->pricestore == NULL);
333  assert(scip->sepastore == NULL);
334  assert(scip->cutpool == NULL);
335  assert(scip->delayedcutpool == NULL);
336 
337  if( !presolved )
338  {
339  SCIPerrorMessage("cannot call method <%s> in problem presolved stage\n", method);
340  return SCIP_INVALIDCALL;
341  }
342  return SCIP_OKAY;
343 
345  assert(scip->stat != NULL);
346  assert(scip->origprob != NULL);
347  assert(scip->eventfilter != NULL);
348  assert(scip->eventqueue != NULL);
349  assert(scip->branchcand != NULL);
350  assert(scip->lp != NULL);
351  assert(scip->primal != NULL);
352  assert(scip->tree != NULL);
353  assert(scip->transprob != NULL);
354 
355  if( !initsolve )
356  {
357  SCIPerrorMessage("cannot call method <%s> in init solve stage\n", method);
358  return SCIP_INVALIDCALL;
359  }
360  return SCIP_OKAY;
361 
362  case SCIP_STAGE_SOLVING:
363  assert(scip->stat != NULL);
364  assert(scip->origprob != NULL);
365  assert(scip->eventfilter != NULL);
366  assert(scip->eventqueue != NULL);
367  assert(scip->branchcand != NULL);
368  assert(scip->lp != NULL);
369  assert(scip->primal != NULL);
370  assert(scip->tree != NULL);
371  assert(scip->conflict != NULL);
372  assert(scip->transprob != NULL);
373  assert(scip->pricestore != NULL);
374  assert(scip->sepastore != NULL);
375  assert(scip->cutpool != NULL);
376  assert(scip->delayedcutpool != NULL);
377 
378  if( !solving )
379  {
380  SCIPerrorMessage("cannot call method <%s> in solving stage\n", method);
381  return SCIP_INVALIDCALL;
382  }
383  return SCIP_OKAY;
384 
385  case SCIP_STAGE_SOLVED:
386  assert(scip->stat != NULL);
387  assert(scip->origprob != NULL);
388  assert(scip->eventfilter != NULL);
389  assert(scip->eventqueue != NULL);
390  assert(scip->branchcand != NULL);
391  assert(scip->lp != NULL);
392  assert(scip->primal != NULL);
393  assert(scip->tree != NULL);
394  assert(scip->conflict != NULL);
395  assert(scip->transprob != NULL);
396  assert(scip->pricestore != NULL);
397  assert(scip->sepastore != NULL);
398  assert(scip->cutpool != NULL);
399  assert(scip->delayedcutpool != NULL);
400 
401  if( !solved )
402  {
403  SCIPerrorMessage("cannot call method <%s> in problem solved stage\n", method);
404  return SCIP_INVALIDCALL;
405  }
406  return SCIP_OKAY;
407 
409  assert(scip->stat != NULL);
410  assert(scip->origprob != NULL);
411  assert(scip->eventfilter != NULL);
412  assert(scip->eventqueue != NULL);
413  assert(scip->branchcand != NULL);
414  assert(scip->lp != NULL);
415  assert(scip->primal != NULL);
416  assert(scip->tree != NULL);
417  assert(scip->transprob != NULL);
418 
419  if( !exitsolve )
420  {
421  SCIPerrorMessage("cannot call method <%s> in solve deinitialization stage\n", method);
422  return SCIP_INVALIDCALL;
423  }
424  return SCIP_OKAY;
425 
427  assert(scip->stat != NULL);
428  assert(scip->origprob != NULL);
429  assert(scip->pricestore == NULL);
430  assert(scip->sepastore == NULL);
431  assert(scip->cutpool == NULL);
432  assert(scip->delayedcutpool == NULL);
433 
434  if( !freetrans )
435  {
436  SCIPerrorMessage("cannot call method <%s> in free transformed problem stage\n", method);
437  return SCIP_INVALIDCALL;
438  }
439  return SCIP_OKAY;
440 
441  case SCIP_STAGE_FREE:
442  if( !freescip )
443  {
444  SCIPerrorMessage("cannot call method <%s> in free stage\n", method);
445  return SCIP_INVALIDCALL;
446  }
447  return SCIP_OKAY;
448 
449  default:
450  /* note that this is in an internal SCIP error since all SCIP stages are covert in the switch above */
451  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
452  return SCIP_ERROR;
453  }
454 }
455 #else
456 #define checkStage(scip,method,init,problem,transforming,transformed,initpresolve,presolving,exitpresolve,presolved, \
457  initsolve,solving,solved,exitsolve,freetrans,freescip) SCIP_OKAY
458 #endif
459 
460 /** gets global lower (dual) bound in transformed problem */
461 static
463  SCIP* scip /**< SCIP data structure */
464  )
465 {
466  if( scip->set->stage <= SCIP_STAGE_INITSOLVE )
467  return -SCIPinfinity(scip);
468 
469  return SCIPtreeGetLowerbound(scip->tree, scip->set);
470 }
471 
472 /** gets global upper (primal) bound in transformed problem (objective value of best solution or user objective limit) */
473 static
475  SCIP* scip /**< SCIP data structure */
476  )
477 {
478  if( SCIPgetStatus(scip) == SCIP_STATUS_UNBOUNDED )
479  return -SCIPinfinity(scip);
480  else
481  return scip->primal->upperbound;
482 }
483 
484 
485 /** gets global primal bound (objective value of best solution or user objective limit) */
486 static
488  SCIP* scip /**< SCIP data structure */
489  )
490 {
491  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, getUpperbound(scip));
492 }
493 
494 /** gets global dual bound */
495 static
497  SCIP* scip /**< SCIP data structure */
498  )
499 {
500  SCIP_Real lowerbound;
501 
502  if( scip->set->stage <= SCIP_STAGE_INITSOLVE )
503  {
504  /* in case we are in presolving we use the stored dual bound if it exits, otherwise, minus or plus infinity
505  * depending on the objective sense
506  */
507  if( scip->transprob->dualbound < SCIP_INVALID )
508  lowerbound = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
509  else
510  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, -SCIPinfinity(scip));
511  }
512  else
513  lowerbound = SCIPtreeGetLowerbound(scip->tree, scip->set);
514 
515 
516  if( SCIPsetIsInfinity(scip->set, lowerbound) )
517  {
518  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with
519  * dual bound = -inf instead of dual bound = primal bound = +inf
520  * also in case we prove that the problem is unbounded, it seems to make sense to return with dual bound = -inf,
521  * since -infinity is the only valid lower bound
522  */
524  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, -SCIPinfinity(scip));
525  else
526  return getPrimalbound(scip);
527  }
528  else
529  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, lowerbound);
530 }
531 
532 /*
533  * miscellaneous methods
534  */
535 
536 /** returns complete SCIP version number in the format "major . minor tech"
537  *
538  * @return complete SCIP version
539  */
541  void
542  )
543 {
544  return (SCIP_Real)(SCIP_VERSION)/100.0;
545 }
546 
547 /** returns SCIP major version
548  *
549  * @return major SCIP version
550  */
552  void
553  )
554 {
555  return SCIP_VERSION/100;
556 }
557 
558 /** returns SCIP minor version
559  *
560  * @return minor SCIP version
561  */
563  void
564  )
565 {
566  return (SCIP_VERSION/10) % 10;
567 }
568 
569 /** returns SCIP technical version
570  *
571  * @return technical SCIP version
572  */
574  void
575  )
576 {
577  return SCIP_VERSION % 10; /*lint !e778*/
578 }
579 
580 /** returns SCIP sub version number
581  *
582  * @return subversion SCIP version
583  */
585  void
586  )
587 {
588  return SCIP_SUBVERSION;
589 }
590 
591 /** prints a version information line to a file stream via the message handler system
592  *
593  * @note If the message handler is set to a NULL pointer nothing will be printed
594  */
596  SCIP* scip, /**< SCIP data structure */
597  FILE* file /**< output file (or NULL for standard output) */
598  )
599 {
600  assert( scip != NULL );
601 
602  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP version %d.%d.%d",
604 #if SCIP_SUBVERSION > 0
605  SCIPmessageFPrintInfo(scip->messagehdlr, file, ".%d", SCIPsubversion());
606 #endif
607 
608  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [precision: %d byte]", (int)sizeof(SCIP_Real));
609 
610 #ifndef BMS_NOBLOCKMEM
611  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [memory: block]");
612 #else
613  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [memory: standard]");
614 #endif
615 #ifndef NDEBUG
616  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [mode: debug]");
617 #else
618  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [mode: optimized]");
619 #endif
620  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [LP solver: %s]", SCIPlpiGetSolverName());
621  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [GitHash: %s]", SCIPgetGitHash());
622  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
623  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%s\n", SCIP_COPYRIGHT);
624 }
625 
626 /** prints error message for the given SCIP_RETCODE via the error prints method */
628  SCIP_RETCODE retcode /**< SCIP return code causing the error */
629  )
630 {
631  SCIPmessagePrintError("SCIP Error (%d): ", retcode);
632  SCIPretcodePrintError(retcode);
633  SCIPmessagePrintError("\n");
634 }
635 
636 /** update statistical information when a new solution was found */
638  SCIP* scip /**< SCIP data structure */
639  )
640 {
641  SCIP_Real primalbound;
642  SCIP_Real dualbound;
643 
644  primalbound = getPrimalbound(scip);
645  dualbound = getDualbound(scip);
646 
647  if( SCIPsetIsEQ(scip->set, primalbound, dualbound) )
648  scip->stat->lastsolgap = 0.0;
649 
650  else if( SCIPsetIsZero(scip->set, dualbound)
651  || SCIPsetIsZero(scip->set, primalbound)
652  || SCIPsetIsInfinity(scip->set, REALABS(primalbound))
653  || SCIPsetIsInfinity(scip->set, REALABS(dualbound))
654  || primalbound * dualbound < 0.0 )
655  {
656  scip->stat->lastsolgap = SCIPsetInfinity(scip->set);
657  }
658  else
659  {
660  SCIP_Real absdual = REALABS(dualbound);
661  SCIP_Real absprimal = REALABS(primalbound);
662 
663  scip->stat->lastsolgap = REALABS((primalbound - dualbound)/MIN(absdual, absprimal));
664  }
665 
666  if( scip->primal->nsols == 1 )
667  scip->stat->firstsolgap = scip->stat->lastsolgap;
668 
669  if( scip->set->stage == SCIP_STAGE_SOLVING && scip->set->misc_calcintegral )
670  {
672  }
673 }
674 
675 /*
676  * general SCIP methods
677  */
678 
679 /** creates and initializes SCIP data structures
680  *
681  * @note The SCIP default message handler is installed. Use the method SCIPsetMessagehdlr() to install your own
682  * message handler or SCIPsetMessagehdlrLogfile() and SCIPsetMessagehdlrQuiet() to write into a log
683  * file and turn off/on the display output, respectively.
684  *
685  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
686  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
687  *
688  * @post After calling this method \SCIP reached the solving stage \ref SCIP_STAGE_INIT
689  *
690  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
691  */
693  SCIP** scip /**< pointer to SCIP data structure */
694  )
695 {
696  assert(scip != NULL);
697 
698  SCIP_ALLOC( BMSallocMemory(scip) );
699 
700  /* create a default message handler */
701  SCIP_CALL( SCIPcreateMessagehdlrDefault(&(*scip)->messagehdlr, TRUE, NULL, FALSE) );
702 
703  SCIP_CALL( SCIPmemCreate(&(*scip)->mem) );
704  SCIP_CALL( SCIPsetCreate(&(*scip)->set, (*scip)->messagehdlr, (*scip)->mem->setmem, *scip) );
705  SCIP_CALL( SCIPinterruptCreate(&(*scip)->interrupt) );
706  SCIP_CALL( SCIPdialoghdlrCreate((*scip)->set, &(*scip)->dialoghdlr) );
707  SCIP_CALL( SCIPclockCreate(&(*scip)->totaltime, SCIP_CLOCKTYPE_DEFAULT) );
708  SCIPclockStart((*scip)->totaltime, (*scip)->set);
709  (*scip)->stat = NULL;
710  (*scip)->origprob = NULL;
711  (*scip)->origprimal = NULL;
712  (*scip)->eventfilter = NULL;
713  (*scip)->eventqueue = NULL;
714  (*scip)->branchcand = NULL;
715  (*scip)->lp = NULL;
716  (*scip)->nlp = NULL;
717  (*scip)->primal = NULL;
718  (*scip)->tree = NULL;
719  (*scip)->conflict = NULL;
720  (*scip)->transprob = NULL;
721  (*scip)->pricestore = NULL;
722  (*scip)->sepastore = NULL;
723  (*scip)->cutpool = NULL;
724  (*scip)->delayedcutpool = NULL;
725  (*scip)->reopt = NULL;
726 
727  SCIP_CALL( SCIPnlpInclude((*scip)->set, SCIPblkmem(*scip)) );
728 
729  if( strcmp(SCIPlpiGetSolverName(), "NONE") != 0 )
730  {
732  }
733  if( strcmp(SCIPexprintGetName(), "NONE") != 0 )
734  {
736  }
737 
738 #ifdef WITH_ZLIB
739  SCIP_CALL( SCIPsetIncludeExternalCode((*scip)->set, "ZLIB " ZLIB_VERSION, "General purpose compression library by J. Gailly and M. Adler (zlib.net)") );
740 #endif
741 
742  return SCIP_OKAY;
743 }
744 
745 /** frees SCIP data structures
746  *
747  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
748  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
749  *
750  * @pre This method can be called if @p scip is in one of the following stages:
751  * - \ref SCIP_STAGE_INIT
752  * - \ref SCIP_STAGE_PROBLEM
753  * - \ref SCIP_STAGE_TRANSFORMED
754  * - \ref SCIP_STAGE_INITPRESOLVE
755  * - \ref SCIP_STAGE_PRESOLVING
756  * - \ref SCIP_STAGE_PRESOLVED
757  * - \ref SCIP_STAGE_EXITPRESOLVE
758  * - \ref SCIP_STAGE_SOLVING
759  * - \ref SCIP_STAGE_SOLVED
760  * - \ref SCIP_STAGE_FREE
761  *
762  * @post After calling this method \SCIP reached the solving stage \ref SCIP_STAGE_FREE
763  *
764  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
765  */
767  SCIP** scip /**< pointer to SCIP data structure */
768  )
769 {
770  assert(scip != NULL);
771  assert(*scip != NULL);
772 
773  SCIP_CALL( checkStage(*scip, "SCIPfree", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
774 
775  SCIP_CALL( SCIPfreeProb(*scip) );
776  assert((*scip)->set->stage == SCIP_STAGE_INIT);
777 
778  /* switch stage to FREE */
779  (*scip)->set->stage = SCIP_STAGE_FREE;
780 
781  SCIP_CALL( SCIPsetFree(&(*scip)->set, (*scip)->mem->setmem) );
782  SCIP_CALL( SCIPdialoghdlrFree(*scip, &(*scip)->dialoghdlr) );
783  SCIPclockFree(&(*scip)->totaltime);
784  SCIPinterruptFree(&(*scip)->interrupt);
785  SCIP_CALL( SCIPmemFree(&(*scip)->mem) );
786 
787  /* release message handler */
788  SCIP_CALL( SCIPmessagehdlrRelease(&(*scip)->messagehdlr) );
789 
790  BMSfreeMemory(scip);
791 
792  return SCIP_OKAY;
793 }
794 
795 /** returns current stage of SCIP
796  *
797  * @return the current SCIP stage
798  *
799  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
800  */
802  SCIP* scip /**< SCIP data structure */
803  )
804 {
805  assert(scip != NULL);
806  assert(scip->set != NULL);
807 
808  return scip->set->stage;
809 }
810 
811 /** outputs SCIP stage and solution status if applicable via the message handler
812  *
813  * @note If the message handler is set to a NULL pointer nothing will be printed
814  *
815  * @note If limits have been changed between the solution and the call to this function, the status is recomputed and
816  * thus may to correspond to the original status.
817  *
818  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
819  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
820  *
821  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
822  */
824  SCIP* scip, /**< SCIP data structure */
825  FILE* file /**< output file (or NULL for standard output) */
826  )
827 {
828  SCIP_CALL( checkStage(scip, "SCIPprintStage", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
829 
830  switch( scip->set->stage )
831  {
832  case SCIP_STAGE_INIT:
833  SCIPmessageFPrintInfo(scip->messagehdlr, file, "initialization");
834  break;
835  case SCIP_STAGE_PROBLEM:
836  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem creation / modification");
837  break;
839  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem transformation");
840  break;
842  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem transformed");
843  break;
845  SCIPmessageFPrintInfo(scip->messagehdlr, file, "presolving is being initialized");
846  break;
848  if( SCIPsolveIsStopped(scip->set, scip->stat, TRUE) )
849  {
850  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving was interrupted [");
851  SCIP_CALL( SCIPprintStatus(scip, file) );
852  SCIPmessageFPrintInfo(scip->messagehdlr, file, "]");
853  }
854  else
855  SCIPmessageFPrintInfo(scip->messagehdlr, file, "presolving process is running");
856  break;
858  SCIPmessageFPrintInfo(scip->messagehdlr, file, "presolving is being exited");
859  break;
861  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem is presolved");
862  break;
864  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving process initialization");
865  break;
866  case SCIP_STAGE_SOLVING:
867  if( SCIPsolveIsStopped(scip->set, scip->stat, TRUE) )
868  {
869  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving was interrupted [");
870  SCIP_CALL( SCIPprintStatus(scip, file) );
871  SCIPmessageFPrintInfo(scip->messagehdlr, file, "]");
872  }
873  else
874  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving process is running");
875  break;
876  case SCIP_STAGE_SOLVED:
877  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem is solved [");
878  SCIP_CALL( SCIPprintStatus(scip, file) );
879  SCIPmessageFPrintInfo(scip->messagehdlr, file, "]");
880 
881  if( scip->primal->nlimsolsfound == 0 && !SCIPisInfinity(scip, getPrimalbound(scip)) )
882  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (objective limit reached)");
883 
884  break;
886  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving process deinitialization");
887  break;
889  SCIPmessageFPrintInfo(scip->messagehdlr, file, "freeing transformed problem");
890  break;
891  case SCIP_STAGE_FREE:
892  SCIPmessageFPrintInfo(scip->messagehdlr, file, "freeing SCIP");
893  break;
894  default:
895  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
896  return SCIP_INVALIDDATA;
897  }
898 
899  return SCIP_OKAY;
900 }
901 
902 /** gets solution status
903  *
904  * @return SCIP solution status
905  *
906  * See \ref SCIP_Status "SCIP_STATUS" for a complete list of all possible solving status.
907  */
909  SCIP* scip /**< SCIP data structure */
910  )
911 {
912  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetStatus", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
913 
914  if( scip->set->stage == SCIP_STAGE_INIT || scip->set->stage == SCIP_STAGE_FREE )
915  return SCIP_STATUS_UNKNOWN;
916  else
917  {
918  assert(scip->stat != NULL);
919 
920  return scip->stat->status;
921  }
922 }
923 
924 /** outputs solution status
925  *
926  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
927  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
928  *
929  * See \ref SCIP_Status "SCIP_STATUS" for a complete list of all possible solving status.
930  */
932  SCIP* scip, /**< SCIP data structure */
933  FILE* file /**< output file (or NULL for standard output) */
934  )
935 {
936  SCIP_CALL( checkStage(scip, "SCIPprintStatus", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
937 
938  switch( SCIPgetStatus(scip) )
939  {
940  case SCIP_STATUS_UNKNOWN:
941  SCIPmessageFPrintInfo(scip->messagehdlr, file, "unknown");
942  break;
944  SCIPmessageFPrintInfo(scip->messagehdlr, file, "user interrupt");
945  break;
947  SCIPmessageFPrintInfo(scip->messagehdlr, file, "node limit reached");
948  break;
950  SCIPmessageFPrintInfo(scip->messagehdlr, file, "total node limit reached");
951  break;
953  SCIPmessageFPrintInfo(scip->messagehdlr, file, "stall node limit reached");
954  break;
956  SCIPmessageFPrintInfo(scip->messagehdlr, file, "time limit reached");
957  break;
959  SCIPmessageFPrintInfo(scip->messagehdlr, file, "memory limit reached");
960  break;
962  SCIPmessageFPrintInfo(scip->messagehdlr, file, "gap limit reached");
963  break;
965  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solution limit reached");
966  break;
968  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solution improvement limit reached");
969  break;
971  SCIPmessageFPrintInfo(scip->messagehdlr, file, "restart limit reached");
972  break;
973  case SCIP_STATUS_OPTIMAL:
974  SCIPmessageFPrintInfo(scip->messagehdlr, file, "optimal solution found");
975  break;
977  SCIPmessageFPrintInfo(scip->messagehdlr, file, "infeasible");
978  break;
980  SCIPmessageFPrintInfo(scip->messagehdlr, file, "unbounded");
981  break;
983  SCIPmessageFPrintInfo(scip->messagehdlr, file, "infeasible or unbounded");
984  break;
985  default:
986  SCIPerrorMessage("invalid status code <%d>\n", SCIPgetStatus(scip));
987  return SCIP_INVALIDDATA;
988  }
989 
990  return SCIP_OKAY;
991 }
992 
993 /** returns whether the current stage belongs to the transformed problem space
994  *
995  * @return Returns TRUE if the \SCIP instance is transformed, otherwise FALSE
996  */
998  SCIP* scip /**< SCIP data structure */
999  )
1000 {
1001  assert(scip != NULL);
1002 
1003  return ((int)scip->set->stage >= (int)SCIP_STAGE_TRANSFORMING);
1004 }
1005 
1006 /** returns whether the solution process should be probably correct
1007  *
1008  * @note This feature is not supported yet!
1009  *
1010  * @return Returns TRUE if \SCIP is exact solving mode, otherwise FALSE
1011  */
1013  SCIP* scip /**< SCIP data structure */
1014  )
1015 {
1016  assert(scip != NULL);
1017  assert(scip->set != NULL);
1018 
1019  return (scip->set->misc_exactsolve);
1020 }
1021 
1022 /** returns whether the presolving process would be finished given no more presolving reductions are found in this
1023  * presolving round
1024  *
1025  * Checks whether the number of presolving rounds is not exceeded and the presolving reductions found in the current
1026  * presolving round suffice to trigger another presolving round.
1027  *
1028  * @note if subsequent presolvers find more reductions, presolving might continue even if the method returns FALSE
1029  * @note does not check whether infeasibility or unboundedness was already detected in presolving (which would result
1030  * in presolving being stopped although the method returns TRUE)
1031  *
1032  * @return Returns TRUE if presolving is finished if no further reductions are detected
1033  */
1035  SCIP* scip /**< SCIP data structure */
1036  )
1037 {
1038  int maxnrounds;
1039  SCIP_Bool finished;
1040 
1041  assert(scip != NULL);
1042  assert(scip->stat != NULL);
1043  assert(scip->transprob != NULL);
1044 
1045  SCIP_CALL_ABORT( checkStage(scip, "SCIPisPresolveFinished", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
1046 
1047  /* get maximum number of presolving rounds */
1048  maxnrounds = scip->set->presol_maxrounds;
1049  if( maxnrounds == -1 )
1050  maxnrounds = INT_MAX;
1051 
1052  /* don't abort, if enough changes were applied to the variables */
1053  finished = (scip->transprob->nvars == 0
1054  || (scip->stat->npresolfixedvars - scip->stat->lastnpresolfixedvars
1055  + scip->stat->npresolaggrvars - scip->stat->lastnpresolaggrvars
1057  + (scip->stat->npresolchgbds - scip->stat->lastnpresolchgbds)/10.0
1058  + (scip->stat->npresoladdholes - scip->stat->lastnpresoladdholes)/10.0
1059  <= scip->set->presol_abortfac * scip->transprob->nvars)); /*lint !e653*/
1060 
1061  /* don't abort, if enough changes were applied to the constraints */
1062  finished = finished
1063  && (scip->transprob->nconss == 0
1064  || (scip->stat->npresoldelconss - scip->stat->lastnpresoldelconss
1065  + scip->stat->npresoladdconss - scip->stat->lastnpresoladdconss
1067  + scip->stat->npresolchgsides - scip->stat->lastnpresolchgsides
1068  <= scip->set->presol_abortfac * scip->transprob->nconss));
1069 
1070  /* don't abort, if enough changes were applied to the coefficients (assume a 1% density of non-zero elements) */
1071  finished = finished
1072  && (scip->transprob->nvars == 0 || scip->transprob->nconss == 0
1073  || (scip->stat->npresolchgcoefs - scip->stat->lastnpresolchgcoefs
1074  <= scip->set->presol_abortfac * 0.01 * scip->transprob->nvars * scip->transprob->nconss));
1075 
1076 #ifdef SCIP_DISABLED_CODE
1077  /* since 2005, we do not take cliques and implications into account when deciding whether to stop presolving */
1078  /* don't abort, if enough new implications or cliques were found (assume 100 implications per variable) */
1079  finished = finished
1080  && (scip->stat->nimplications - scip->stat->lastnpresolimplications
1081  <= scip->set->presol_abortfac * 100 * scip->transprob->nbinvars)
1082  && (SCIPcliquetableGetNCliques(scip->cliquetable) - scip->stat->lastnpresolcliques
1083  <= scip->set->presol_abortfac * scip->transprob->nbinvars);
1084 #endif
1085 
1086  /* abort if maximal number of presolving rounds is reached */
1087  finished = finished || (scip->stat->npresolrounds + 1 >= maxnrounds);
1088 
1089  return finished;
1090 }
1091 
1092 /** returns whether SCIP has performed presolving during the last solve
1093  *
1094  * @return Returns TRUE if presolving was performed during the last solve
1095  */
1097  SCIP* scip /**< SCIP data structure */
1098  )
1099 {
1100  assert(scip != NULL);
1101  assert(scip->stat != NULL);
1102 
1103  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasPerformedPresolve", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1104 
1105  return scip->stat->performpresol;
1106 }
1107 
1108 /** returns whether the user pressed CTRL-C to interrupt the solving process
1109  *
1110  * @return Returns TRUE if Ctrl-C was pressed, otherwise FALSE.
1111  */
1113  SCIP* scip /**< SCIP data structure */
1114  )
1115 {
1116  return SCIPinterrupted();
1117 }
1118 
1119 /** returns whether the solving process should be / was stopped before proving optimality;
1120  * if the solving process should be / was stopped, the status returned by SCIPgetStatus() yields
1121  * the reason for the premature abort
1122  *
1123  * @return Returns TRUE if solving process is stopped/interrupted, otherwise FALSE.
1124  */
1126  SCIP* scip /**< SCIP data structure */
1127  )
1128 {
1129  SCIP_CALL_ABORT( checkStage(scip, "SCIPisStopped", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1130 
1131  return SCIPsolveIsStopped(scip->set, scip->stat, FALSE);
1132 }
1133 
1134 
1135 /** enable debug solution mechanism
1136  *
1137  * the debug solution mechanism allows to trace back the invalidation of
1138  * a debug solution during the solution process of SCIP. It must be explicitly
1139  * enabled for the SCIP data structure.
1140  *
1141  * @see debug.h for more information on debug solution mechanism
1142  */
1144  SCIP* scip /**< SCIP data structure */
1145  )
1146 {
1147  SCIP_CALL_ABORT( checkStage(scip, "SCIPenableDebugSol", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1148 
1149  SCIPdebugSolEnable(scip);
1150 }
1151 
1152 /** disable solution debugging mechanism
1153  *
1154  * @see debug.h for more information on debug solution mechanism
1155  */
1157  SCIP* scip /**< SCIP data structure */
1158  )
1159 {
1160  SCIP_CALL_ABORT( checkStage(scip, "SCIPdisableDebugSol", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1161 
1162  SCIPdebugSolDisable(scip);
1163 }
1164 
1165 /*
1166  * message output methods
1167  */
1168 
1169 /** installs the given message handler, such that all messages are passed to this handler. A messages handler can be
1170  * created via SCIPmessagehdlrCreate().
1171  *
1172  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1173  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1174  *
1175  * @pre this method can be called in one of the following stages of the SCIP solving process:
1176  * - \ref SCIP_STAGE_INIT
1177  * - \ref SCIP_STAGE_PROBLEM
1178  *
1179  * @note The currently installed messages handler gets freed if this SCIP instance is its last user (w.r.t. capture/release).
1180  */
1182  SCIP* scip, /**< SCIP data structure */
1183  SCIP_MESSAGEHDLR* messagehdlr /**< message handler to install, or NULL to suppress all output */
1184  )
1185 {
1186  int i;
1187 
1188  SCIP_CALL( checkStage(scip, "SCIPsetMessagehdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
1189 
1190  assert(scip != NULL);
1191  assert(scip->set != NULL);
1192  assert(scip->set->nlpis != NULL || scip->set->nnlpis == 0);
1193 
1194  /* update message handler in NLP solver interfaces */
1195  for( i = 0; i < scip->set->nnlpis; ++i )
1196  {
1197  assert(scip->set->nlpis[i] != NULL);
1198 
1199  SCIP_CALL( SCIPnlpiSetMessageHdlr(scip->set->nlpis[i], messagehdlr) );
1200  }
1201 
1202  SCIPmessagehdlrCapture(messagehdlr);
1203 
1205  assert(scip->messagehdlr == NULL);
1206 
1207  scip->messagehdlr = messagehdlr;
1208 
1209  return SCIP_OKAY;
1210 }
1211 
1212 /** returns the currently installed message handler
1213  *
1214  * @return the currently installed message handler, or NULL if messages are currently suppressed
1215  */
1217  SCIP* scip /**< SCIP data structure */
1218  )
1219 {
1220  return scip->messagehdlr;
1221 }
1222 
1223 /** sets the log file name for the currently installed message handler */
1225  SCIP* scip, /**< SCIP data structure */
1226  const char* filename /**< name of log file, or NULL (no log) */
1227  )
1228 {
1229  if( scip->messagehdlr != NULL )
1230  {
1231  SCIPmessagehdlrSetLogfile(scip->messagehdlr, filename);
1232  }
1233 }
1234 
1235 /** sets the currently installed message handler to be quiet (or not) */
1237  SCIP* scip, /**< SCIP data structure */
1238  SCIP_Bool quiet /**< should screen messages be suppressed? */
1239  )
1240 {
1241  if( scip->messagehdlr != NULL )
1242  {
1243  SCIPmessagehdlrSetQuiet(scip->messagehdlr, quiet);
1244  }
1245 }
1246 
1247 /** prints a warning message via the message handler */
1249  SCIP* scip, /**< SCIP data structure */
1250  const char* formatstr, /**< format string like in printf() function */
1251  ... /**< format arguments line in printf() function */
1252  )
1253 {
1254  va_list ap;
1255 
1256  assert(scip != NULL);
1257 
1258  va_start(ap, formatstr); /*lint !e838*/
1259  SCIPmessageVFPrintWarning(scip->messagehdlr, formatstr, ap);
1260  va_end(ap);
1261 }
1262 
1263 /** prints a dialog message that requests user interaction or is a direct response to a user interactive command */
1265  SCIP* scip, /**< SCIP data structure */
1266  FILE* file, /**< file stream to print into, or NULL for stdout */
1267  const char* formatstr, /**< format string like in printf() function */
1268  ... /**< format arguments line in printf() function */
1269  )
1270 {
1271  va_list ap;
1272 
1273  assert(scip != NULL);
1274 
1275  va_start(ap, formatstr); /*lint !e838*/
1276  SCIPmessageVFPrintDialog(scip->messagehdlr, file, formatstr, ap);
1277  va_end(ap);
1278 }
1279 
1280 /** prints a message */
1282  SCIP* scip, /**< SCIP data structure */
1283  FILE* file, /**< file stream to print into, or NULL for stdout */
1284  const char* formatstr, /**< format string like in printf() function */
1285  ... /**< format arguments line in printf() function */
1286  )
1287 {
1288  va_list ap;
1289 
1290  assert(scip != NULL);
1291 
1292  va_start(ap, formatstr); /*lint !e838*/
1293  SCIPmessageVFPrintInfo(scip->messagehdlr, file, formatstr, ap);
1294  va_end(ap);
1295 }
1296 
1297 /** prints a message depending on the verbosity level */
1299  SCIP* scip, /**< SCIP data structure */
1300  SCIP_VERBLEVEL msgverblevel, /**< verbosity level of this message */
1301  FILE* file, /**< file stream to print into, or NULL for stdout */
1302  const char* formatstr, /**< format string like in printf() function */
1303  ... /**< format arguments line in printf() function */
1304  )
1305 {
1306  va_list ap;
1307 
1308  assert(scip != NULL);
1309  assert(scip->set != NULL);
1310 
1311  va_start(ap, formatstr); /*lint !e838*/
1312  SCIPmessageVFPrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, msgverblevel, file, formatstr, ap);
1313  va_end(ap);
1314 }
1315 
1316 /** returns the current message verbosity level
1317  *
1318  * @return message verbosity level of SCIP
1319  *
1320  * @see \ref SCIP_VerbLevel "SCIP_VERBLEVEL" for a list of all verbosity levels
1321  */
1323  SCIP* scip /**< SCIP data structure */
1324  )
1325 {
1326  assert(scip != NULL);
1327  assert(scip->set != NULL);
1328 
1329  return scip->set->disp_verblevel;
1330 }
1331 
1332 
1333 /*
1334  * SCIP copy methods
1335  */
1336 
1337 /** returns true if the @p cut matches the selection criterium for copying */
1338 static
1340  SCIP* scip, /**< SCIP data structure */
1341  SCIP_CUT* cut, /**< a cut */
1342  char cutsel /**< cut selection for sub SCIPs ('a'ge, activity 'q'uotient) */
1343  )
1344 {
1345  SCIP_Bool takecut;
1346 
1347  assert(cut != NULL);
1348 
1349  if( !SCIProwIsInLP(SCIPcutGetRow(cut)) )
1350  return FALSE;
1351 
1352  takecut = FALSE;
1353  switch( cutsel )
1354  {
1355  case 'a':
1356  takecut = (SCIPcutGetAge(cut) == 0);
1357  break;
1358  case 'q':
1359  takecut = (SCIPcutGetLPActivityQuot(cut) >= scip->set->sepa_minactivityquot);
1360  break;
1361  default:
1362  SCIPerrorMessage("unknown cut selection strategy %c, must be either 'a' or 'q'\n");
1363  SCIPABORT();
1364  takecut = FALSE; /*lint !e527*/
1365  break;
1366  }
1367 
1368  return takecut;
1369 }
1370 /** copy active and tight cuts from one SCIP instance to linear constraints of another SCIP instance */
1371 static
1373  SCIP* sourcescip, /**< source SCIP data structure */
1374  SCIP* targetscip, /**< target SCIP data structure */
1375  SCIP_CUT** cuts, /**< cuts to copy */
1376  int ncuts, /**< number of cuts to copy */
1377  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1378  * target variables, or NULL */
1379  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1380  * target constraints, or NULL */
1381  SCIP_Bool global, /**< create a global or a local copy? */
1382  int* ncutsadded /**< pointer to store number of copied cuts */
1383  )
1384 {
1385  int c;
1386 
1387  assert(sourcescip != NULL);
1388  assert(targetscip != NULL);
1389  assert(cuts != NULL || ncuts == 0);
1390  assert(ncutsadded != NULL);
1391 
1392  *ncutsadded = 0;
1393 
1394  for( c = 0; c < ncuts; ++c )
1395  {
1396  SCIP_ROW* row;
1397  SCIP_Bool takecut;
1398 
1399  assert( cuts[c] != NULL ); /*lint !e613*/
1400  row = SCIPcutGetRow(cuts[c]); /*lint !e613*/
1401  assert(!SCIProwIsLocal(row));
1402  assert(!SCIProwIsModifiable(row));
1403 
1404  /* in case of a restart, convert the cuts with a good LP activity quotient; in other cases, e.g., when heuristics
1405  * copy cuts into subscips, take only currently active ones
1406  */
1407  if( sourcescip == targetscip )
1408  {
1409  assert( SCIPisInRestart(sourcescip) );
1410  takecut = takeCut(sourcescip, cuts[c], sourcescip->set->sepa_cutselrestart); /*lint !e613*/
1411  }
1412  else
1413  takecut = takeCut(sourcescip, cuts[c], sourcescip->set->sepa_cutselsubscip); /*lint !e613*/
1414 
1415  /* create a linear constraint out of the cut */
1416  if( takecut )
1417  {
1418  char name[SCIP_MAXSTRLEN];
1419  SCIP_CONS* cons;
1420  SCIP_COL** cols;
1421  SCIP_VAR** vars;
1422  int ncols;
1423  int i;
1424 
1425  cols = SCIProwGetCols(row);
1426  ncols = SCIProwGetNNonz(row);
1427 
1428  /* get all variables of the row */
1429  SCIP_CALL( SCIPallocBufferArray(targetscip, &vars, ncols) );
1430  for( i = 0; i < ncols; ++i )
1431  vars[i] = SCIPcolGetVar(cols[i]);
1432 
1433  /* get corresponding variables in targetscip if necessary */
1434  if( sourcescip != targetscip )
1435  {
1436  SCIP_Bool success;
1437 
1438  for( i = 0; i < ncols; ++i )
1439  {
1440  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, vars[i], &vars[i], varmap, consmap, global, &success) );
1441 
1442  if( !success )
1443  {
1444  SCIPdebugMessage("Converting cuts to constraints failed.\n");
1445 
1446  /* free temporary memory */
1447  SCIPfreeBufferArray(targetscip, &vars);
1448  return SCIP_OKAY;
1449  }
1450  }
1451  }
1452 
1453  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%d", SCIProwGetName(row), SCIPgetNRuns(sourcescip));
1454  SCIP_CALL( SCIPcreateConsLinear(targetscip, &cons, name, ncols, vars, SCIProwGetVals(row),
1457  SCIP_CALL( SCIPaddCons(targetscip, cons) );
1458 
1459  SCIPdebugMessage("Converted cut <%s> to constraint <%s>.\n", SCIProwGetName(row), SCIPconsGetName(cons));
1460  SCIPdebugPrintCons(targetscip, cons, NULL);
1461  SCIP_CALL( SCIPreleaseCons(targetscip, &cons) );
1462 
1463  /* free temporary memory */
1464  SCIPfreeBufferArray(targetscip, &vars);
1465 
1466  ++(*ncutsadded);
1467  }
1468  }
1469 
1470  return SCIP_OKAY;
1471 }
1472 
1473 #define HASHTABLESIZE_FACTOR 5
1474 
1475 /** copies plugins from sourcescip to targetscip; in case that a constraint handler which does not need constraints
1476  * cannot be copied, valid will return FALSE. All plugins can declare that, if their copy process failed, the
1477  * copied SCIP instance might not represent the same problem semantics as the original.
1478  * Note that in this case dual reductions might be invalid.
1479  *
1480  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1481  * Also, 'passmessagehdlr' should be set to FALSE.
1482  * @note Do not change the source SCIP environment during the copying process
1483  *
1484  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1485  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1486  *
1487  * @pre This method can be called if sourcescip is in one of the following stages:
1488  * - \ref SCIP_STAGE_PROBLEM
1489  * - \ref SCIP_STAGE_TRANSFORMED
1490  * - \ref SCIP_STAGE_INITPRESOLVE
1491  * - \ref SCIP_STAGE_PRESOLVING
1492  * - \ref SCIP_STAGE_EXITPRESOLVE
1493  * - \ref SCIP_STAGE_PRESOLVED
1494  * - \ref SCIP_STAGE_INITSOLVE
1495  * - \ref SCIP_STAGE_SOLVING
1496  * - \ref SCIP_STAGE_SOLVED
1497  *
1498  * @pre This method can be called if targetscip is in one of the following stages:
1499  * - \ref SCIP_STAGE_INIT
1500  * - \ref SCIP_STAGE_FREE
1501  *
1502  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
1503  * process was interrupted:
1504  * - \ref SCIP_STAGE_PROBLEM
1505  *
1506  * @note sourcescip stage does not get changed
1507  *
1508  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1509  */
1511  SCIP* sourcescip, /**< source SCIP data structure */
1512  SCIP* targetscip, /**< target SCIP data structure */
1513  SCIP_Bool copyreaders, /**< should the file readers be copied */
1514  SCIP_Bool copypricers, /**< should the variable pricers be copied */
1515  SCIP_Bool copyconshdlrs, /**< should the constraint handlers be copied */
1516  SCIP_Bool copyconflicthdlrs, /**< should the conflict handlers be copied */
1517  SCIP_Bool copypresolvers, /**< should the presolvers be copied */
1518  SCIP_Bool copyrelaxators, /**< should the relaxation handlers be copied */
1519  SCIP_Bool copyseparators, /**< should the separators be copied */
1520  SCIP_Bool copypropagators, /**< should the propagators be copied */
1521  SCIP_Bool copyheuristics, /**< should the heuristics be copied */
1522  SCIP_Bool copyeventhdlrs, /**< should the event handlers be copied */
1523  SCIP_Bool copynodeselectors, /**< should the node selectors be copied */
1524  SCIP_Bool copybranchrules, /**< should the branchrules be copied */
1525  SCIP_Bool copydisplays, /**< should the display columns be copied */
1526  SCIP_Bool copydialogs, /**< should the dialogs be copied */
1527  SCIP_Bool copynlpis, /**< should the NLPIs be copied */
1528  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
1529  SCIP_Bool* valid /**< pointer to store whether plugins, in particular all constraint
1530  * handlers which do not need constraints were validly copied */
1531  )
1532 {
1533  assert(sourcescip != NULL);
1534  assert(targetscip != NULL);
1535  assert(sourcescip->set != NULL);
1536  assert(targetscip->set != NULL);
1537 
1538  /* check stages for both, the source and the target SCIP data structure */
1539  SCIP_CALL( checkStage(sourcescip, "SCIPcopyPlugins", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1540  SCIP_CALL( checkStage(targetscip, "SCIPcopyPlugins", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
1541 
1542  /* passes the message handler of the source SCIP to the target SCIP, also if NULL */
1543  if( passmessagehdlr )
1544  {
1545  SCIP_CALL( SCIPsetMessagehdlr(targetscip, SCIPgetMessagehdlr(sourcescip)) );
1546  }
1547 
1548  SCIP_CALL( SCIPsetCopyPlugins(sourcescip->set, targetscip->set,
1549  copyreaders, copypricers, copyconshdlrs, copyconflicthdlrs, copypresolvers, copyrelaxators, copyseparators, copypropagators,
1550  copyheuristics, copyeventhdlrs, copynodeselectors, copybranchrules, copydisplays, copydialogs, copynlpis, valid) );
1551 
1552  return SCIP_OKAY;
1553 }
1554 
1555 /** create a problem by copying the problem data of the source SCIP */
1556 static
1558  SCIP* sourcescip, /**< source SCIP data structure */
1559  SCIP* targetscip, /**< target SCIP data structure */
1560  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1561  * target variables, or NULL */
1562  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1563  * target constraints, or NULL */
1564  SCIP_Bool original, /**< should the original problem be copied? */
1565  SCIP_Bool global, /**< create a global or a local copy? (set to TRUE for original copy) */
1566  const char* name /**< problem name of target */
1567  )
1568 {
1569  SCIP_PROB* sourceprob;
1570  SCIP_HASHMAP* localvarmap;
1571  SCIP_HASHMAP* localconsmap;
1572  SCIP_Bool uselocalvarmap;
1573  SCIP_Bool uselocalconsmap;
1574 
1575  assert(sourcescip != NULL);
1576  assert(targetscip != NULL);
1577  assert(!original || global);
1578 
1579  /* free old problem */
1580  SCIP_CALL( SCIPfreeProb(targetscip) );
1581  assert(targetscip->set->stage == SCIP_STAGE_INIT);
1582 
1583  uselocalvarmap = (varmap == NULL);
1584  uselocalconsmap = (consmap == NULL);
1585 
1586  if( uselocalvarmap )
1587  {
1588  /* create the variable mapping hash map */
1589  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNVars(sourcescip))) );
1590  }
1591  else
1592  localvarmap = varmap;
1593 
1594  if( uselocalconsmap )
1595  {
1596  /* create the constraint mapping hash map */
1597  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNConss(sourcescip))) );
1598  }
1599  else
1600  localconsmap = consmap;
1601 
1602  /* switch stage to PROBLEM */
1603  targetscip->set->stage = SCIP_STAGE_PROBLEM;
1604 
1605  if( !original && SCIPisTransformed(sourcescip) )
1606  sourceprob = sourcescip->transprob;
1607  else
1608  sourceprob = sourcescip->origprob;
1609 
1610  /* create the statistics data structure */
1611  SCIP_CALL( SCIPstatCreate(&targetscip->stat, targetscip->mem->probmem, targetscip->set, targetscip->messagehdlr) );
1612  targetscip->stat->subscipdepth = sourcescip->stat->subscipdepth + 1;
1613 
1614  /* create the problem by copying the source problem */
1615  SCIP_CALL( SCIPprobCopy(&targetscip->origprob, targetscip->mem->probmem, targetscip->set, name, sourcescip, sourceprob, localvarmap, localconsmap, global) );
1616 
1617  /* creating the solution candidates storage */
1618  /**@todo copy solution of source SCIP as candidates for the target SCIP */
1619  SCIP_CALL( SCIPprimalCreate(&targetscip->origprimal) );
1620 
1621  if( uselocalvarmap )
1622  {
1623  /* free hash map */
1624  SCIPhashmapFree(&localvarmap);
1625  }
1626 
1627  if( uselocalconsmap )
1628  {
1629  /* free hash map */
1630  SCIPhashmapFree(&localconsmap);
1631  }
1632 
1633  return SCIP_OKAY;
1634 }
1635 
1636 
1637 /** create a problem by copying the problem data of the source SCIP
1638  *
1639  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1640  * @note Do not change the source SCIP environment during the copying process
1641  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1642  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1643  *
1644  * @pre This method can be called if sourcescip is in one of the following stages:
1645  * - \ref SCIP_STAGE_PROBLEM
1646  * - \ref SCIP_STAGE_TRANSFORMED
1647  * - \ref SCIP_STAGE_INITPRESOLVE
1648  * - \ref SCIP_STAGE_PRESOLVING
1649  * - \ref SCIP_STAGE_EXITPRESOLVE
1650  * - \ref SCIP_STAGE_PRESOLVED
1651  * - \ref SCIP_STAGE_INITSOLVE
1652  * - \ref SCIP_STAGE_SOLVING
1653  * - \ref SCIP_STAGE_SOLVED
1654  *
1655  * @pre This method can be called if targetscip is in one of the following stages:
1656  * - \ref SCIP_STAGE_INIT
1657  * - \ref SCIP_STAGE_FREE
1658  *
1659  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
1660  * process was interrupted:
1661  * - \ref SCIP_STAGE_PROBLEM
1662  *
1663  * @note sourcescip stage does not get changed
1664  *
1665  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1666  */
1668  SCIP* sourcescip, /**< source SCIP data structure */
1669  SCIP* targetscip, /**< target SCIP data structure */
1670  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1671  * target variables, or NULL */
1672  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1673  * target constraints, or NULL */
1674  SCIP_Bool global, /**< create a global or a local copy? */
1675  const char* name /**< problem name of target */
1676  )
1677 {
1678  assert(sourcescip != NULL);
1679  assert(targetscip != NULL);
1680 
1681  /* check stages for both, the source and the target SCIP data structure */
1682  SCIP_CALL( checkStage(sourcescip, "SCIPcopyProb", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1683  SCIP_CALL( checkStage(targetscip, "SCIPcopyProb", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
1684 
1685  SCIP_CALL( copyProb(sourcescip, targetscip, varmap, consmap, FALSE, global, name) );
1686 
1687  return SCIP_OKAY;
1688 }
1689 
1690 /** create a problem by copying the original problem data of the source SCIP
1691  *
1692  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1693  * @note Do not change the source SCIP environment during the copying process
1694  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1695  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1696  *
1697  * @pre This method can be called if sourcescip is in one of the following stages:
1698  * - \ref SCIP_STAGE_PROBLEM
1699  * - \ref SCIP_STAGE_TRANSFORMED
1700  * - \ref SCIP_STAGE_INITPRESOLVE
1701  * - \ref SCIP_STAGE_PRESOLVING
1702  * - \ref SCIP_STAGE_EXITPRESOLVE
1703  * - \ref SCIP_STAGE_PRESOLVED
1704  * - \ref SCIP_STAGE_INITSOLVE
1705  * - \ref SCIP_STAGE_SOLVING
1706  * - \ref SCIP_STAGE_SOLVED
1707  *
1708  * @pre This method can be called if targetscip is in one of the following stages:
1709  * - \ref SCIP_STAGE_INIT
1710  * - \ref SCIP_STAGE_FREE
1711  *
1712  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
1713  * process was interrupted:
1714  * - \ref SCIP_STAGE_PROBLEM
1715  *
1716  * @note sourcescip stage does not get changed
1717  *
1718  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1719  */
1721  SCIP* sourcescip, /**< source SCIP data structure */
1722  SCIP* targetscip, /**< target SCIP data structure */
1723  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1724  * target variables, or NULL */
1725  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1726  * target constraints, or NULL */
1727  const char* name /**< problem name of target */
1728  )
1729 {
1730  assert(sourcescip != NULL);
1731  assert(targetscip != NULL);
1732 
1733  /* check stages for both, the source and the target SCIP data structure */
1734  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrigProb", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1735  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrigProb", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
1736 
1737  SCIP_CALL( copyProb(sourcescip, targetscip, varmap, consmap, TRUE, TRUE, name) );
1738 
1739  /* set the correct objective sense; necessary if we maximize in the original problem */
1740  SCIP_CALL( SCIPsetObjsense(targetscip, SCIPgetObjsense(sourcescip)) );
1741 
1742  return SCIP_OKAY;
1743 }
1744 
1745 /** returns copy of the source variable; if there already is a copy of the source variable in the variable hash map,
1746  * it is just returned as target variable; otherwise a new variable will be created and added to the target SCIP; this
1747  * created variable is added to the variable hash map and returned as target variable
1748  *
1749  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1750  * @note Do not change the source SCIP environment during the copying process
1751  * @note if a new variable was created, this variable will be added to the target-SCIP, but it is not captured
1752  *
1753  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1754  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1755  *
1756  * @pre This method can be called if sourcescip is in one of the following stages:
1757  * - \ref SCIP_STAGE_PROBLEM
1758  * - \ref SCIP_STAGE_TRANSFORMED
1759  * - \ref SCIP_STAGE_INITPRESOLVE
1760  * - \ref SCIP_STAGE_PRESOLVING
1761  * - \ref SCIP_STAGE_EXITPRESOLVE
1762  * - \ref SCIP_STAGE_PRESOLVED
1763  * - \ref SCIP_STAGE_INITSOLVE
1764  * - \ref SCIP_STAGE_SOLVING
1765  * - \ref SCIP_STAGE_SOLVED
1766  *
1767  * @pre This method can be called if targetscip is in one of the following stages:
1768  * - \ref SCIP_STAGE_PROBLEM
1769  * - \ref SCIP_STAGE_TRANSFORMED
1770  * - \ref SCIP_STAGE_INITPRESOLVE
1771  * - \ref SCIP_STAGE_PRESOLVING
1772  * - \ref SCIP_STAGE_EXITPRESOLVE
1773  * - \ref SCIP_STAGE_SOLVING
1774  *
1775  * @note targetscip stage does not get changed
1776  *
1777  * @note sourcescip stage does not get changed
1778  *
1779  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1780  */
1782  SCIP* sourcescip, /**< source SCIP data structure */
1783  SCIP* targetscip, /**< target SCIP data structure */
1784  SCIP_VAR* sourcevar, /**< source variable */
1785  SCIP_VAR** targetvar, /**< pointer to store the target variable */
1786  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
1787  * target variables, or NULL */
1788  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1789  * target constraints, or NULL */
1790  SCIP_Bool global, /**< should global or local bounds be used? */
1791  SCIP_Bool* success /**< pointer to store whether the copying was successful or not */
1792  )
1793 {
1794  SCIP_HASHMAP* localvarmap;
1795  SCIP_HASHMAP* localconsmap;
1796  SCIP_VAR* var;
1797  SCIP_Bool uselocalvarmap;
1798  SCIP_Bool uselocalconsmap;
1799 
1800  assert(sourcescip != NULL);
1801  assert(targetscip != NULL);
1802  assert(sourcevar != NULL);
1803  assert(targetvar != NULL);
1804  assert(sourcevar->scip == sourcescip);
1805 
1806  /* check stages for both, the source and the target SCIP data structure */
1807  SCIP_CALL( checkStage(sourcescip, "SCIPgetVarCopy", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1808  SCIP_CALL( checkStage(targetscip, "SCIPgetVarCopy", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1809 
1810  uselocalvarmap = (varmap == NULL);
1811  uselocalconsmap = (consmap == NULL);
1812  *success = TRUE;
1813 
1814  /* try to retrieve copied variable from hashmap */
1815  if( !uselocalvarmap )
1816  {
1817  *targetvar = (SCIP_VAR*) SCIPhashmapGetImage(varmap, sourcevar);
1818  if( *targetvar != NULL )
1819  return SCIP_OKAY;
1820  }
1821 
1822  /* if the target SCIP is already in solving stage we currently are not copying the variable!
1823  * this has to be done because we cannot simply add variables to SCIP during solving and thereby enlarge the search
1824  * space.
1825  * unlike column generation we cannot assume here that the variable could be implicitly set to zero in all prior
1826  * computations
1827  */
1828  if( SCIPgetStage(targetscip) > SCIP_STAGE_PROBLEM )
1829  {
1830  *success = FALSE;
1831  *targetvar = NULL;
1832 
1833  return SCIP_OKAY;
1834  }
1835 
1836  /* create the variable mapping hash map */
1837  if( uselocalvarmap )
1838  {
1839  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNVars(sourcescip))) );
1840  }
1841  else
1842  localvarmap = varmap;
1843 
1844  if( uselocalconsmap )
1845  {
1846  /* create the constraint mapping hash map */
1847  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNConss(sourcescip))) );
1848  }
1849  else
1850  localconsmap = consmap;
1851 
1852  /* if variable does not exist yet in target SCIP, create it */
1853  switch( SCIPvarGetStatus(sourcevar) )
1854  {
1856  SCIP_CALL( SCIPvarCopy(&var, targetscip->mem->probmem, targetscip->set, targetscip->stat,
1857  sourcescip, sourcevar, localvarmap, localconsmap, global) );
1858  break;
1859  case SCIP_VARSTATUS_COLUMN:
1860  case SCIP_VARSTATUS_LOOSE:
1861  case SCIP_VARSTATUS_FIXED:
1862  SCIP_CALL( SCIPvarCopy(&var, targetscip->mem->probmem, targetscip->set, targetscip->stat,
1863  sourcescip, sourcevar, localvarmap, localconsmap, global) );
1864  break;
1865 
1867  {
1868  SCIP_CONS* cons;
1869  char name[SCIP_MAXSTRLEN];
1870 
1871  SCIP_VAR* sourceaggrvar;
1872  SCIP_VAR* targetaggrvar;
1873  SCIP_Real aggrcoef;
1874  SCIP_Real constant;
1875 
1876  /* get aggregation data */
1877  sourceaggrvar = SCIPvarGetAggrVar(sourcevar);
1878  aggrcoef = SCIPvarGetAggrScalar(sourcevar);
1879  constant = SCIPvarGetAggrConstant(sourcevar);
1880 
1881  /* get copy of the aggregation variable */
1882  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourceaggrvar, &targetaggrvar, localvarmap, localconsmap, global, success) );
1883  assert(*success);
1884 
1885  /* create copy of the aggregated variable */
1886  SCIP_CALL( SCIPvarCopy(&var, targetscip->mem->probmem, targetscip->set, targetscip->stat,
1887  sourcescip, sourcevar, localvarmap, localconsmap, global) );
1888 
1889  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_aggr", SCIPvarGetName(sourcevar));
1890 
1891  /* add aggregation x = a*y + c as linear constraint x - a*y = c */
1892  SCIP_CALL( SCIPcreateConsLinear(targetscip, &cons, name, 0, NULL, NULL, constant,
1893  constant, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) );
1894  SCIP_CALL( SCIPaddCoefLinear(targetscip, cons, var, 1.0) );
1895  SCIP_CALL( SCIPaddCoefLinear(targetscip, cons, targetaggrvar, -aggrcoef) );
1896 
1897  SCIP_CALL( SCIPaddCons(targetscip, cons) );
1898  SCIP_CALL( SCIPreleaseCons(targetscip, &cons) );
1899 
1900  break;
1901  }
1903  {
1904  SCIP_CONS* cons;
1905  char name[SCIP_MAXSTRLEN];
1906 
1907  SCIP_VAR** sourceaggrvars;
1908  SCIP_VAR** targetaggrvars;
1909  SCIP_Real* aggrcoefs;
1910  SCIP_Real constant;
1911 
1912  int naggrvars;
1913  int i;
1914 
1915  /* get the active representation */
1916  SCIP_CALL( SCIPflattenVarAggregationGraph(sourcescip, sourcevar) );
1917 
1918  /* get multi-aggregation data */
1919  naggrvars = SCIPvarGetMultaggrNVars(sourcevar);
1920  sourceaggrvars = SCIPvarGetMultaggrVars(sourcevar);
1921  aggrcoefs = SCIPvarGetMultaggrScalars(sourcevar);
1922  constant = SCIPvarGetMultaggrConstant(sourcevar);
1923 
1924  SCIP_CALL( SCIPallocBufferArray(targetscip, &targetaggrvars, naggrvars) );
1925 
1926  /* get copies of the active variables of the multi-aggregation */
1927  for( i = 0; i < naggrvars; ++i )
1928  {
1929  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourceaggrvars[i], &targetaggrvars[i], localvarmap, localconsmap, global, success) );
1930  assert(*success);
1931  }
1932 
1933  /* create copy of the multi-aggregated variable */
1934  SCIP_CALL( SCIPvarCopy(&var, targetscip->mem->probmem, targetscip->set, targetscip->stat,
1935  sourcescip, sourcevar, localvarmap, localconsmap, global) );
1936 
1937  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_multaggr", SCIPvarGetName(sourcevar));
1938 
1939  /* add multi-aggregation x = a^T y + c as linear constraint a^T y - x = -c */
1940  SCIP_CALL( SCIPcreateConsLinear(targetscip, &cons, name, naggrvars, targetaggrvars, aggrcoefs, -constant,
1941  -constant, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) );
1942  SCIP_CALL( SCIPaddCoefLinear(targetscip, cons, var, -1.0) );
1943  SCIP_CALL( SCIPaddCons(targetscip, cons) );
1944  SCIP_CALL( SCIPreleaseCons(targetscip, &cons) );
1945 
1946  SCIPfreeBufferArray(targetscip, &targetaggrvars);
1947 
1948  break;
1949  }
1951  {
1952  SCIP_VAR* sourcenegatedvar;
1953  SCIP_VAR* targetnegatedvar;
1954 
1955  /* get negated source variable */
1956  sourcenegatedvar = SCIPvarGetNegationVar(sourcevar);
1957  assert(sourcenegatedvar != NULL);
1958  assert(SCIPvarGetStatus(sourcenegatedvar) != SCIP_VARSTATUS_NEGATED);
1959 
1960  /* get copy of negated source variable */
1961  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourcenegatedvar, &targetnegatedvar, localvarmap, localconsmap, global, success) );
1962  assert(*success);
1963  assert(SCIPvarGetStatus(targetnegatedvar) != SCIP_VARSTATUS_NEGATED);
1964 
1965  /* get negation of copied negated source variable, this is the target variable */
1966  SCIP_CALL( SCIPgetNegatedVar(targetscip, targetnegatedvar, targetvar) );
1967  assert(SCIPvarGetStatus(*targetvar) == SCIP_VARSTATUS_NEGATED);
1968 
1969  /* free local hash maps if necessary */
1970  if( uselocalvarmap )
1971  SCIPhashmapFree(&localvarmap);
1972 
1973  if( uselocalconsmap )
1974  SCIPhashmapFree(&localconsmap);
1975 
1976  /* we have to return right away, to avoid adding the negated variable to the problem since the "not negated"
1977  * variable was already added */
1978  return SCIP_OKAY;
1979  }
1980  default:
1981  /* note that this is in an internal SCIP error since the variable status is only handled by the core */
1982  SCIPerrorMessage("unknown variable status\n");
1983  SCIPABORT();
1984  return SCIP_ERROR; /*lint !e527*/
1985  }
1986 
1987  /* add the (new) target variable to the target problem */
1988  SCIP_CALL( SCIPaddVar(targetscip, var) );
1989 
1990  *targetvar = var;
1991 
1992  /* remove the variable capture which was done due to the creation of the variable */
1993  SCIP_CALL( SCIPreleaseVar(targetscip, &var) );
1994 
1995  /* free local hash maps if necessary */
1996  if( uselocalvarmap )
1997  SCIPhashmapFree(&localvarmap);
1998 
1999  if( uselocalconsmap )
2000  SCIPhashmapFree(&localconsmap);
2001 
2002  return SCIP_OKAY;
2003 }
2004 
2005 /** copies all original or active variables from source-SCIP and adds these variable to the target-SCIP; the mapping
2006  * between these variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed
2007  * and aggregated variables do not get copied
2008  */
2009 static
2011  SCIP* sourcescip, /**< source SCIP data structure */
2012  SCIP* targetscip, /**< target SCIP data structure */
2013  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
2014  * target variables, or NULL */
2015  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2016  * target constraints, or NULL */
2017  SCIP_Bool original, /**< should original variables be copied? */
2018  SCIP_Bool global /**< should global or local bounds be used? (for original=FALSE) */
2019  )
2020 {
2021  SCIP_VAR** sourcevars;
2022  SCIP_HASHMAP* localvarmap;
2023  SCIP_HASHMAP* localconsmap;
2024  SCIP_Bool uselocalvarmap;
2025  SCIP_Bool uselocalconsmap;
2026  int nsourcevars;
2027  int i;
2028 
2029  assert(sourcescip != NULL);
2030  assert(targetscip != NULL);
2031 
2032  if( original )
2033  {
2034  /* get original variables of the source SCIP */
2035  SCIP_CALL( SCIPgetOrigVarsData(sourcescip, &sourcevars, &nsourcevars, NULL, NULL, NULL, NULL) );
2036  }
2037  else
2038  {
2039  /* get active variables of the source SCIP */
2040  SCIP_CALL( SCIPgetVarsData(sourcescip, &sourcevars, &nsourcevars, NULL, NULL, NULL, NULL) );
2041  }
2042 
2043  uselocalvarmap = (varmap == NULL);
2044  uselocalconsmap = (consmap == NULL);
2045 
2046  if( uselocalvarmap )
2047  {
2048  /* create the variable mapping hash map */
2049  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNVars(sourcescip))) );
2050  }
2051  else
2052  localvarmap = varmap;
2053 
2054  if( uselocalconsmap )
2055  {
2056  /* create the constraint mapping hash map */
2057  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNConss(sourcescip))) );
2058  }
2059  else
2060  localconsmap = consmap;
2061 
2062  /* create the variables of the target SCIP */
2063  for( i = 0; i < nsourcevars; ++i )
2064  {
2065  SCIP_Bool success;
2066  SCIP_VAR* targetvar;
2067 
2068  /* copy variable and add this copy to the target SCIP if the copying was valid */
2069  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourcevars[i], &targetvar, localvarmap, localconsmap, global, &success) );
2070  assert(success);
2071  assert(targetvar != NULL);
2072  }
2073 
2074  /* integer variables that are fixed to zero or one or have bounds [0,1] will be converted to binaries */
2075 #ifndef NDEBUG
2076  if( original )
2077  {
2078  assert(SCIPgetNOrigBinVars(sourcescip) == SCIPgetNOrigBinVars(targetscip));
2079  assert(SCIPgetNOrigIntVars(sourcescip) == SCIPgetNOrigIntVars(targetscip));
2080  assert(SCIPgetNOrigImplVars(sourcescip) == SCIPgetNOrigImplVars(targetscip));
2081  assert(SCIPgetNOrigContVars(sourcescip) == SCIPgetNOrigContVars(targetscip));
2082  }
2083  else
2084  {
2085  SCIP_VAR** fixedvars;
2086  int nfixedvars;
2087  int nfixedbinvars;
2088  int nfixedintvars;
2089  int nfixedimplvars;
2090  int nfixedcontvars;
2091 
2092  fixedvars = SCIPgetFixedVars(sourcescip);
2093  nfixedvars = SCIPgetNFixedVars(sourcescip);
2094  nfixedbinvars = 0;
2095  nfixedintvars = 0;
2096  nfixedimplvars = 0;
2097  nfixedcontvars = 0;
2098 
2099  /* count number of fixed variables for all variable types */
2100  for( i = 0; i < nfixedvars; ++i )
2101  {
2102  switch( SCIPvarGetType(fixedvars[i]) )
2103  {
2104  case SCIP_VARTYPE_BINARY:
2105  nfixedbinvars++;
2106  break;
2107  case SCIP_VARTYPE_INTEGER:
2108  nfixedintvars++;
2109  break;
2110  case SCIP_VARTYPE_IMPLINT:
2111  nfixedimplvars++;
2112  break;
2114  nfixedcontvars++;
2115  break;
2116  default:
2117  SCIPerrorMessage("unknown variable type\n");
2118  return SCIP_INVALIDDATA;
2119  }
2120  }
2121  assert(nfixedvars == nfixedbinvars + nfixedintvars + nfixedimplvars + nfixedcontvars);
2122  assert(SCIPgetNBinVars(sourcescip) <= SCIPgetNBinVars(targetscip));
2123  assert(SCIPgetNIntVars(sourcescip) + SCIPgetNBinVars(sourcescip) <= SCIPgetNIntVars(targetscip) + SCIPgetNBinVars(targetscip)
2124  && SCIPgetNIntVars(targetscip) + SCIPgetNBinVars(targetscip) <= SCIPgetNIntVars(sourcescip) + SCIPgetNBinVars(sourcescip) + nfixedbinvars + nfixedintvars );
2125  assert(SCIPgetNImplVars(sourcescip) <= SCIPgetNImplVars(targetscip)
2126  && SCIPgetNImplVars(targetscip) <= SCIPgetNImplVars(sourcescip) + nfixedimplvars);
2127  assert(SCIPgetNContVars(sourcescip) <= SCIPgetNContVars(targetscip)
2128  && SCIPgetNContVars(targetscip) <= SCIPgetNContVars(targetscip) + nfixedcontvars);
2129  }
2130 #endif
2131 
2132  if( uselocalvarmap )
2133  {
2134  /* free hash map */
2135  SCIPhashmapFree(&localvarmap);
2136  }
2137 
2138  if( uselocalconsmap )
2139  {
2140  /* free hash map */
2141  SCIPhashmapFree(&localconsmap);
2142  }
2143 
2144  return SCIP_OKAY;
2145 }
2146 
2147 /** copies all active variables from source-SCIP and adds these variable to the target-SCIP; the mapping between these
2148  * variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed and aggregated
2149  * variables do not get copied
2150  *
2151  * @note the variables are added to the target-SCIP but not captured
2152  *
2153  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2154  * @note Do not change the source SCIP environment during the copying process
2155  *
2156  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2157  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2158  *
2159  * @pre This method can be called if sourcescip is in one of the following stages:
2160  * - \ref SCIP_STAGE_PROBLEM
2161  * - \ref SCIP_STAGE_TRANSFORMED
2162  * - \ref SCIP_STAGE_INITPRESOLVE
2163  * - \ref SCIP_STAGE_PRESOLVING
2164  * - \ref SCIP_STAGE_EXITPRESOLVE
2165  * - \ref SCIP_STAGE_PRESOLVED
2166  * - \ref SCIP_STAGE_INITSOLVE
2167  * - \ref SCIP_STAGE_SOLVING
2168  * - \ref SCIP_STAGE_SOLVED
2169  *
2170  * @pre This method can be called if targetscip is in one of the following stages:
2171  * - \ref SCIP_STAGE_PROBLEM
2172  *
2173  * @note sourcescip stage does not get changed
2174  *
2175  * @note targetscip stage does not get changed
2176  *
2177  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2178  */
2180  SCIP* sourcescip, /**< source SCIP data structure */
2181  SCIP* targetscip, /**< target SCIP data structure */
2182  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
2183  * target variables, or NULL */
2184  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2185  * target constraints, or NULL */
2186  SCIP_Bool global /**< should global or local bounds be used? */
2187  )
2188 {
2189  assert(sourcescip != NULL);
2190  assert(targetscip != NULL);
2191 
2192  /* check stages for both, the source and the target SCIP data structure */
2193  SCIP_CALL( checkStage(sourcescip, "SCIPcopyVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2194  SCIP_CALL( checkStage(targetscip, "SCIPcopyVars", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2195 
2196  SCIP_CALL( copyVars(sourcescip, targetscip, varmap, consmap, FALSE, global) );
2197 
2198  return SCIP_OKAY;
2199 }
2200 
2201 /** copies all original variables from source-SCIP and adds these variable to the target-SCIP; the mapping between these
2202  * variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed and aggregated
2203  * variables do not get copied
2204  *
2205  * @note the variables are added to the target-SCIP but not captured
2206  *
2207  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2208  * @note Do not change the source SCIP environment during the copying process
2209  *
2210  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2211  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2212  *
2213  * @pre This method can be called if sourcescip is in one of the following stages:
2214  * - \ref SCIP_STAGE_PROBLEM
2215  * - \ref SCIP_STAGE_TRANSFORMED
2216  * - \ref SCIP_STAGE_INITPRESOLVE
2217  * - \ref SCIP_STAGE_PRESOLVING
2218  * - \ref SCIP_STAGE_EXITPRESOLVE
2219  * - \ref SCIP_STAGE_PRESOLVED
2220  * - \ref SCIP_STAGE_INITSOLVE
2221  * - \ref SCIP_STAGE_SOLVING
2222  * - \ref SCIP_STAGE_SOLVED
2223  *
2224  * @pre This method can be called if targetscip is in one of the following stages:
2225  * - \ref SCIP_STAGE_PROBLEM
2226  *
2227  * @note sourcescip stage does not get changed
2228  *
2229  * @note targetscip stage does not get changed
2230  *
2231  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2232  */
2234  SCIP* sourcescip, /**< source SCIP data structure */
2235  SCIP* targetscip, /**< target SCIP data structure */
2236  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
2237  * target variables, or NULL */
2238  SCIP_HASHMAP* consmap /**< a hashmap to store the mapping of source constraints to the corresponding
2239  * target constraints, or NULL */
2240  )
2241 {
2242  assert(sourcescip != NULL);
2243  assert(targetscip != NULL);
2244 
2245  /* check stages for both, the source and the target SCIP data structure */
2246  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrigVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2247  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrigVars", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2248 
2249  SCIP_CALL( copyVars(sourcescip, targetscip, varmap, consmap, TRUE, TRUE) );
2250 
2251  return SCIP_OKAY;
2252 }
2253 
2254 /** merges the histories of variables from a source SCIP into a target SCIP. The two data structures should point to
2255  * different SCIP instances.
2256  *
2257  * @note the notion of source and target is inverted here; \p sourcescip usually denotes a copied SCIP instance, whereas
2258  * \p targetscip denotes the original instance
2259  */
2261  SCIP* sourcescip, /**< source SCIP data structure */
2262  SCIP* targetscip, /**< target SCIP data structure */
2263  SCIP_VAR** sourcevars, /**< source variables for history merge */
2264  SCIP_VAR** targetvars, /**< target variables for history merge */
2265  int nvars /**< number of variables in both variable arrays */
2266  )
2267 {
2268  int i;
2269 
2270  /* check if target scip has been set to allow merging variable statistics */
2271  if( !targetscip->set->history_allowmerge )
2272  return SCIP_OKAY;
2273 
2274  assert(nvars == 0 || (sourcevars != NULL && targetvars != NULL));
2275  assert(sourcescip != targetscip);
2276 
2277  /* we do not want to copy statistics from a scip that has not really started solving */
2278  if( SCIPgetStage(sourcescip) < SCIP_STAGE_SOLVING )
2279  return SCIP_OKAY;
2280 
2281  /* if the transformation of the source was subject to scaling, the history information cannot be just copied */
2282  if( !SCIPsetIsEQ(targetscip->set, 1.0, SCIPgetOrigObjscale(sourcescip))
2283  || !SCIPsetIsEQ(targetscip->set, 0.0, SCIPgetOrigObjoffset(sourcescip)) )
2284  return SCIP_OKAY;
2285 
2286  /* merge histories of the targetSCIP-variables to the SCIP variables. */
2287  for( i = 0; i < nvars; ++i )
2288  {
2289  SCIP_VARSTATUS sourcevarstatus;
2290 
2291  assert(sourcevars[i]->scip == sourcescip);
2292  assert(targetvars[i]->scip == targetscip);
2293 
2294  sourcevarstatus = SCIPvarGetStatus(sourcevars[i]);
2295 
2296  /* depending on the variable status, we use either the transformed variable history or the history of the col itself */
2297  switch( sourcevarstatus )
2298  {
2300  assert(NULL != SCIPvarGetTransVar(sourcevars[i]));
2301  SCIPvarMergeHistories(targetvars[i], SCIPvarGetTransVar(sourcevars[i]), targetscip->stat);
2302  break;
2303  case SCIP_VARSTATUS_COLUMN:
2304  SCIPvarMergeHistories(targetvars[i], sourcevars[i], targetscip->stat);
2305  break;
2306  default:
2307  /* other variable status are currently not supported for the merging */
2308  break;
2309  } /*lint !e788*/
2310  }
2311 
2312  return SCIP_OKAY;
2313 }
2314 
2315 /** returns copy of the source constraint; if there already is a copy of the source constraint in the constraint hash
2316  * map, it is just returned as target constraint; elsewise a new constraint will be created; this created constraint is
2317  * added to the constraint hash map and returned as target constraint; the variable map is used to map the variables of
2318  * the source SCIP to the variables of the target SCIP
2319  *
2320  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
2321  * be declared feasible even if it violates this particular constraint. This constellation should only be
2322  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
2323  * to the variable's local bounds.
2324  *
2325  * @note The constraint is not added to the target SCIP. You can check whether a constraint is added by calling
2326  * SCIPconsIsAdded(). (If you mix SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add
2327  * explicitly and what is already added.)
2328  *
2329  * @note The constraint is always captured, either during the creation of the copy or after finding the copy of the
2330  * constraint in the constraint hash map
2331  *
2332  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2333  * @note Do not change the source SCIP environment during the copying process
2334  *
2335  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2336  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2337  *
2338  * @pre This method can be called if sourcescip is in one of the following stages:
2339  * - \ref SCIP_STAGE_PROBLEM
2340  * - \ref SCIP_STAGE_TRANSFORMED
2341  * - \ref SCIP_STAGE_INITPRESOLVE
2342  * - \ref SCIP_STAGE_PRESOLVING
2343  * - \ref SCIP_STAGE_EXITPRESOLVE
2344  * - \ref SCIP_STAGE_PRESOLVED
2345  * - \ref SCIP_STAGE_INITSOLVE
2346  * - \ref SCIP_STAGE_SOLVING
2347  * - \ref SCIP_STAGE_SOLVED
2348  *
2349  * @pre This method can be called if targetscip is in one of the following stages:
2350  * - \ref SCIP_STAGE_PROBLEM
2351  * - \ref SCIP_STAGE_TRANSFORMING
2352  * - \ref SCIP_STAGE_INITPRESOLVE
2353  * - \ref SCIP_STAGE_PRESOLVING
2354  * - \ref SCIP_STAGE_EXITPRESOLVE
2355  * - \ref SCIP_STAGE_PRESOLVED
2356  * - \ref SCIP_STAGE_SOLVING
2357  * - \ref SCIP_STAGE_EXITSOLVE
2358  *
2359  * @note sourcescip stage does not get changed
2360  *
2361  * @note targetscip stage does not get changed
2362  *
2363  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2364  */
2366  SCIP* sourcescip, /**< source SCIP data structure */
2367  SCIP* targetscip, /**< target SCIP data structure */
2368  SCIP_CONS* sourcecons, /**< source constraint of the source SCIP */
2369  SCIP_CONS** targetcons, /**< pointer to store the created target constraint */
2370  SCIP_CONSHDLR* sourceconshdlr, /**< source constraint handler for this constraint */
2371  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
2372  * variables of the target SCIP, or NULL */
2373  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2374  * target constraints, or NULL */
2375  const char* name, /**< name of constraint, or NULL if the name of the source constraint should be used */
2376  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP? */
2377  SCIP_Bool separate, /**< should the constraint be separated during LP processing? */
2378  SCIP_Bool enforce, /**< should the constraint be enforced during node processing? */
2379  SCIP_Bool check, /**< should the constraint be checked for feasibility? */
2380  SCIP_Bool propagate, /**< should the constraint be propagated during node processing? */
2381  SCIP_Bool local, /**< is constraint only valid locally? */
2382  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)? */
2383  SCIP_Bool dynamic, /**< is constraint subject to aging? */
2384  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup? */
2385  SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
2386  * if it may be moved to a more global node? */
2387  SCIP_Bool global, /**< create a global or a local copy? */
2388  SCIP_Bool* success /**< pointer to store whether the copying was successful or not */
2389  )
2390 {
2391  SCIP_HASHMAP* localvarmap;
2392  SCIP_HASHMAP* localconsmap;
2393  SCIP_Bool uselocalvarmap;
2394  SCIP_Bool uselocalconsmap;
2395 
2396  assert(targetcons != NULL);
2397  assert(sourceconshdlr != NULL);
2398 
2399  SCIP_CALL( checkStage(sourcescip, "SCIPgetConsCopy", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2400  SCIP_CALL( checkStage(targetscip, "SCIPgetConsCopy", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
2401 
2402  uselocalvarmap = (varmap == NULL);
2403  uselocalconsmap = (consmap == NULL);
2404 
2405  /* a variables map and a constraint map is needed to avoid infinite recursion */
2406  if( uselocalvarmap )
2407  {
2408  /* create the variable mapping hash map */
2409  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNVars(sourcescip))) );
2410  }
2411  else
2412  localvarmap = varmap;
2413 
2414  *targetcons = NULL;
2415  if( uselocalconsmap )
2416  {
2417  /* create local constraint mapping hash map */
2418  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNConss(sourcescip))) );
2419  }
2420  else
2421  {
2422  /* use global map and try to retrieve copied constraint */
2423  localconsmap = consmap;
2424  *targetcons = (SCIP_CONS*) SCIPhashmapGetImage(localconsmap, sourcecons);
2425  }
2426 
2427  if( *targetcons != NULL )
2428  {
2429  /* if found capture existing copy of the constraint */
2430  SCIP_CALL( SCIPcaptureCons(targetscip, *targetcons) );
2431  *success = TRUE;
2432  }
2433  else
2434  {
2435  /* otherwise create a copy of the constraint */
2436  SCIP_CALL( SCIPconsCopy(targetcons, targetscip->set, name, sourcescip, sourceconshdlr, sourcecons, localvarmap, localconsmap,
2437  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, global, success) );
2438 
2439  if( *success && !uselocalconsmap )
2440  {
2441  /* insert constraint into mapping between source SCIP and the target SCIP */
2442  SCIP_CALL( SCIPhashmapInsert(consmap, sourcecons, *targetcons) );
2443  }
2444  }
2445 
2446  /* free locally allocated hash maps */
2447  if( uselocalvarmap )
2448  {
2449  SCIPhashmapFree(&localvarmap);
2450  }
2451 
2452  if( uselocalconsmap )
2453  {
2454  SCIPhashmapFree(&localconsmap);
2455  }
2456 
2457  return SCIP_OKAY;
2458 }
2459 
2460 /** copies constraints from the source-SCIP and adds these to the target-SCIP; for mapping the
2461  * variables between the source and the target SCIP a hash map can be given; if the variable hash
2462  * map is NULL or necessary variable mapping is missing, the required variables are created in the
2463  * target-SCIP and added to the hash map, if not NULL; all variables which are created are added to
2464  * the target-SCIP but not (user) captured; if the constraint hash map is not NULL the mapping
2465  * between the constraints of the source and target-SCIP is stored
2466  *
2467  * @note the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix
2468  * SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already
2469  * added.) You can check whether a constraint is added by calling SCIPconsIsAdded().
2470  *
2471  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2472  * @note Do not change the source SCIP environment during the copying process
2473  *
2474  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2475  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2476  *
2477  * @pre This method can be called if sourcescip is in one of the following stages:
2478  * - \ref SCIP_STAGE_PROBLEM
2479  * - \ref SCIP_STAGE_TRANSFORMED
2480  * - \ref SCIP_STAGE_INITPRESOLVE
2481  * - \ref SCIP_STAGE_PRESOLVING
2482  * - \ref SCIP_STAGE_EXITPRESOLVE
2483  * - \ref SCIP_STAGE_PRESOLVED
2484  * - \ref SCIP_STAGE_INITSOLVE
2485  * - \ref SCIP_STAGE_SOLVING
2486  * - \ref SCIP_STAGE_SOLVED
2487  *
2488  * @pre This method can be called if targetscip is in one of the following stages:
2489  * - \ref SCIP_STAGE_PROBLEM
2490  *
2491  * @note sourcescip stage does not get changed
2492  *
2493  * @note targetscip stage does not get changed
2494  *
2495  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2496  */
2498  SCIP* sourcescip, /**< source SCIP data structure */
2499  SCIP* targetscip, /**< target SCIP data structure */
2500  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
2501  * variables of the target SCIP, or NULL */
2502  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2503  * target constraints, or NULL */
2504  SCIP_Bool global, /**< create a global or a local copy? */
2505  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance?
2506  * If TRUE, the modifiable flag of constraints will be copied. */
2507  SCIP_Bool* valid /**< pointer to store whether all constraints were validly copied */
2508  )
2509 {
2510  SCIP_CONSHDLR** sourceconshdlrs;
2511  SCIP_HASHMAP* localvarmap;
2512  SCIP_HASHMAP* localconsmap;
2513  SCIP_Bool uselocalvarmap;
2514  SCIP_Bool uselocalconsmap;
2515  int nsourceconshdlrs;
2516  int i;
2517 
2518  assert(sourcescip != NULL);
2519  assert(targetscip != NULL);
2520  assert(valid != NULL);
2521 
2522  /* check stages for both, the source and the target SCIP data structure */
2523  SCIP_CALL( checkStage(sourcescip, "SCIPcopyConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2524  SCIP_CALL( checkStage(targetscip, "SCIPcopyConss", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2525 
2526  /* check if we locally need to create a variable or constraint hash map */
2527  uselocalvarmap = (varmap == NULL);
2528  uselocalconsmap = (consmap == NULL);
2529 
2530  if( uselocalvarmap )
2531  {
2532  /* create the variable mapping hash map */
2533  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNVars(sourcescip))) );
2534  }
2535  else
2536  localvarmap = varmap;
2537 
2538  if( uselocalconsmap )
2539  {
2540  /* create the constraint mapping hash map */
2541  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNConss(sourcescip))) );
2542  }
2543  else
2544  localconsmap = consmap;
2545 
2546  nsourceconshdlrs = SCIPgetNConshdlrs(sourcescip);
2547  sourceconshdlrs = SCIPgetConshdlrs(sourcescip);
2548  assert(nsourceconshdlrs == 0 || sourceconshdlrs != NULL);
2549  assert(SCIPisTransformed(sourcescip));
2550 
2551  *valid = TRUE;
2552 
2553  /* copy constraints: loop through all (source) constraint handlers */
2554  for( i = 0; i < nsourceconshdlrs; ++i )
2555  {
2556  SCIP_CONS** sourceconss;
2557  SCIP_CONS* targetcons;
2558  SCIP_Bool success;
2559  int nsourceconss;
2560  int c;
2561 
2562  assert(sourceconshdlrs[i] != NULL);
2563 
2564  /* constraint handlers have to explicitly set the success pointer to TRUE */
2565  success = FALSE;
2566 
2567  /* Get all active constraints for copying; this array contains all active constraints;
2568  * constraints are active if they are globally valid and not deleted after presolving OR they
2569  * were locally added during the search and we are currently in a node which belongs to the
2570  * corresponding subtree.
2571  */
2572  nsourceconss = SCIPconshdlrGetNActiveConss(sourceconshdlrs[i]);
2573  sourceconss = SCIPconshdlrGetConss(sourceconshdlrs[i]);
2574 
2575 
2576 #ifdef SCIP_DISABLED_CODE
2577  /* @todo using the following might reduce the number of copied constraints - check whether this is better */
2578  /* Get all checked constraints for copying; this included local constraints */
2579  if( !global )
2580  {
2581  nsourceconss = SCIPconshdlrGetNCheckConss(sourceconshdlrs[i]);
2582  sourceconss = SCIPconshdlrGetCheckConss(sourceconshdlrs[i]);
2583  }
2584 #endif
2585 
2586  assert(nsourceconss == 0 || sourceconss != NULL);
2587 
2588  if( nsourceconss > 0 )
2589  {
2590  SCIPdebugMessage("Attempting to copy %d %s constraints\n", nsourceconss, SCIPconshdlrGetName(sourceconshdlrs[i]));
2591  }
2592 
2593  /* copy all constraints of one constraint handler */
2594  for( c = 0; c < nsourceconss; ++c )
2595  {
2596  /* all constraints have to be active */
2597  assert(sourceconss[c] != NULL);
2598  assert(SCIPconsIsActive(sourceconss[c]));
2599  assert(!SCIPconsIsDeleted(sourceconss[c]));
2600 
2601  /* in case of copying the global problem we have to ignore the local constraints which are active */
2602  if( global && SCIPconsIsLocal(sourceconss[c]) )
2603  {
2604  SCIPdebugMessage("did not copy local constraint <%s> when creating global copy\n", SCIPconsGetName(sourceconss[c]));
2605  continue;
2606  }
2607 
2608  /* use the copy constructor of the constraint handler and creates and captures the constraint if possible */
2609  targetcons = NULL;
2610  SCIP_CALL( SCIPgetConsCopy(sourcescip, targetscip, sourceconss[c], &targetcons, sourceconshdlrs[i], localvarmap, localconsmap, NULL,
2611  SCIPconsIsInitial(sourceconss[c]), SCIPconsIsSeparated(sourceconss[c]),
2612  SCIPconsIsEnforced(sourceconss[c]), SCIPconsIsChecked(sourceconss[c]),
2613  SCIPconsIsPropagated(sourceconss[c]), FALSE, SCIPconsIsModifiable(sourceconss[c]),
2614  SCIPconsIsDynamic(sourceconss[c]), SCIPconsIsRemovable(sourceconss[c]), FALSE, global, &success) );
2615 
2616  /* add the copied constraint to target SCIP if the copying process was valid */
2617  if( success )
2618  {
2619  assert(targetcons != NULL);
2620 
2621  if( !enablepricing )
2622  SCIPconsSetModifiable(targetcons, FALSE);
2623 
2624  /* add constraint to target SCIP */
2625  SCIP_CALL( SCIPaddCons(targetscip, targetcons) );
2626 
2627  /* release constraint once for the creation capture */
2628  SCIP_CALL( SCIPreleaseCons(targetscip, &targetcons) );
2629  }
2630  else
2631  {
2632  *valid = FALSE;
2633  SCIPdebugMessage("failed to copy constraint %s\n", SCIPconsGetName(sourceconss[c]));
2634  }
2635  }
2636  }
2637 
2638  if( uselocalvarmap )
2639  {
2640  /* free hash map */
2641  SCIPhashmapFree(&localvarmap);
2642  }
2643 
2644  if( uselocalconsmap )
2645  {
2646  /* free hash map */
2647  SCIPhashmapFree(&localconsmap);
2648  }
2649 
2650  return SCIP_OKAY;
2651 }
2652 
2653 /** copies all original constraints from the source-SCIP and adds these to the target-SCIP; for mapping the
2654  * variables between the source and the target SCIP a hash map can be given; if the variable hash
2655  * map is NULL or necessary variable mapping is missing, the required variables are created in the
2656  * target-SCIP and added to the hash map, if not NULL; all variables which are created are added to
2657  * the target-SCIP but not (user) captured; if the constraint hash map is not NULL the mapping
2658  * between the constraints of the source and target-SCIP is stored
2659  *
2660  * @note the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix
2661  * SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already
2662  * added.) You can check whether a constraint is added by calling SCIPconsIsAdded().
2663  *
2664  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2665  * @note Do not change the source SCIP environment during the copying process
2666  *
2667  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2668  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2669  *
2670  * @pre This method can be called if sourcescip is in one of the following stages:
2671  * - \ref SCIP_STAGE_PROBLEM
2672  * - \ref SCIP_STAGE_TRANSFORMED
2673  * - \ref SCIP_STAGE_INITPRESOLVE
2674  * - \ref SCIP_STAGE_PRESOLVING
2675  * - \ref SCIP_STAGE_EXITPRESOLVE
2676  * - \ref SCIP_STAGE_PRESOLVED
2677  * - \ref SCIP_STAGE_INITSOLVE
2678  * - \ref SCIP_STAGE_SOLVING
2679  * - \ref SCIP_STAGE_SOLVED
2680  *
2681  * @pre This method can be called if targetscip is in one of the following stages:
2682  * - \ref SCIP_STAGE_PROBLEM
2683  *
2684  * @note sourcescip stage does not get changed
2685  *
2686  * @note targetscip stage does not get changed
2687  *
2688  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2689  */
2691  SCIP* sourcescip, /**< source SCIP data structure */
2692  SCIP* targetscip, /**< target SCIP data structure */
2693  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
2694  * variables of the target SCIP, or NULL */
2695  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2696  * target constraints, or NULL */
2697  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance?
2698  * If TRUE, the modifiable flag of constraints will be copied. */
2699  SCIP_Bool* valid /**< pointer to store whether all constraints were validly copied */
2700  )
2701 {
2702  SCIP_CONS** sourceconss;
2703  SCIP_HASHMAP* localvarmap;
2704  SCIP_HASHMAP* localconsmap;
2705  SCIP_Bool uselocalvarmap;
2706  SCIP_Bool uselocalconsmap;
2707  int nsourceconss;
2708  int c;
2709 
2710  assert(sourcescip != NULL);
2711  assert(targetscip != NULL);
2712  assert(valid != NULL);
2713 
2714  /* check stages for both, the source and the target SCIP data structure */
2715  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrigConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2716  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrigConss", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2717 
2718  /* check if we locally need to create a variable or constraint hash map */
2719  uselocalvarmap = (varmap == NULL);
2720  uselocalconsmap = (consmap == NULL);
2721 
2722  if( uselocalvarmap )
2723  {
2724  /* create the variable mapping hash map */
2725  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNVars(sourcescip))) );
2726  }
2727  else
2728  localvarmap = varmap;
2729 
2730  if( uselocalconsmap )
2731  {
2732  /* create the constraint mapping hash map */
2733  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNConss(sourcescip))) );
2734  }
2735  else
2736  localconsmap = consmap;
2737 
2738  sourceconss = SCIPgetOrigConss(sourcescip);
2739  nsourceconss = SCIPgetNOrigConss(sourcescip);
2740 
2741  *valid = TRUE;
2742 
2743  SCIPdebugMessage("Attempting to copy %d original constraints\n", nsourceconss);
2744 
2745  /* copy constraints: loop through all (source) constraint handlers */
2746  for( c = 0; c < nsourceconss; ++c )
2747  {
2748  SCIP_CONS* targetcons;
2749  SCIP_Bool success;
2750 
2751  /* constraint handlers have to explicitly set the success pointer to TRUE */
2752  success = FALSE;
2753 
2754  /* all constraints have to be active */
2755  assert(sourceconss[c] != NULL);
2756  assert(SCIPconsIsOriginal(sourceconss[c]));
2757 
2758  /* use the copy constructor of the constraint handler and creates and captures the constraint if possible */
2759  targetcons = NULL;
2760  SCIP_CALL( SCIPgetConsCopy(sourcescip, targetscip, sourceconss[c], &targetcons, SCIPconsGetHdlr(sourceconss[c]), localvarmap, localconsmap, NULL,
2761  SCIPconsIsInitial(sourceconss[c]), SCIPconsIsSeparated(sourceconss[c]),
2762  SCIPconsIsEnforced(sourceconss[c]), SCIPconsIsChecked(sourceconss[c]),
2763  SCIPconsIsPropagated(sourceconss[c]), FALSE, SCIPconsIsModifiable(sourceconss[c]),
2764  SCIPconsIsDynamic(sourceconss[c]), SCIPconsIsRemovable(sourceconss[c]), FALSE, TRUE, &success) );
2765 
2766  /* add the copied constraint to target SCIP if the copying process was valid */
2767  if( success )
2768  {
2769  assert(targetcons != NULL);
2770 
2771  if( !enablepricing )
2772  SCIPconsSetModifiable(targetcons, FALSE);
2773 
2774  /* add constraint to target SCIP */
2775  SCIP_CALL( SCIPaddCons(targetscip, targetcons) );
2776 
2777  /* release constraint once for the creation capture */
2778  SCIP_CALL( SCIPreleaseCons(targetscip, &targetcons) );
2779  }
2780  else
2781  {
2782  *valid = FALSE;
2783  SCIPdebugMessage("failed to copy constraint %s\n", SCIPconsGetName(sourceconss[c]));
2784  }
2785  }
2786 
2787  if( uselocalvarmap )
2788  {
2789  /* free hash map */
2790  SCIPhashmapFree(&localvarmap);
2791  }
2792 
2793  if( uselocalconsmap )
2794  {
2795  /* free hash map */
2796  SCIPhashmapFree(&localconsmap);
2797  }
2798 
2799  return SCIP_OKAY;
2800 }
2801 
2802 
2803 /** convert all active cuts from cutpool to linear constraints
2804  *
2805  * @note Do not change the source SCIP environment during the copying process
2806  *
2807  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2808  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2809  *
2810  * @pre This method can be called if SCIP is in one of the following stages:
2811  * - \ref SCIP_STAGE_PROBLEM
2812  * - \ref SCIP_STAGE_INITPRESOLVE
2813  * - \ref SCIP_STAGE_PRESOLVING
2814  * - \ref SCIP_STAGE_EXITPRESOLVE
2815  * - \ref SCIP_STAGE_PRESOLVED
2816  * - \ref SCIP_STAGE_SOLVING
2817  * - \ref SCIP_STAGE_EXITSOLVE
2818  *
2819  * @note SCIP stage does not get changed
2820  *
2821  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2822  */
2824  SCIP* scip, /**< SCIP data structure */
2825  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
2826  * target variables, or NULL */
2827  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2828  * target constraints, or NULL */
2829  SCIP_Bool global, /**< create a global or a local copy? */
2830  int* ncutsadded /**< pointer to store number of added cuts, or NULL */
2831  )
2832 {
2833  assert(scip != NULL);
2834  assert(scip->set != NULL);
2835 
2836  /* check stages for the SCIP data structure */
2837  SCIP_CALL( checkStage(scip, "SCIPconvertCutsToConss", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
2838 
2839  /* if we do not have any cuts, nothing can be converted */
2840  if( scip->set->stage < SCIP_STAGE_SOLVING )
2841  return SCIP_OKAY;
2842 
2843  /* create out of all active cuts in cutpool linear constraints in targetscip */
2844  SCIP_CALL( SCIPcopyCuts(scip, scip, varmap, consmap, global, ncutsadded) );
2845 
2846  return SCIP_OKAY;
2847 }
2848 
2849 /** copies all active cuts from cutpool of sourcescip to linear constraints in targetscip
2850  *
2851  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2852  * @note Do not change the source SCIP environment during the copying process
2853  *
2854  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2855  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2856  *
2857  * @pre This method can be called if sourcescip is in one of the following stages:
2858  * - \ref SCIP_STAGE_PROBLEM
2859  * - \ref SCIP_STAGE_TRANSFORMED
2860  * - \ref SCIP_STAGE_INITPRESOLVE
2861  * - \ref SCIP_STAGE_PRESOLVING
2862  * - \ref SCIP_STAGE_EXITPRESOLVE
2863  * - \ref SCIP_STAGE_PRESOLVED
2864  * - \ref SCIP_STAGE_SOLVING
2865  * - \ref SCIP_STAGE_SOLVED
2866  * - \ref SCIP_STAGE_EXITSOLVE
2867  *
2868  * @pre This method can be called if targetscip is in one of the following stages:
2869  * - \ref SCIP_STAGE_PROBLEM
2870  * - \ref SCIP_STAGE_INITPRESOLVE
2871  * - \ref SCIP_STAGE_PRESOLVING
2872  * - \ref SCIP_STAGE_EXITPRESOLVE
2873  * - \ref SCIP_STAGE_PRESOLVED
2874  * - \ref SCIP_STAGE_SOLVING
2875  * - \ref SCIP_STAGE_EXITSOLVE
2876  *
2877  * @note sourcescip stage does not get changed
2878  *
2879  * @note targetscip stage does not get changed
2880  *
2881  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2882  */
2884  SCIP* sourcescip, /**< source SCIP data structure */
2885  SCIP* targetscip, /**< target SCIP data structure */
2886  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
2887  * target variables, or NULL */
2888  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2889  * target constraints, or NULL */
2890  SCIP_Bool global, /**< create a global or a local copy? */
2891  int* ncutsadded /**< pointer to store number of copied cuts, or NULL */
2892  )
2893 {
2894  SCIP_CUT** cuts;
2895  int ncuts;
2896  int nlocalcutsadded;
2897 
2898  assert(sourcescip != NULL);
2899  assert(targetscip != NULL);
2900 
2901  /* check stages for both, the source and the target SCIP data structure */
2902  SCIP_CALL( checkStage(sourcescip, "SCIPcopyCuts", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
2903  SCIP_CALL( checkStage(targetscip, "SCIPcopyCuts", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
2904 
2905  if ( ncutsadded != NULL )
2906  *ncutsadded = 0;
2907  nlocalcutsadded = 0;
2908 
2909  /* if we do not have any cuts, nothing can be converted */
2910  if( sourcescip->set->stage < SCIP_STAGE_SOLVING )
2911  return SCIP_OKAY;
2912 
2913  if( SCIPfindConshdlr(targetscip, "linear") == NULL )
2914  {
2915  SCIPdebugMessage("No linear constraint handler available. Cannot convert cuts.\n");
2916  return SCIP_OKAY;
2917  }
2918 
2919  /* convert cut from global cut pool */
2920  cuts = SCIPgetPoolCuts(sourcescip);
2921  ncuts = SCIPgetNPoolCuts(sourcescip);
2922 
2923  SCIP_CALL( copyCuts(sourcescip, targetscip, cuts, ncuts, varmap, consmap, global, &nlocalcutsadded) );
2924 
2925  if( ncutsadded != NULL )
2926  *ncutsadded = nlocalcutsadded;
2927 
2928  SCIPdebugMessage("Converted %d active cuts to constraints.\n", nlocalcutsadded);
2929 
2930  /* convert delayed cuts from global delayed cut pool */
2931  cuts = SCIPgetDelayedPoolCuts(sourcescip);
2932  ncuts = SCIPgetNDelayedPoolCuts(sourcescip);
2933 
2934  SCIP_CALL( copyCuts(sourcescip, targetscip, cuts, ncuts, varmap, consmap, global, &nlocalcutsadded) );
2935 
2936  if( ncutsadded != NULL )
2937  *ncutsadded += nlocalcutsadded;
2938 
2939  SCIPdebugMessage("Converted %d active cuts to constraints.\n", nlocalcutsadded);
2940 
2941  return SCIP_OKAY;
2942 }
2943 
2944 /** copies implications and cliques of sourcescip to targetscip
2945  *
2946  * This function should be called for a targetscip in transformed stage. It can save time in presolving of the
2947  * targetscip, since implications and cliques are copied.
2948  *
2949  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2950  * @note Do not change the source SCIP environment during the copying process
2951  *
2952  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2953  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2954  *
2955  * @pre This method can be called if sourcescip is in one of the following stages:
2956  * - \ref SCIP_STAGE_TRANSFORMED
2957  * - \ref SCIP_STAGE_INITPRESOLVE
2958  * - \ref SCIP_STAGE_PRESOLVING
2959  * - \ref SCIP_STAGE_EXITPRESOLVE
2960  * - \ref SCIP_STAGE_PRESOLVED
2961  * - \ref SCIP_STAGE_SOLVING
2962  * - \ref SCIP_STAGE_SOLVED
2963  * - \ref SCIP_STAGE_EXITSOLVE
2964  *
2965  * @pre This method can be called if targetscip is in one of the following stages:
2966  * - \ref SCIP_STAGE_TRANSFORMED
2967  * - \ref SCIP_STAGE_INITPRESOLVE
2968  * - \ref SCIP_STAGE_PRESOLVING
2969  * - \ref SCIP_STAGE_EXITPRESOLVE
2970  * - \ref SCIP_STAGE_PRESOLVED
2971  * - \ref SCIP_STAGE_INITSOLVE
2972  * - \ref SCIP_STAGE_SOLVING
2973  *
2974  * @note sourcescip stage does not get changed
2975  *
2976  * @note targetscip stage does not get changed
2977  *
2978  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2979  */
2981  SCIP* sourcescip, /**< source SCIP data structure */
2982  SCIP* targetscip, /**< target SCIP data structure */
2983  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
2984  * target variables, or NULL */
2985  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2986  * target constraints, or NULL */
2987  SCIP_Bool global, /**< create a global or a local copy? */
2988  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
2989  int* nbdchgs, /**< pointer to store the number of performed bound changes, or NULL */
2990  int* ncopied /**< pointer to store number of copied implications and cliques, or NULL */
2991  )
2992 {
2993  SCIP_CLIQUE** cliques;
2994  SCIP_VAR** sourcevars;
2995  SCIP_Bool success;
2996  int nvars;
2997  int nbinvars;
2998  int ncliques;
2999  int j;
3000  int c;
3001 
3002  assert( sourcescip != NULL );
3003  assert( targetscip != NULL );
3004  assert( sourcescip != targetscip );
3005  assert( infeasible != NULL );
3006 
3007  /* check stages for both, the source and the target SCIP data structure */
3008  SCIP_CALL( checkStage(sourcescip, "SCIPcopyImplicationsCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
3009  SCIP_CALL( checkStage(targetscip, "SCIPcopyImplicationsCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
3010 
3011  if ( ncopied != NULL )
3012  *ncopied = 0;
3013  if ( nbdchgs != NULL )
3014  *nbdchgs = 0;
3015 
3016  /* get all active variables */
3017  SCIP_CALL( SCIPgetVarsData(sourcescip, &sourcevars, &nvars, &nbinvars, NULL, NULL, NULL) );
3018 
3019  /* stop if no possible variables for cliques exist */
3020  if ( nbinvars == 0 )
3021  return SCIP_OKAY;
3022 
3023  /* get cliques */
3024  ncliques = SCIPgetNCliques(sourcescip);
3025  if ( ncliques > 0 )
3026  {
3027  SCIP_VAR** targetclique;
3028 
3029  /* get space for target cliques */
3030  SCIP_CALL( SCIPallocBufferArray(targetscip, &targetclique, nvars) );
3031  cliques = SCIPgetCliques(sourcescip);
3032 
3033  /* loop through all cliques */
3034  for (c = 0; c < ncliques; ++c)
3035  {
3036  SCIP_VAR** cliquevars;
3037  SCIP_Bool* cliquevals;
3038  int cliquesize;
3039  int nboundchg = 0;
3040 
3041  assert( cliques[c] != NULL );
3042  cliquevals = SCIPcliqueGetValues(cliques[c]);
3043  cliquevars = SCIPcliqueGetVars(cliques[c]);
3044  cliquesize = SCIPcliqueGetNVars(cliques[c]);
3045 
3046  /* get target variables of clique */
3047  for (j = 0; j < cliquesize; ++j)
3048  {
3049  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, cliquevars[j], &targetclique[j], varmap, consmap, global, &success) );
3050  if ( ! success )
3051  {
3052  SCIPdebugMessage("Getting copy for variable <%s> failed.\n", SCIPvarGetName(cliquevars[j]));
3053  SCIPfreeBufferArray(targetscip, &targetclique);
3054  return SCIP_OKAY;
3055  }
3056  }
3057 
3058  /* create clique */
3059  SCIP_CALL( SCIPaddClique(targetscip, targetclique, cliquevals, cliquesize, SCIPcliqueIsEquation(cliques[c]),
3060  infeasible, &nboundchg) );
3061 
3062  if ( *infeasible )
3063  {
3064  SCIPfreeBufferArray(targetscip, &targetclique);
3065  return SCIP_OKAY;
3066  }
3067  if ( ncopied != NULL )
3068  ++(*ncopied);
3069  if ( nbdchgs != NULL )
3070  *nbdchgs += nboundchg;
3071  }
3072  SCIPfreeBufferArray(targetscip, &targetclique);
3073  }
3074 
3075  /* create binary implications */
3076  for (j = 0; j < nbinvars; ++j)
3077  {
3078  SCIP_VAR* sourcevar;
3079  SCIP_VAR* targetvar;
3080  SCIP_Bool d;
3081 
3082  sourcevar = sourcevars[j];
3083  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourcevar, &targetvar, varmap, consmap, global, &success) );
3084  if ( ! success )
3085  {
3086  SCIPdebugMessage("Getting copy for variable <%s> failed.\n", SCIPvarGetName(sourcevar));
3087  return SCIP_OKAY;
3088  }
3089 
3090  /* consider both possible implications */
3091  for (d = 0; d <= 1; ++d)
3092  {
3093  SCIP_BOUNDTYPE* impltypes;
3094  SCIP_VAR** implvars;
3095  SCIP_Real* implbounds;
3096  int nimpls;
3097  int l;
3098 
3099  nimpls = SCIPvarGetNImpls(sourcevar, d);
3100  if ( nimpls == 0 )
3101  continue;
3102 
3103  impltypes = SCIPvarGetImplTypes(sourcevar, d);
3104  implvars = SCIPvarGetImplVars(sourcevar, d);
3105  implbounds = SCIPvarGetImplBounds(sourcevar, d);
3106 
3107  /* create implications */
3108  for (l = 0; l < nimpls; ++l)
3109  {
3110  SCIP_VAR* implvar;
3111  int nboundchg = 0;
3112 
3113  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, implvars[l], &implvar, varmap, consmap, global, &success) );
3114  if ( ! success )
3115  {
3116  SCIPdebugMessage("Getting copy for variable <%s> failed.\n", SCIPvarGetName(implvars[l]));
3117  return SCIP_OKAY;
3118  }
3119 
3120  SCIP_CALL( SCIPaddVarImplication(targetscip, targetvar, d, implvar, impltypes[l], implbounds[l], infeasible, &nboundchg) );
3121  if ( *infeasible )
3122  return SCIP_OKAY;
3123  if ( ncopied != NULL )
3124  ++(*ncopied);
3125  if ( nbdchgs != NULL )
3126  *nbdchgs += nboundchg;
3127  }
3128  }
3129  }
3130 
3131  return SCIP_OKAY;
3132 }
3133 
3134 /** copies parameter settings from sourcescip to targetscip
3135  *
3136  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3137  * @note Do not change the source SCIP environment during the copying process
3138  *
3139  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3140  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3141  *
3142  * @pre This method can be called if sourcescip is in one of the following stages:
3143  * - \ref SCIP_STAGE_PROBLEM
3144  * - \ref SCIP_STAGE_TRANSFORMED
3145  * - \ref SCIP_STAGE_INITPRESOLVE
3146  * - \ref SCIP_STAGE_PRESOLVING
3147  * - \ref SCIP_STAGE_EXITPRESOLVE
3148  * - \ref SCIP_STAGE_PRESOLVED
3149  * - \ref SCIP_STAGE_INITSOLVE
3150  * - \ref SCIP_STAGE_SOLVING
3151  * - \ref SCIP_STAGE_SOLVED
3152  *
3153  * @pre This method can be called if targetscip is in one of the following stages:
3154  * - \ref SCIP_STAGE_INIT
3155  * - \ref SCIP_STAGE_PROBLEM
3156  * - \ref SCIP_STAGE_FREE
3157  *
3158  * @note sourcescip stage does not get changed
3159  *
3160  * @note targetscip stage does not get changed
3161  *
3162  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3163  */
3165  SCIP* sourcescip, /**< source SCIP data structure */
3166  SCIP* targetscip /**< target SCIP data structure */
3167  )
3168 {
3169  assert(sourcescip != NULL);
3170  assert(targetscip != NULL);
3171  assert(sourcescip->set != NULL);
3172  assert(targetscip->set != NULL);
3173 
3174  /* check stages for both, the source and the target SCIP data structure */
3175  SCIP_CALL( checkStage(sourcescip, "SCIPcopyParamSettings", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3176  SCIP_CALL( checkStage(targetscip, "SCIPcopyParamSettings", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
3177 
3178  SCIP_CALL( SCIPsetCopyParams(sourcescip->set, targetscip->set, targetscip->messagehdlr) );
3179 
3180  return SCIP_OKAY;
3181 }
3182 
3183 /** gets depth of current scip instance (increased by each copy call)
3184  *
3185  * @return Depth of subscip of SCIP is returned.
3186  *
3187  * @pre This method can be called if SCIP is in one of the following stages:
3188  * - \ref SCIP_STAGE_PROBLEM
3189  * - \ref SCIP_STAGE_TRANSFORMING
3190  * - \ref SCIP_STAGE_TRANSFORMED
3191  * - \ref SCIP_STAGE_INITPRESOLVE
3192  * - \ref SCIP_STAGE_PRESOLVING
3193  * - \ref SCIP_STAGE_EXITPRESOLVE
3194  * - \ref SCIP_STAGE_PRESOLVED
3195  * - \ref SCIP_STAGE_INITSOLVE
3196  * - \ref SCIP_STAGE_SOLVING
3197  * - \ref SCIP_STAGE_SOLVED
3198  * - \ref SCIP_STAGE_EXITSOLVE
3199  * - \ref SCIP_STAGE_FREETRANS
3200  *
3201  * @note SCIP stage does not get changed
3202  *
3203  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3204  */
3206  SCIP* scip /**< SCIP data structure */
3207  )
3208 {
3209  assert( scip != NULL );
3210  assert( scip->stat != NULL );
3211 
3212  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSubscipDepth", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
3213 
3214  return scip->stat->subscipdepth;
3215 }
3216 
3217 /** copies source SCIP to target SCIP; the copying process is done in the following order:
3218  * 1) copy the plugins
3219  * 2) copy the settings
3220  * 3) create problem data in target-SCIP and copy the problem data of the source-SCIP
3221  * 4) copy all active variables
3222  * 5) copy all constraints
3223  *
3224  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
3225  *
3226  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3227  * Also, 'passmessagehdlr' should be set to FALSE.
3228  * @note Do not change the source SCIP environment during the copying process
3229  *
3230  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3231  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3232  *
3233  * @pre This method can be called if sourcescip is in one of the following stages:
3234  * - \ref SCIP_STAGE_PROBLEM
3235  * - \ref SCIP_STAGE_TRANSFORMED
3236  * - \ref SCIP_STAGE_INITPRESOLVE
3237  * - \ref SCIP_STAGE_PRESOLVING
3238  * - \ref SCIP_STAGE_EXITPRESOLVE
3239  * - \ref SCIP_STAGE_PRESOLVED
3240  * - \ref SCIP_STAGE_INITSOLVE
3241  * - \ref SCIP_STAGE_SOLVING
3242  * - \ref SCIP_STAGE_SOLVED
3243  *
3244  * @pre This method can be called if targetscip is in one of the following stages:
3245  * - \ref SCIP_STAGE_INIT
3246  * - \ref SCIP_STAGE_FREE
3247  *
3248  * @note sourcescip stage does not get changed
3249  *
3250  * @note targetscip stage does not get changed
3251  *
3252  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3253  */
3255  SCIP* sourcescip, /**< source SCIP data structure */
3256  SCIP* targetscip, /**< target SCIP data structure */
3257  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3258  * target variables, or NULL */
3259  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3260  * target constraints, or NULL */
3261  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
3262  SCIP_Bool global, /**< create a global or a local copy? */
3263  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
3264  * plugins will be copied and activated, and the modifiable flag of
3265  * constraints will be respected. If FALSE, valid will be set to FALSE, when
3266  * there are pricers present */
3267  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
3268  SCIP_Bool* valid /**< pointer to store whether the copying was valid or not */
3269  )
3270 {
3271  SCIP_HASHMAP* localvarmap;
3272  SCIP_HASHMAP* localconsmap;
3273  SCIP_Real startcopytime;
3274  SCIP_Real copytime;
3275  SCIP_Bool uselocalvarmap;
3276  SCIP_Bool uselocalconsmap;
3277  SCIP_Bool consscopyvalid;
3278  SCIP_Bool msghdlrquiet;
3279  char name[SCIP_MAXSTRLEN];
3280 
3281  assert(sourcescip != NULL);
3282  assert(targetscip != NULL);
3283  assert(suffix != NULL);
3284  assert(valid != NULL);
3285 
3286  /* check stages for both, the source and the target SCIP data structure */
3287  SCIP_CALL( checkStage(sourcescip, "SCIPcopy", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3288  SCIP_CALL( checkStage(targetscip, "SCIPcopy", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
3289 
3290  /* get time before start of copy procedure */
3291  startcopytime = SCIPclockGetTime(sourcescip->stat->copyclock);
3292 
3293  /* start time measuring */
3294  SCIPclockStart(sourcescip->stat->copyclock, sourcescip->set);
3295 
3296  /* in case there are active pricers and pricing is disabled the target SCIP will not be a valid copy of the source
3297  * SCIP
3298  */
3299  (*valid) = enablepricing || (SCIPgetNActivePricers(sourcescip) == 0);
3300 
3301  /* copy all plugins */
3302  SCIP_CALL( SCIPcopyPlugins(sourcescip, targetscip, TRUE, enablepricing, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
3303  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, passmessagehdlr, valid) );
3304 
3305  SCIPdebugMessage("Copying plugins was%s valid.\n", *valid ? "" : " not");
3306 
3307  uselocalvarmap = (varmap == NULL);
3308  uselocalconsmap = (consmap == NULL);
3309 
3310  if( uselocalvarmap )
3311  {
3312  /* create the variable mapping hash map */
3313  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNVars(sourcescip))) );
3314  }
3315  else
3316  localvarmap = varmap;
3317 
3318  if( uselocalconsmap )
3319  {
3320  /* create the constraint mapping hash map */
3321  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNConss(sourcescip))) );
3322  }
3323  else
3324  localconsmap = consmap;
3325 
3326  /* construct name for the target SCIP using the source problem name and the given suffix string */
3327  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPgetProbName(sourcescip), suffix);
3328 
3329  /* store the quiet state of the message handler, if existent */
3330  msghdlrquiet = SCIPmessagehdlrIsQuiet(targetscip->messagehdlr);
3331 
3332  /* explicitly suppress output when copying parameters */
3333  SCIPsetMessagehdlrQuiet(targetscip, TRUE);
3334  /* copy all settings */
3335  SCIP_CALL( SCIPcopyParamSettings(sourcescip, targetscip) );
3336 
3337  /* restore original quiet state */
3338  SCIPsetMessagehdlrQuiet(targetscip, msghdlrquiet);
3339 
3340  /* create problem in the target SCIP and copying the source original problem data */
3341  SCIP_CALL( SCIPcopyProb(sourcescip, targetscip, localvarmap, localconsmap, global, name) );
3342 
3343  /* copy all original variables */
3344  SCIP_CALL( SCIPcopyVars(sourcescip, targetscip, localvarmap, localconsmap, global) );
3345 
3346  /* copy all original constraints */
3347  SCIP_CALL( SCIPcopyConss(sourcescip, targetscip, localvarmap, localconsmap, global, enablepricing, &consscopyvalid) );
3348  (*valid) = *valid && consscopyvalid;
3349 
3350  SCIPdebugMessage("Copying constraints was%s valid.\n", consscopyvalid ? "" : " not");
3351 
3352  if( uselocalvarmap )
3353  {
3354  /* free hash map */
3355  SCIPhashmapFree(&localvarmap);
3356  }
3357 
3358  if( uselocalconsmap )
3359  {
3360  /* free hash map */
3361  SCIPhashmapFree(&localconsmap);
3362  }
3363 
3364  /* stop time measuring */
3365  SCIPclockStop(sourcescip->stat->copyclock, sourcescip->set);
3366 
3367  /* get time after copying procedure */
3368  copytime = SCIPclockGetTime(sourcescip->stat->copyclock) - startcopytime;
3369 
3370  if( copytime > sourcescip->stat->maxcopytime )
3371  sourcescip->stat->maxcopytime = copytime;
3372  if( copytime < sourcescip->stat->mincopytime )
3373  sourcescip->stat->mincopytime = copytime;
3374 
3375  /* increase copy counter */
3376  ++(sourcescip->stat->ncopies);
3377 
3378  return SCIP_OKAY;
3379 }
3380 
3381 
3382 /** copies source SCIP original problem to target SCIP; the copying process is done in the following order:
3383  * 1) copy the plugins
3384  * 2) copy the settings
3385  * 3) create problem data in target-SCIP and copy the original problem data of the source-SCIP
3386  * 4) copy all original variables
3387  * 5) copy all original constraints
3388  *
3389  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
3390  *
3391  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3392  * Also, 'passmessagehdlr' should be set to FALSE.
3393  * @note Do not change the source SCIP environment during the copying process
3394  *
3395  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3396  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3397  *
3398  * @pre This method can be called if sourcescip is in one of the following stages:
3399  * - \ref SCIP_STAGE_PROBLEM
3400  * - \ref SCIP_STAGE_TRANSFORMED
3401  * - \ref SCIP_STAGE_INITPRESOLVE
3402  * - \ref SCIP_STAGE_PRESOLVING
3403  * - \ref SCIP_STAGE_EXITPRESOLVE
3404  * - \ref SCIP_STAGE_PRESOLVED
3405  * - \ref SCIP_STAGE_INITSOLVE
3406  * - \ref SCIP_STAGE_SOLVING
3407  * - \ref SCIP_STAGE_SOLVED
3408  *
3409  * @pre This method can be called if targetscip is in one of the following stages:
3410  * - \ref SCIP_STAGE_INIT
3411  * - \ref SCIP_STAGE_FREE
3412  *
3413  * @note sourcescip stage does not get changed
3414  *
3415  * @note targetscip stage does not get changed
3416  *
3417  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3418  */
3420  SCIP* sourcescip, /**< source SCIP data structure */
3421  SCIP* targetscip, /**< target SCIP data structure */
3422  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3423  * target variables, or NULL */
3424  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3425  * target constraints, or NULL */
3426  const char* suffix, /**< suffix which will be added to the names of the target SCIP, might be empty */
3427  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
3428  * plugins will be copied and activated, and the modifiable flag of
3429  * constraints will be respected. If FALSE, valid will be set to FALSE, when
3430  * there are pricers present */
3431  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
3432  SCIP_Bool* valid /**< pointer to store whether the copying was valid or not */
3433  )
3434 {
3435  SCIP_HASHMAP* localvarmap;
3436  SCIP_HASHMAP* localconsmap;
3437  SCIP_Real startcopytime;
3438  SCIP_Real copytime;
3439  SCIP_Bool uselocalvarmap;
3440  SCIP_Bool uselocalconsmap;
3441  SCIP_Bool consscopyvalid;
3442  char name[SCIP_MAXSTRLEN];
3443 
3444  assert(sourcescip != NULL);
3445  assert(targetscip != NULL);
3446  assert(suffix != NULL);
3447  assert(valid != NULL);
3448 
3449  /* check stages for both, the source and the target SCIP data structure */
3450  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3451  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrig", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
3452 
3453  /* get time before start of copy procedure */
3454  startcopytime = SCIPclockGetTime(sourcescip->stat->copyclock);
3455 
3456  /* start time measuring */
3457  SCIPclockStart(sourcescip->stat->copyclock, sourcescip->set);
3458 
3459  /* in case there are active pricers and pricing is disabled the target SCIP will not be a valid copy of the source
3460  * SCIP
3461  */
3462  (*valid) = enablepricing || (SCIPgetNActivePricers(sourcescip) == 0);
3463 
3464  /* copy all plugins */
3465  SCIP_CALL( SCIPcopyPlugins(sourcescip, targetscip, TRUE, enablepricing, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
3466  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, passmessagehdlr, valid) );
3467 
3468  SCIPdebugMessage("Copying plugins was%s valid.\n", *valid ? "" : " not");
3469 
3470  uselocalvarmap = (varmap == NULL);
3471  uselocalconsmap = (consmap == NULL);
3472 
3473  if( uselocalvarmap )
3474  {
3475  /* create the variable mapping hash map */
3476  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNVars(sourcescip))) );
3477  }
3478  else
3479  localvarmap = varmap;
3480 
3481  if( uselocalconsmap )
3482  {
3483  /* create the constraint mapping hash map */
3484  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * SCIPgetNConss(sourcescip))) );
3485  }
3486  else
3487  localconsmap = consmap;
3488 
3489  /* construct name for the target SCIP using the source problem name and the given suffix string */
3490  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPgetProbName(sourcescip), suffix);
3491 
3492  /* copy all settings */
3493  SCIP_CALL( SCIPcopyParamSettings(sourcescip, targetscip) );
3494 
3495  /* create problem in the target SCIP and copying the source problem data */
3496  SCIP_CALL( SCIPcopyOrigProb(sourcescip, targetscip, localvarmap, localconsmap, name) );
3497 
3498  /* copy all active variables */
3499  SCIP_CALL( SCIPcopyOrigVars(sourcescip, targetscip, localvarmap, localconsmap) );
3500 
3501  /* copy all constraints */
3502  SCIP_CALL( SCIPcopyOrigConss(sourcescip, targetscip, localvarmap, localconsmap, enablepricing, &consscopyvalid) );
3503  (*valid) = *valid && consscopyvalid;
3504 
3505  SCIPdebugMessage("Copying constraints was%s valid.\n", consscopyvalid ? "" : " not");
3506 
3507  if( uselocalvarmap )
3508  {
3509  /* free hash map */
3510  SCIPhashmapFree(&localvarmap);
3511  }
3512 
3513  if( uselocalconsmap )
3514  {
3515  /* free hash map */
3516  SCIPhashmapFree(&localconsmap);
3517  }
3518 
3519  /* stop time measuring */
3520  SCIPclockStop(sourcescip->stat->copyclock, sourcescip->set);
3521 
3522  /* get time after copying procedure */
3523  copytime = SCIPclockGetTime(sourcescip->stat->copyclock) - startcopytime;
3524 
3525  if( copytime > sourcescip->stat->maxcopytime )
3526  sourcescip->stat->maxcopytime = copytime;
3527  if( copytime < sourcescip->stat->mincopytime )
3528  sourcescip->stat->mincopytime = copytime;
3529 
3530  /* increase copy counter */
3531  ++(sourcescip->stat->ncopies);
3532 
3533  return SCIP_OKAY;
3534 }
3535 
3536 
3537 
3538 /*
3539  * parameter settings
3540  */
3541 
3542 /** creates a SCIP_Bool parameter, sets it to its default value, and adds it to the parameter set
3543  *
3544  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3545  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3546  */
3548  SCIP* scip, /**< SCIP data structure */
3549  const char* name, /**< name of the parameter */
3550  const char* desc, /**< description of the parameter */
3551  SCIP_Bool* valueptr, /**< pointer to store the current parameter value, or NULL */
3552  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
3553  SCIP_Bool defaultvalue, /**< default value of the parameter */
3554  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
3555  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
3556  )
3557 {
3558  assert(scip != NULL);
3559  assert(scip->set != NULL);
3560  assert(scip->mem != NULL);
3561 
3562  SCIP_CALL( SCIPsetAddBoolParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
3563  defaultvalue, paramchgd, paramdata) );
3564 
3565  return SCIP_OKAY;
3566 }
3567 
3568 /** creates a int parameter, sets it to its default value, and adds it to the parameter set
3569  *
3570  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3571  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3572  */
3574  SCIP* scip, /**< SCIP data structure */
3575  const char* name, /**< name of the parameter */
3576  const char* desc, /**< description of the parameter */
3577  int* valueptr, /**< pointer to store the current parameter value, or NULL */
3578  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
3579  int defaultvalue, /**< default value of the parameter */
3580  int minvalue, /**< minimum value for parameter */
3581  int maxvalue, /**< maximum value for parameter */
3582  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
3583  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
3584  )
3585 {
3586  assert(scip != NULL);
3587  assert(scip->set != NULL);
3588  assert(scip->mem != NULL);
3589 
3590  SCIP_CALL( SCIPsetAddIntParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
3591  defaultvalue, minvalue, maxvalue, paramchgd, paramdata) );
3592 
3593  return SCIP_OKAY;
3594 }
3595 
3596 /** creates a SCIP_Longint parameter, sets it to its default value, and adds it to the parameter set
3597  *
3598  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3599  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3600  */
3602  SCIP* scip, /**< SCIP data structure */
3603  const char* name, /**< name of the parameter */
3604  const char* desc, /**< description of the parameter */
3605  SCIP_Longint* valueptr, /**< pointer to store the current parameter value, or NULL */
3606  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
3607  SCIP_Longint defaultvalue, /**< default value of the parameter */
3608  SCIP_Longint minvalue, /**< minimum value for parameter */
3609  SCIP_Longint maxvalue, /**< maximum value for parameter */
3610  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
3611  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
3612  )
3613 {
3614  assert(scip != NULL);
3615  assert(scip->set != NULL);
3616  assert(scip->mem != NULL);
3617 
3618  SCIP_CALL( SCIPsetAddLongintParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
3619  defaultvalue, minvalue, maxvalue, paramchgd, paramdata) );
3620 
3621  return SCIP_OKAY;
3622 }
3623 
3624 /** creates a SCIP_Real parameter, sets it to its default value, and adds it to the parameter set
3625  *
3626  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3627  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3628  */
3630  SCIP* scip, /**< SCIP data structure */
3631  const char* name, /**< name of the parameter */
3632  const char* desc, /**< description of the parameter */
3633  SCIP_Real* valueptr, /**< pointer to store the current parameter value, or NULL */
3634  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
3635  SCIP_Real defaultvalue, /**< default value of the parameter */
3636  SCIP_Real minvalue, /**< minimum value for parameter */
3637  SCIP_Real maxvalue, /**< maximum value for parameter */
3638  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
3639  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
3640  )
3641 {
3642  assert(scip != NULL);
3643  assert(scip->set != NULL);
3644  assert(scip->mem != NULL);
3645 
3646  SCIP_CALL( SCIPsetAddRealParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
3647  defaultvalue, minvalue, maxvalue, paramchgd, paramdata) );
3648 
3649  return SCIP_OKAY;
3650 }
3651 
3652 /** creates a char parameter, sets it to its default value, and adds it to the parameter set
3653  *
3654  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3655  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3656  */
3658  SCIP* scip, /**< SCIP data structure */
3659  const char* name, /**< name of the parameter */
3660  const char* desc, /**< description of the parameter */
3661  char* valueptr, /**< pointer to store the current parameter value, or NULL */
3662  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
3663  char defaultvalue, /**< default value of the parameter */
3664  const char* allowedvalues, /**< array with possible parameter values, or NULL if not restricted */
3665  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
3666  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
3667  )
3668 {
3669  assert(scip != NULL);
3670  assert(scip->set != NULL);
3671  assert(scip->mem != NULL);
3672 
3673  SCIP_CALL( SCIPsetAddCharParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
3674  defaultvalue, allowedvalues, paramchgd, paramdata) );
3675 
3676  return SCIP_OKAY;
3677 }
3678 
3679 /** creates a string(char*) parameter, sets it to its default value, and adds it to the parameter set
3680  *
3681  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3682  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3683  */
3685  SCIP* scip, /**< SCIP data structure */
3686  const char* name, /**< name of the parameter */
3687  const char* desc, /**< description of the parameter */
3688  char** valueptr, /**< pointer to store the current parameter value, or NULL; if not NULL then *valueptr should be NULL */
3689  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
3690  const char* defaultvalue, /**< default value of the parameter */
3691  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
3692  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
3693  )
3694 {
3695  assert(scip != NULL);
3696  assert(scip->set != NULL);
3697  assert(scip->mem != NULL);
3698 
3699  SCIP_CALL( SCIPsetAddStringParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
3700  defaultvalue, paramchgd, paramdata) );
3701 
3702  return SCIP_OKAY;
3703 }
3704 
3705 /** gets the fixing status of an existing parameter
3706  *
3707  * @return TRUE if the parameter is fixed to a value, otherwise FALSE.
3708  */
3710  SCIP* scip, /**< SCIP data structure */
3711  const char* name /**< name of the parameter */
3712  )
3713 {
3714  assert(scip != NULL);
3715  assert(scip->set != NULL);
3716 
3717  return SCIPsetIsParamFixed(scip->set, name);
3718 }
3719 
3720 /** returns the pointer to the SCIP parameter with the given name
3721  *
3722  * @return pointer to the parameter with the given name
3723  */
3725  SCIP* scip, /**< SCIP data structure */
3726  const char* name /**< name of the parameter */
3727  )
3728 {
3729  assert(scip != NULL);
3730  assert(scip->set != NULL);
3731 
3732  return SCIPsetGetParam(scip->set, name);
3733 }
3734 
3735 /** gets the value of an existing SCIP_Bool parameter
3736  *
3737  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3738  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3739  */
3741  SCIP* scip, /**< SCIP data structure */
3742  const char* name, /**< name of the parameter */
3743  SCIP_Bool* value /**< pointer to store the parameter */
3744  )
3745 {
3746  assert(scip != NULL);
3747  assert(scip->set != NULL);
3748 
3749  SCIP_CALL( SCIPsetGetBoolParam(scip->set, name, value) );
3750 
3751  return SCIP_OKAY;
3752 }
3753 
3754 /** gets the value of an existing int parameter
3755  *
3756  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3757  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3758  */
3760  SCIP* scip, /**< SCIP data structure */
3761  const char* name, /**< name of the parameter */
3762  int* value /**< pointer to store the parameter */
3763  )
3764 {
3765  assert(scip != NULL);
3766  assert(scip->set != NULL);
3767 
3768  SCIP_CALL( SCIPsetGetIntParam(scip->set, name, value) );
3769 
3770  return SCIP_OKAY;
3771 }
3772 
3773 /** gets the value of an existing SCIP_Longint parameter
3774  *
3775  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3776  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3777  */
3779  SCIP* scip, /**< SCIP data structure */
3780  const char* name, /**< name of the parameter */
3781  SCIP_Longint* value /**< pointer to store the parameter */
3782  )
3783 {
3784  assert(scip != NULL);
3785  assert(scip->set != NULL);
3786 
3787  SCIP_CALL( SCIPsetGetLongintParam(scip->set, name, value) );
3788 
3789  return SCIP_OKAY;
3790 }
3791 
3792 /** gets the value of an existing SCIP_Real parameter
3793  *
3794  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3795  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3796  */
3798  SCIP* scip, /**< SCIP data structure */
3799  const char* name, /**< name of the parameter */
3800  SCIP_Real* value /**< pointer to store the parameter */
3801  )
3802 {
3803  assert(scip != NULL);
3804  assert(scip->set != NULL);
3805 
3806  SCIP_CALL( SCIPsetGetRealParam(scip->set, name, value) );
3807 
3808  return SCIP_OKAY;
3809 }
3810 
3811 /** gets the value of an existing char parameter
3812  *
3813  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3814  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3815  */
3817  SCIP* scip, /**< SCIP data structure */
3818  const char* name, /**< name of the parameter */
3819  char* value /**< pointer to store the parameter */
3820  )
3821 {
3822  assert(scip != NULL);
3823  assert(scip->set != NULL);
3824 
3825  SCIP_CALL( SCIPsetGetCharParam(scip->set, name, value) );
3826 
3827  return SCIP_OKAY;
3828 }
3829 
3830 /** gets the value of an existing string(char*) parameter
3831  *
3832  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3833  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3834  */
3836  SCIP* scip, /**< SCIP data structure */
3837  const char* name, /**< name of the parameter */
3838  char** value /**< pointer to store the parameter */
3839  )
3840 {
3841  assert(scip != NULL);
3842  assert(scip->set != NULL);
3843 
3844  SCIP_CALL( SCIPsetGetStringParam(scip->set, name, value) );
3845 
3846  return SCIP_OKAY;
3847 }
3848 
3849 /** fixes the value of an existing parameter
3850  *
3851  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3852  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3853  *
3854  * @note: Be careful with this method! Some general settings, e.g., the time or node limit, should not be fixed because
3855  * they have to be changed for sub-SCIPs.
3856  */
3858  SCIP* scip, /**< SCIP data structure */
3859  const char* name /**< name of the parameter */
3860  )
3861 {
3862  assert(scip != NULL);
3863  assert(scip->set != NULL);
3864 
3865  SCIP_CALL( SCIPsetChgParamFixed(scip->set, name, TRUE) );
3866 
3867  return SCIP_OKAY;
3868 }
3869 
3870 /** unfixes the value of an existing parameter
3871  *
3872  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3873  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3874  */
3876  SCIP* scip, /**< SCIP data structure */
3877  const char* name /**< name of the parameter */
3878  )
3879 {
3880  assert(scip != NULL);
3881  assert(scip->set != NULL);
3882 
3883  SCIP_CALL( SCIPsetChgParamFixed(scip->set, name, FALSE) );
3884 
3885  return SCIP_OKAY;
3886 }
3887 
3888 /** changes the value of an existing parameter
3889  *
3890  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3891  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3892  */
3894  SCIP* scip, /**< SCIP data structure */
3895  const char* name, /**< name of the parameter */
3896  void* value /**< new value of the parameter */
3897  )
3898 {
3899  assert(scip != NULL);
3900  assert(scip->set != NULL);
3901 
3902  SCIP_CALL( SCIPsetSetParam(scip->set, scip->messagehdlr, name, value) );
3903 
3904  return SCIP_OKAY;
3905 }
3906 
3907 /** changes the value of an existing SCIP_Bool parameter
3908  *
3909  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3910  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3911  */
3913  SCIP* scip, /**< SCIP data structure */
3914  SCIP_PARAM* param, /**< parameter */
3915  SCIP_Bool value /**< new value of the parameter */
3916  )
3917 {
3918  SCIP_RETCODE retcode;
3919 
3920  assert(scip != NULL);
3921  assert(scip->set != NULL);
3922 
3923  retcode = SCIPsetChgBoolParam(scip->set, scip->messagehdlr, param, value);
3924 
3925  if( retcode != SCIP_PARAMETERWRONGVAL )
3926  {
3927  SCIP_CALL( retcode );
3928  }
3929 
3930  return retcode;
3931 }
3932 
3933 /** changes the value of an existing SCIP_Bool parameter
3934  *
3935  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3936  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3937  */
3939  SCIP* scip, /**< SCIP data structure */
3940  const char* name, /**< name of the parameter */
3941  SCIP_Bool value /**< new value of the parameter */
3942  )
3943 {
3944  assert(scip != NULL);
3945  assert(scip->set != NULL);
3946 
3947  SCIP_CALL( SCIPsetSetBoolParam(scip->set, scip->messagehdlr, name, value) );
3948 
3949  return SCIP_OKAY;
3950 }
3951 
3952 /** checks the value of an existing SCIP_Bool parameter; issues a warning message if value was invalid
3953  *
3954  * @return \ref SCIP_OKAY is returned if value is valid. Otherwise \ref SCIP_PARAMETERWRONGVAL is returned.
3955  */
3957  SCIP* scip, /**< SCIP data structure */
3958  SCIP_PARAM* param, /**< parameter */
3959  SCIP_Bool value /**< value to check */
3960  )
3961 {
3962  assert(scip != NULL);
3963  assert(param != NULL);
3964 
3965  SCIP_CALL_QUIET( SCIPparamCheckBool(param, scip->messagehdlr, value) );
3966 
3967  return SCIP_OKAY;
3968 }
3969 
3970 /** changes the value of an existing int parameter
3971  *
3972  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3973  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3974  */
3976  SCIP* scip, /**< SCIP data structure */
3977  SCIP_PARAM* param, /**< parameter */
3978  int value /**< new value of the parameter */
3979  )
3980 {
3981  SCIP_RETCODE retcode;
3982 
3983  assert(scip != NULL);
3984  assert(scip->set != NULL);
3985 
3986  retcode = SCIPsetChgIntParam(scip->set, scip->messagehdlr, param, value);
3987 
3988  if( retcode != SCIP_PARAMETERWRONGVAL )
3989  {
3990  SCIP_CALL( retcode );
3991  }
3992 
3993  return retcode;
3994 }
3995 
3996 /** changes the value of an existing int parameter
3997  *
3998  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3999  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4000  */
4002  SCIP* scip, /**< SCIP data structure */
4003  const char* name, /**< name of the parameter */
4004  int value /**< new value of the parameter */
4005  )
4006 {
4007  assert(scip != NULL);
4008  assert(scip->set != NULL);
4009 
4010  SCIP_CALL( SCIPsetSetIntParam(scip->set, scip->messagehdlr, name, value) );
4011 
4012  return SCIP_OKAY;
4013 }
4014 
4015 /** changes the value of an existing SCIP_Longint parameter
4016  *
4017  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4018  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4019  */
4021  SCIP* scip, /**< SCIP data structure */
4022  SCIP_PARAM* param, /**< parameter */
4023  SCIP_Longint value /**< new value of the parameter */
4024  )
4025 {
4026  SCIP_RETCODE retcode;
4027 
4028  assert(scip != NULL);
4029  assert(scip->set != NULL);
4030 
4031  retcode = SCIPsetChgLongintParam(scip->set, scip->messagehdlr, param, value);
4032 
4033  if( retcode != SCIP_PARAMETERWRONGVAL )
4034  {
4035  SCIP_CALL( retcode );
4036  }
4037 
4038  return retcode;
4039 }
4040 
4041 /** changes the value of an existing SCIP_Longint parameter
4042  *
4043  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4044  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4045  */
4047  SCIP* scip, /**< SCIP data structure */
4048  const char* name, /**< name of the parameter */
4049  SCIP_Longint value /**< new value of the parameter */
4050  )
4051 {
4052  assert(scip != NULL);
4053  assert(scip->set != NULL);
4054 
4055  SCIP_CALL( SCIPsetSetLongintParam(scip->set, scip->messagehdlr, name, value) );
4056 
4057  return SCIP_OKAY;
4058 }
4059 
4060 /** checks parameter value according to the given feasible domain; issues a warning message if value was invalid
4061  *
4062  * @return \ref SCIP_OKAY is returned if value is valid. Otherwise \ref SCIP_PARAMETERWRONGVAL is returned.
4063  */
4065  SCIP* scip, /**< SCIP data structure */
4066  SCIP_PARAM* param, /**< parameter */
4067  SCIP_Longint value /**< value to check */
4068  )
4069 {
4070  assert(scip != NULL);
4071  assert(param != NULL);
4072 
4073  SCIP_CALL_QUIET( SCIPparamCheckLongint(param, scip->messagehdlr, value) );
4074 
4075  return SCIP_OKAY;
4076 }
4077 
4078 /** changes the value of an existing SCIP_Real parameter
4079  *
4080  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4081  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4082  */
4084  SCIP* scip, /**< SCIP data structure */
4085  SCIP_PARAM* param, /**< parameter */
4086  SCIP_Real value /**< new value of the parameter */
4087  )
4088 {
4089  SCIP_RETCODE retcode;
4090 
4091  assert(scip != NULL);
4092  assert(scip->set != NULL);
4093 
4094  retcode = SCIPsetChgRealParam(scip->set, scip->messagehdlr, param, value);
4095 
4096  if( retcode != SCIP_PARAMETERWRONGVAL )
4097  {
4098  SCIP_CALL( retcode );
4099  }
4100 
4101  return retcode;
4102 }
4103 
4104 /** changes the value of an existing SCIP_Real parameter
4105  *
4106  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4107  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4108  */
4110  SCIP* scip, /**< SCIP data structure */
4111  const char* name, /**< name of the parameter */
4112  SCIP_Real value /**< new value of the parameter */
4113  )
4114 {
4115  assert(scip != NULL);
4116  assert(scip->set != NULL);
4117 
4118  SCIP_CALL( SCIPsetSetRealParam(scip->set, scip->messagehdlr, name, value) );
4119 
4120  return SCIP_OKAY;
4121 }
4122 
4123 /** changes the value of an existing char parameter
4124  *
4125  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4126  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4127  */
4129  SCIP* scip, /**< SCIP data structure */
4130  SCIP_PARAM* param, /**< parameter */
4131  char value /**< new value of the parameter */
4132  )
4133 {
4134  SCIP_RETCODE retcode;
4135 
4136  assert(scip != NULL);
4137  assert(scip->set != NULL);
4138 
4139  retcode = SCIPsetChgCharParam(scip->set, scip->messagehdlr, param, value);
4140 
4141  if( retcode != SCIP_PARAMETERWRONGVAL )
4142  {
4143  SCIP_CALL( retcode );
4144  }
4145 
4146  return retcode;
4147 }
4148 
4149 /** changes the value of an existing char parameter
4150  *
4151  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4152  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4153  */
4155  SCIP* scip, /**< SCIP data structure */
4156  const char* name, /**< name of the parameter */
4157  char value /**< new value of the parameter */
4158  )
4159 {
4160  assert(scip != NULL);
4161  assert(scip->set != NULL);
4162 
4163  SCIP_CALL( SCIPsetSetCharParam(scip->set, scip->messagehdlr, name, value) );
4164 
4165  return SCIP_OKAY;
4166 }
4167 
4168 /** checks parameter value according to the given feasible domain; issues a warning message if value was invalid
4169  *
4170  * @return \ref SCIP_OKAY is returned if value is valid. Otherwise \ref SCIP_PARAMETERWRONGVAL is returned.
4171  */
4173  SCIP* scip, /**< SCIP data structure */
4174  SCIP_PARAM* param, /**< parameter */
4175  const char value /**< value to check */
4176  )
4177 {
4178  assert(scip != NULL);
4179  assert(param != NULL);
4180 
4181  SCIP_CALL_QUIET( SCIPparamCheckChar(param, scip->messagehdlr, value) );
4182 
4183  return SCIP_OKAY;
4184 }
4185 
4186 /** changes the value of an existing string(char*) parameter
4187  *
4188  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4189  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4190  */
4192  SCIP* scip, /**< SCIP data structure */
4193  SCIP_PARAM* param, /**< parameter */
4194  const char* value /**< new value of the parameter */
4195  )
4196 {
4197  SCIP_RETCODE retcode;
4198 
4199  assert(scip != NULL);
4200  assert(scip->set != NULL);
4201 
4202  retcode = SCIPsetChgStringParam(scip->set, scip->messagehdlr, param, value);
4203 
4204  if( retcode != SCIP_PARAMETERWRONGVAL )
4205  {
4206  SCIP_CALL( retcode );
4207  }
4208 
4209  return retcode;
4210 }
4211 
4212 /** changes the value of an existing string(char*) parameter
4213  *
4214  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4215  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4216  */
4218  SCIP* scip, /**< SCIP data structure */
4219  const char* name, /**< name of the parameter */
4220  const char* value /**< new value of the parameter */
4221  )
4222 {
4223  assert(scip != NULL);
4224  assert(scip->set != NULL);
4225 
4226  SCIP_CALL( SCIPsetSetStringParam(scip->set, scip->messagehdlr, name, value) );
4227 
4228  return SCIP_OKAY;
4229 }
4230 
4231 /** checks parameter value according to the given feasible domain; issues a warning message if value was invalid
4232  *
4233  * @return \ref SCIP_OKAY is returned if value is valid. Otherwise \ref SCIP_PARAMETERWRONGVAL is returned.
4234  */
4236  SCIP* scip, /**< SCIP data structure */
4237  SCIP_PARAM* param, /**< parameter */
4238  const char* value /**< value to check */
4239  )
4240 {
4241  assert(scip != NULL);
4242  assert(param != NULL);
4243 
4244  SCIP_CALL_QUIET( SCIPparamCheckString(param, scip->messagehdlr, value) );
4245 
4246  return SCIP_OKAY;
4247 }
4248 
4249 /** reads parameters from a file
4250  *
4251  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4252  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4253  */
4255  SCIP* scip, /**< SCIP data structure */
4256  const char* filename /**< file name */
4257  )
4258 {
4259  assert(scip != NULL);
4260  assert(scip->set != NULL);
4261 
4262  SCIP_CALL( SCIPsetReadParams(scip->set, scip->messagehdlr, filename) );
4263 
4264  return SCIP_OKAY;
4265 }
4266 
4267 /** writes a single parameter to a file
4268  *
4269  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4270  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4271  */
4273  SCIP* scip, /**< SCIP data structure */
4274  SCIP_PARAM* param, /**< parameter */
4275  const char* filename, /**< file name, or NULL for stdout */
4276  SCIP_Bool comments, /**< should parameter descriptions be written as comments? */
4277  SCIP_Bool onlychanged /**< should only those parameters be written that are changed from their
4278  * default value?
4279  */
4280  )
4281 {
4282  assert(scip != NULL);
4283  assert(param != NULL);
4284 
4285  SCIP_CALL( SCIPparamWrite(param, scip->messagehdlr, filename, comments, onlychanged) );
4286 
4287  return SCIP_OKAY;
4288 }
4289 
4290 /** writes all parameters in the parameter set to a file
4291  *
4292  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4293  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4294  */
4296  SCIP* scip, /**< SCIP data structure */
4297  const char* filename, /**< file name, or NULL for stdout */
4298  SCIP_Bool comments, /**< should parameter descriptions be written as comments? */
4299  SCIP_Bool onlychanged /**< should only those parameters be written that are changed from their
4300  * default value?
4301  */
4302  )
4303 {
4304  assert(scip != NULL);
4305  assert(scip->set != NULL);
4306 
4307  SCIP_CALL( SCIPsetWriteParams(scip->set, scip->messagehdlr, filename, comments, onlychanged) );
4308 
4309  return SCIP_OKAY;
4310 }
4311 
4312 /** resets a single parameter to its default value
4313  *
4314  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4315  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4316  */
4318  SCIP* scip, /**< SCIP data structure */
4319  const char* name /**< name of the parameter */
4320  )
4321 {
4322  assert(scip != NULL);
4323  assert(scip->set != NULL);
4324 
4325  SCIP_CALL( SCIPsetResetParam(scip->set, scip->messagehdlr, name) );
4326 
4327  return SCIP_OKAY;
4328 }
4329 
4330 /** resets all parameters to their default values
4331  *
4332  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4333  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4334  */
4336  SCIP* scip /**< SCIP data structure */
4337  )
4338 {
4339  assert(scip != NULL);
4340  assert(scip->set != NULL);
4341 
4342  SCIP_CALL( SCIPsetResetParams(scip->set, scip->messagehdlr) );
4343 
4344  return SCIP_OKAY;
4345 }
4346 
4347 /** sets parameters to
4348  *
4349  * - SCIP_PARAMEMPHASIS_DEFAULT to use default values (see also SCIPresetParams())
4350  * - SCIP_PARAMEMPHASIS_COUNTER to get feasible and "fast" counting process
4351  * - SCIP_PARAMEMPHASIS_CPSOLVER to get CP like search (e.g. no LP relaxation)
4352  * - SCIP_PARAMEMPHASIS_EASYCIP to solve easy problems fast
4353  * - SCIP_PARAMEMPHASIS_FEASIBILITY to detect feasibility fast
4354  * - SCIP_PARAMEMPHASIS_HARDLP to be capable to handle hard LPs
4355  * - SCIP_PARAMEMPHASIS_OPTIMALITY to prove optimality fast
4356  *
4357  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4358  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4359  */
4361  SCIP* scip, /**< SCIP data structure */
4362  SCIP_PARAMEMPHASIS paramemphasis, /**< parameter settings */
4363  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4364  )
4365 {
4366  assert(scip != NULL);
4367  assert(scip->set != NULL);
4368 
4369  SCIP_CALL( SCIPsetSetEmphasis(scip->set, scip->messagehdlr, paramemphasis, quiet) );
4370 
4371  return SCIP_OKAY;
4372 }
4373 
4374 /** sets parameters to deactivate separators and heuristics that use auxiliary SCIP instances; should be called for
4375  * auxiliary SCIP instances to avoid recursion
4376  *
4377  * @note only deactivates plugins which could cause recursion, some plugins which use sub-SCIPs stay activated
4378  *
4379  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4380  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4381  */
4383  SCIP* scip, /**< (auxiliary) SCIP data structure */
4384  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4385  )
4386 {
4387  assert(scip != NULL);
4388  assert(scip->set != NULL);
4389 
4390  SCIP_CALL( SCIPsetSetSubscipsOff(scip->set, scip->messagehdlr, quiet) );
4391 
4392  return SCIP_OKAY;
4393 }
4394 
4395 /** sets heuristic parameters values to
4396  *
4397  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all heuristic parameters
4398  * - SCIP_PARAMSETTING_FAST such that the time spend for heuristic is decreased
4399  * - SCIP_PARAMSETTING_AGGRESSIVE such that the heuristic are called more aggregative
4400  * - SCIP_PARAMSETTING_OFF which turn off all heuristics
4401  *
4402  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4403  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4404  */
4406  SCIP* scip, /**< SCIP data structure */
4407  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
4408  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4409  )
4410 {
4411  assert(scip != NULL);
4412  assert(scip->set != NULL);
4413  assert(paramsetting == SCIP_PARAMSETTING_DEFAULT || paramsetting == SCIP_PARAMSETTING_FAST
4414  || paramsetting == SCIP_PARAMSETTING_AGGRESSIVE || paramsetting == SCIP_PARAMSETTING_OFF);
4415 
4416  SCIP_CALL( SCIPsetSetHeuristics(scip->set, scip->messagehdlr, paramsetting, quiet) );
4417 
4418  return SCIP_OKAY;
4419 }
4420 
4421 /** sets presolving parameters to
4422  *
4423  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all presolving parameters
4424  * - SCIP_PARAMSETTING_FAST such that the time spend for presolving is decreased
4425  * - SCIP_PARAMSETTING_AGGRESSIVE such that the presolving is more aggregative
4426  * - SCIP_PARAMSETTING_OFF which turn off all presolving
4427  *
4428  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4429  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4430  */
4432  SCIP* scip, /**< SCIP data structure */
4433  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
4434  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4435  )
4436 {
4437  assert(scip != NULL);
4438  assert(scip->set != NULL);
4439  assert(paramsetting == SCIP_PARAMSETTING_DEFAULT || paramsetting == SCIP_PARAMSETTING_FAST
4440  || paramsetting == SCIP_PARAMSETTING_AGGRESSIVE || paramsetting == SCIP_PARAMSETTING_OFF);
4441 
4442  SCIP_CALL( SCIPsetSetPresolving(scip->set, scip->messagehdlr, paramsetting, quiet) );
4443 
4444  return SCIP_OKAY;
4445 }
4446 
4447 /** sets separating parameters to
4448  *
4449  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all separating parameters
4450  * - SCIP_PARAMSETTING_FAST such that the time spend for separating is decreased
4451  * - SCIP_PARAMSETTING_AGGRESSIVE such that the separating is done more aggregative
4452  * - SCIP_PARAMSETTING_OFF which turn off all separating
4453  *
4454  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4455  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4456  */
4458  SCIP* scip, /**< SCIP data structure */
4459  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
4460  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4461  )
4462 {
4463  assert(scip != NULL);
4464  assert(scip->set != NULL);
4465  assert(paramsetting == SCIP_PARAMSETTING_DEFAULT || paramsetting == SCIP_PARAMSETTING_FAST
4466  || paramsetting == SCIP_PARAMSETTING_AGGRESSIVE || paramsetting == SCIP_PARAMSETTING_OFF);
4467 
4468  SCIP_CALL( SCIPsetSetSeparating(scip->set, scip->messagehdlr, paramsetting, quiet) );
4469 
4470  return SCIP_OKAY;
4471 }
4472 
4473 /** returns the array of all available SCIP parameters
4474  *
4475  * @return SCIP_PARAM* array, containing all SCIP parameters.
4476  */
4478  SCIP* scip /**< SCIP data structure */
4479  )
4480 {
4481  assert(scip != NULL);
4482  assert(scip->set != NULL);
4483 
4484  return SCIPsetGetParams(scip->set);
4485 }
4486 
4487 /** returns the total number of all available SCIP parameters
4488  *
4489  * @return number of all SCIP parameters.
4490  */
4492  SCIP* scip /**< SCIP data structure */
4493  )
4494 {
4495  assert(scip != NULL);
4496  assert(scip->set != NULL);
4497 
4498  return SCIPsetGetNParams(scip->set);
4499 }
4500 
4501 
4502 
4503 
4504 /*
4505  * SCIP user functionality methods: managing plugins
4506  */
4507 
4508 /** creates a reader and includes it in SCIP
4509  *
4510  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4511  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4512  *
4513  * @pre This method can be called if SCIP is in one of the following stages:
4514  * - \ref SCIP_STAGE_INIT
4515  * - \ref SCIP_STAGE_PROBLEM
4516  *
4517  * @note method has all reader callbacks as arguments and is thus changed every time a new callback is added
4518  * in future releases; consider using SCIPincludeReaderBasic() and setter functions
4519  * if you seek for a method which is less likely to change in future releases
4520  */
4522  SCIP* scip, /**< SCIP data structure */
4523  const char* name, /**< name of reader */
4524  const char* desc, /**< description of reader */
4525  const char* extension, /**< file extension that reader processes */
4526  SCIP_DECL_READERCOPY ((*readercopy)), /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
4527  SCIP_DECL_READERFREE ((*readerfree)), /**< destructor of reader */
4528  SCIP_DECL_READERREAD ((*readerread)), /**< read method */
4529  SCIP_DECL_READERWRITE ((*readerwrite)), /**< write method */
4530  SCIP_READERDATA* readerdata /**< reader data */
4531  )
4532 {
4533  SCIP_READER* reader;
4534 
4535  SCIP_CALL( checkStage(scip, "SCIPincludeReader", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4536 
4537  /* check whether reader is already present */
4538  if( SCIPfindReader(scip, name) != NULL )
4539  {
4540  SCIPerrorMessage("reader <%s> already included.\n", name);
4541  return SCIP_INVALIDDATA;
4542  }
4543 
4544  SCIP_CALL( SCIPreaderCreate(&reader, name, desc, extension, readercopy, readerfree, readerread, readerwrite, readerdata) );
4545  SCIP_CALL( SCIPsetIncludeReader(scip->set, reader) );
4546 
4547  return SCIP_OKAY;
4548 }
4549 
4550 /** creates a reader and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
4551  * Optional callbacks can be set via specific setter functions, see
4552  * SCIPsetReaderCopy(), SCIPsetReaderFree(), SCIPsetReaderRead(), SCIPsetReaderWrite().
4553  *
4554  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4555  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4556  *
4557  * @pre This method can be called if SCIP is in one of the following stages:
4558  * - \ref SCIP_STAGE_INIT
4559  * - \ref SCIP_STAGE_PROBLEM
4560  *
4561  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeReader() instead
4562  */
4564  SCIP* scip, /**< SCIP data structure */
4565  SCIP_READER** readerptr, /**< reference to reader pointer, or NULL */
4566  const char* name, /**< name of reader */
4567  const char* desc, /**< description of reader */
4568  const char* extension, /**< file extension that reader processes */
4569  SCIP_READERDATA* readerdata /**< reader data */
4570  )
4571 {
4572  SCIP_READER* reader;
4573 
4574  SCIP_CALL( checkStage(scip, "SCIPincludeReaderBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4575 
4576  /* check whether reader is already present */
4577  if( SCIPfindReader(scip, name) != NULL )
4578  {
4579  SCIPerrorMessage("reader <%s> already included.\n", name);
4580  return SCIP_INVALIDDATA;
4581  }
4582 
4583  SCIP_CALL( SCIPreaderCreate(&reader, name, desc, extension, NULL, NULL, NULL, NULL, readerdata) );
4584  SCIP_CALL( SCIPsetIncludeReader(scip->set, reader) );
4585 
4586  if( readerptr != NULL )
4587  *readerptr = reader;
4588 
4589  return SCIP_OKAY;
4590 }
4591 
4592 /** set copy method of reader
4593  *
4594  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4595  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4596  *
4597  * @pre This method can be called if SCIP is in one of the following stages:
4598  * - \ref SCIP_STAGE_INIT
4599  * - \ref SCIP_STAGE_PROBLEM
4600  */
4602  SCIP* scip, /**< SCIP data structure */
4603  SCIP_READER* reader, /**< reader */
4604  SCIP_DECL_READERCOPY ((*readercopy)) /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
4605  )
4606 {
4607  assert(scip != NULL);
4608 
4609  SCIP_CALL( checkStage(scip, "SCIPsetReaderCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4610 
4611  SCIPreaderSetCopy(reader, readercopy);
4612 
4613  return SCIP_OKAY;
4614 }
4615 
4616 /** set deinitialization method of reader
4617  *
4618  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4619  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4620  *
4621  * @pre This method can be called if SCIP is in one of the following stages:
4622  * - \ref SCIP_STAGE_INIT
4623  * - \ref SCIP_STAGE_PROBLEM
4624  */
4626  SCIP* scip, /**< SCIP data structure */
4627  SCIP_READER* reader, /**< reader */
4628  SCIP_DECL_READERFREE ((*readerfree)) /**< destructor of reader */
4629  )
4630 {
4631  assert(scip != NULL);
4632 
4633  SCIP_CALL( checkStage(scip, "SCIPsetReaderFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4634 
4635  SCIPreaderSetFree(reader, readerfree);
4636 
4637  return SCIP_OKAY;
4638 }
4639 
4640 /** set read method of reader
4641  *
4642  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4643  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4644  *
4645  * @pre This method can be called if SCIP is in one of the following stages:
4646  * - \ref SCIP_STAGE_INIT
4647  * - \ref SCIP_STAGE_PROBLEM
4648  */
4650  SCIP* scip, /**< SCIP data structure */
4651  SCIP_READER* reader, /**< reader */
4652  SCIP_DECL_READERREAD ((*readerread)) /**< read method of reader */
4653  )
4654 {
4655  assert(scip != NULL);
4656 
4657  SCIP_CALL( checkStage(scip, "SCIPsetReaderRead", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4658 
4659  SCIPreaderSetRead(reader, readerread);
4660 
4661  return SCIP_OKAY;
4662 }
4663 
4664 /** set write method of reader
4665  *
4666  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4667  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4668  *
4669  * @pre This method can be called if SCIP is in one of the following stages:
4670  * - \ref SCIP_STAGE_INIT
4671  * - \ref SCIP_STAGE_PROBLEM
4672  */
4674  SCIP* scip, /**< SCIP data structure */
4675  SCIP_READER* reader, /**< reader */
4676  SCIP_DECL_READERWRITE ((*readerwrite)) /**< write method of reader */
4677  )
4678 {
4679  assert(scip != NULL);
4680 
4681  SCIP_CALL( checkStage(scip, "SCIPsetReaderWrite", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4682 
4683  SCIPreaderSetWrite(reader, readerwrite);
4684 
4685  return SCIP_OKAY;
4686 }
4687 
4688 /** returns the reader of the given name, or NULL if not existing */
4690  SCIP* scip, /**< SCIP data structure */
4691  const char* name /**< name of reader */
4692  )
4693 {
4694  assert(scip != NULL);
4695  assert(scip->set != NULL);
4696  assert(name != NULL);
4697 
4698  return SCIPsetFindReader(scip->set, name);
4699 }
4700 
4701 /** returns the array of currently available readers */
4703  SCIP* scip /**< SCIP data structure */
4704  )
4705 {
4706  assert(scip != NULL);
4707  assert(scip->set != NULL);
4708 
4709  return scip->set->readers;
4710 }
4711 
4712 /** returns the number of currently available readers */
4714  SCIP* scip /**< SCIP data structure */
4715  )
4716 {
4717  assert(scip != NULL);
4718  assert(scip->set != NULL);
4719 
4720  return scip->set->nreaders;
4721 }
4722 
4723 /** creates a variable pricer and includes it in SCIP
4724  * To use the variable pricer for solving a problem, it first has to be activated with a call to SCIPactivatePricer().
4725  * This should be done during the problem creation stage.
4726  *
4727  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4728  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4729  *
4730  * @pre This method can be called if SCIP is in one of the following stages:
4731  * - \ref SCIP_STAGE_INIT
4732  * - \ref SCIP_STAGE_PROBLEM
4733  *
4734  * @note method has all pricer callbacks as arguments and is thus changed every time a new callback is added
4735  * in future releases; consider using SCIPincludePricerBasic() and setter functions
4736  * if you seek for a method which is less likely to change in future releases
4737  */
4739  SCIP* scip, /**< SCIP data structure */
4740  const char* name, /**< name of variable pricer */
4741  const char* desc, /**< description of variable pricer */
4742  int priority, /**< priority of the variable pricer */
4743  SCIP_Bool delay, /**< should the pricer be delayed until no other pricers or already existing
4744  * problem variables with negative reduced costs are found?
4745  * if this is set to FALSE it may happen that the pricer produces columns
4746  * that already exist in the problem (which are also priced in by the
4747  * default problem variable pricing in the same round) */
4748  SCIP_DECL_PRICERCOPY ((*pricercopy)), /**< copy method of variable pricer or NULL if you don't want to copy your plugin into sub-SCIPs */
4749  SCIP_DECL_PRICERFREE ((*pricerfree)), /**< destructor of variable pricer */
4750  SCIP_DECL_PRICERINIT ((*pricerinit)), /**< initialize variable pricer */
4751  SCIP_DECL_PRICEREXIT ((*pricerexit)), /**< deinitialize variable pricer */
4752  SCIP_DECL_PRICERINITSOL((*pricerinitsol)),/**< solving process initialization method of variable pricer */
4753  SCIP_DECL_PRICEREXITSOL((*pricerexitsol)),/**< solving process deinitialization method of variable pricer */
4754  SCIP_DECL_PRICERREDCOST((*pricerredcost)),/**< reduced cost pricing method of variable pricer for feasible LPs */
4755  SCIP_DECL_PRICERFARKAS((*pricerfarkas)), /**< Farkas pricing method of variable pricer for infeasible LPs */
4756  SCIP_PRICERDATA* pricerdata /**< variable pricer data */
4757  )
4758 {
4759  SCIP_PRICER* pricer;
4760 
4761  SCIP_CALL( checkStage(scip, "SCIPincludePricer", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4762 
4763  /* check whether pricer is already present */
4764  if( SCIPfindPricer(scip, name) != NULL )
4765  {
4766  SCIPerrorMessage("pricer <%s> already included.\n", name);
4767  return SCIP_INVALIDDATA;
4768  }
4769 
4770  SCIP_CALL( SCIPpricerCreate(&pricer, scip->set, scip->messagehdlr, scip->mem->setmem,
4771  name, desc, priority, delay,
4772  pricercopy,
4773  pricerfree, pricerinit, pricerexit, pricerinitsol, pricerexitsol, pricerredcost, pricerfarkas, pricerdata) );
4774  SCIP_CALL( SCIPsetIncludePricer(scip->set, pricer) );
4775 
4776  return SCIP_OKAY;
4777 }
4778 
4779 /** creates a variable pricer and includes it in SCIP with all non-fundamental callbacks set to NULL;
4780  * if needed, these can be added afterwards via setter functions SCIPsetPricerCopy(), SCIPsetPricerFree(),
4781  * SCIPsetPricerInity(), SCIPsetPricerExit(), SCIPsetPricerInitsol(), SCIPsetPricerExitsol(),
4782  * SCIPsetPricerFarkas();
4783  *
4784  * To use the variable pricer for solving a problem, it first has to be activated with a call to SCIPactivatePricer().
4785  * This should be done during the problem creation stage.
4786  *
4787  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4788  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4789  *
4790  * @pre This method can be called if SCIP is in one of the following stages:
4791  * - \ref SCIP_STAGE_INIT
4792  * - \ref SCIP_STAGE_PROBLEM
4793  *
4794  * @note if you want to set all callbacks with a single method call, consider using SCIPincludePricer() instead
4795  */
4797  SCIP* scip, /**< SCIP data structure */
4798  SCIP_PRICER** pricerptr, /**< reference to a pricer, or NULL */
4799  const char* name, /**< name of variable pricer */
4800  const char* desc, /**< description of variable pricer */
4801  int priority, /**< priority of the variable pricer */
4802  SCIP_Bool delay, /**< should the pricer be delayed until no other pricers or already existing
4803  * problem variables with negative reduced costs are found?
4804  * if this is set to FALSE it may happen that the pricer produces columns
4805  * that already exist in the problem (which are also priced in by the
4806  * default problem variable pricing in the same round) */
4807  SCIP_DECL_PRICERREDCOST((*pricerredcost)),/**< reduced cost pricing method of variable pricer for feasible LPs */
4808  SCIP_DECL_PRICERFARKAS((*pricerfarkas)), /**< Farkas pricing method of variable pricer for infeasible LPs */
4809  SCIP_PRICERDATA* pricerdata /**< variable pricer data */
4810  )
4811 {
4812  SCIP_PRICER* pricer;
4813 
4814  SCIP_CALL( checkStage(scip, "SCIPincludePricerBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4815 
4816  /* check whether pricer is already present */
4817  if( SCIPfindPricer(scip, name) != NULL )
4818  {
4819  SCIPerrorMessage("pricer <%s> already included.\n", name);
4820  return SCIP_INVALIDDATA;
4821  }
4822 
4823  SCIP_CALL( SCIPpricerCreate(&pricer, scip->set, scip->messagehdlr, scip->mem->setmem,
4824  name, desc, priority, delay,
4825  NULL,
4826  NULL, NULL, NULL, NULL, NULL, pricerredcost, pricerfarkas, pricerdata) );
4827  SCIP_CALL( SCIPsetIncludePricer(scip->set, pricer) );
4828 
4829  if( pricerptr != NULL )
4830  *pricerptr = pricer;
4831 
4832  return SCIP_OKAY;
4833 }
4834 
4835 /** sets copy method of pricer
4836  *
4837  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4838  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4839  *
4840  * @pre This method can be called if SCIP is in one of the following stages:
4841  * - \ref SCIP_STAGE_INIT
4842  * - \ref SCIP_STAGE_PROBLEM
4843  */
4845  SCIP* scip, /**< SCIP data structure */
4846  SCIP_PRICER* pricer, /**< pricer */
4847  SCIP_DECL_PRICERCOPY ((*pricercopy)) /**< copy method of pricer or NULL if you don't want to copy your plugin into sub-SCIPs */
4848  )
4849 {
4850  SCIP_CALL( checkStage(scip, "SCIPsetPricerCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4851 
4852  assert(pricer != NULL);
4853 
4854  SCIPpricerSetCopy(pricer, pricercopy);
4855 
4856  return SCIP_OKAY;
4857 }
4858 
4859 /** sets destructor method of pricer
4860  *
4861  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4862  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4863  *
4864  * @pre This method can be called if SCIP is in one of the following stages:
4865  * - \ref SCIP_STAGE_INIT
4866  * - \ref SCIP_STAGE_PROBLEM
4867  */
4869  SCIP* scip, /**< SCIP data structure */
4870  SCIP_PRICER* pricer, /**< pricer */
4871  SCIP_DECL_PRICERFREE ((*pricerfree)) /**< destructor of pricer */
4872  )
4873 {
4874  SCIP_CALL( checkStage(scip, "SCIPsetPricerFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4875 
4876  assert(pricer != NULL);
4877 
4878  SCIPpricerSetFree(pricer, pricerfree);
4879 
4880  return SCIP_OKAY;
4881 }
4882 
4883 /** sets initialization method of pricer
4884  *
4885  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4886  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4887  *
4888  * @pre This method can be called if SCIP is in one of the following stages:
4889  * - \ref SCIP_STAGE_INIT
4890  * - \ref SCIP_STAGE_PROBLEM
4891  */
4893  SCIP* scip, /**< SCIP data structure */
4894  SCIP_PRICER* pricer, /**< pricer */
4895  SCIP_DECL_PRICERINIT ((*pricerinit)) /**< initialize pricer */
4896  )
4897 {
4898  SCIP_CALL( checkStage(scip, "SCIPsetPricerInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4899 
4900  assert(pricer != NULL);
4901 
4902  SCIPpricerSetInit(pricer, pricerinit);
4903 
4904  return SCIP_OKAY;
4905 }
4906 
4907 /** sets deinitialization method of pricer
4908  *
4909  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4910  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4911  *
4912  * @pre This method can be called if SCIP is in one of the following stages:
4913  * - \ref SCIP_STAGE_INIT
4914  * - \ref SCIP_STAGE_PROBLEM
4915  */
4917  SCIP* scip, /**< SCIP data structure */
4918  SCIP_PRICER* pricer, /**< pricer */
4919  SCIP_DECL_PRICEREXIT ((*pricerexit)) /**< deinitialize pricer */
4920  )
4921 {
4922  SCIP_CALL( checkStage(scip, "SCIPsetPricerExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4923 
4924  assert(pricer != NULL);
4925 
4926  SCIPpricerSetExit(pricer, pricerexit);
4927 
4928  return SCIP_OKAY;
4929 }
4930 
4931 /** sets solving process initialization method of pricer
4932  *
4933  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4934  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4935  *
4936  * @pre This method can be called if SCIP is in one of the following stages:
4937  * - \ref SCIP_STAGE_INIT
4938  * - \ref SCIP_STAGE_PROBLEM
4939  */
4941  SCIP* scip, /**< SCIP data structure */
4942  SCIP_PRICER* pricer, /**< pricer */
4943  SCIP_DECL_PRICERINITSOL ((*pricerinitsol))/**< solving process initialization method of pricer */
4944  )
4945 {
4946  SCIP_CALL( checkStage(scip, "SCIPsetPricerInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4947 
4948  assert(pricer != NULL);
4949 
4950  SCIPpricerSetInitsol(pricer, pricerinitsol);
4951 
4952  return SCIP_OKAY;
4953 }
4954 
4955 /** sets solving process deinitialization method of pricer
4956  *
4957  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4958  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4959  *
4960  * @pre This method can be called if SCIP is in one of the following stages:
4961  * - \ref SCIP_STAGE_INIT
4962  * - \ref SCIP_STAGE_PROBLEM
4963  */
4965  SCIP* scip, /**< SCIP data structure */
4966  SCIP_PRICER* pricer, /**< pricer */
4967  SCIP_DECL_PRICEREXITSOL((*pricerexitsol)) /**< solving process deinitialization method of pricer */
4968  )
4969 {
4970  SCIP_CALL( checkStage(scip, "SCIPsetPricerExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
4971 
4972  assert(pricer != NULL);
4973 
4974  SCIPpricerSetExitsol(pricer, pricerexitsol);
4975 
4976  return SCIP_OKAY;
4977 }
4978 
4979 /** returns the variable pricer of the given name, or NULL if not existing */
4981  SCIP* scip, /**< SCIP data structure */
4982  const char* name /**< name of variable pricer */
4983  )
4984 {
4985  assert(scip != NULL);
4986  assert(scip->set != NULL);
4987  assert(name != NULL);
4988 
4989  return SCIPsetFindPricer(scip->set, name);
4990 }
4991 
4992 /** returns the array of currently available variable pricers; active pricers are in the first slots of the array */
4994  SCIP* scip /**< SCIP data structure */
4995  )
4996 {
4997  assert(scip != NULL);
4998  assert(scip->set != NULL);
4999 
5000  SCIPsetSortPricers(scip->set);
5001 
5002  return scip->set->pricers;
5003 }
5004 
5005 /** returns the number of currently available variable pricers */
5007  SCIP* scip /**< SCIP data structure */
5008  )
5009 {
5010  assert(scip != NULL);
5011  assert(scip->set != NULL);
5012 
5013  return scip->set->npricers;
5014 }
5015 
5016 /** returns the number of currently active variable pricers, that are used in the LP solving loop */
5018  SCIP* scip /**< SCIP data structure */
5019  )
5020 {
5021  assert(scip != NULL);
5022  assert(scip->set != NULL);
5023 
5024  return scip->set->nactivepricers;
5025 }
5026 
5027 /** sets the priority priority of a variable pricer */
5029  SCIP* scip, /**< SCIP data structure */
5030  SCIP_PRICER* pricer, /**< variable pricer */
5031  int priority /**< new priority of the variable pricer */
5032  )
5033 {
5034  assert(scip != NULL);
5035  assert(scip->set != NULL);
5036 
5037  SCIPpricerSetPriority(pricer, scip->set, priority);
5038 
5039  return SCIP_OKAY;
5040 }
5041 
5042 /** activates pricer to be used for the current problem
5043  * This method should be called during the problem creation stage for all pricers that are necessary to solve
5044  * the problem model.
5045  * The pricers are automatically deactivated when the problem is freed.
5046  *
5047  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5048  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5049  *
5050  * @pre This method can be called if SCIP is in one of the following stages:
5051  * - \ref SCIP_STAGE_PROBLEM
5052  */
5054  SCIP* scip, /**< SCIP data structure */
5055  SCIP_PRICER* pricer /**< variable pricer */
5056  )
5057 {
5058  SCIP_CALL( checkStage(scip, "SCIPactivatePricer", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5059 
5060  SCIP_CALL( SCIPpricerActivate(pricer, scip->set) );
5061 
5062  return SCIP_OKAY;
5063 }
5064 
5065 /** deactivates pricer
5066  *
5067  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5068  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5069  *
5070  * @pre This method can be called if SCIP is in one of the following stages:
5071  * - \ref SCIP_STAGE_PROBLEM
5072  * - \ref SCIP_STAGE_EXITSOLVE
5073  */
5075  SCIP* scip, /**< SCIP data structure */
5076  SCIP_PRICER* pricer /**< variable pricer */
5077  )
5078 {
5079  SCIP_CALL( checkStage(scip, "SCIPdeactivatePricer", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE) );
5080 
5081  SCIP_CALL( SCIPpricerDeactivate(pricer, scip->set) );
5082 
5083  return SCIP_OKAY;
5084 }
5085 
5086 /** creates a constraint handler and includes it in SCIP.
5087  *
5088  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5089  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5090  *
5091  * @pre This method can be called if SCIP is in one of the following stages:
5092  * - \ref SCIP_STAGE_INIT
5093  * - \ref SCIP_STAGE_PROBLEM
5094  *
5095  * @note method has all constraint handler callbacks as arguments and is thus changed every time a new
5096  * callback is added
5097  * in future releases; consider using SCIPincludeConshdlrBasic() and setter functions
5098  * if you seek for a method which is less likely to change in future releases
5099  */
5101  SCIP* scip, /**< SCIP data structure */
5102  const char* name, /**< name of constraint handler */
5103  const char* desc, /**< description of constraint handler */
5104  int sepapriority, /**< priority of the constraint handler for separation */
5105  int enfopriority, /**< priority of the constraint handler for constraint enforcing */
5106  int chckpriority, /**< priority of the constraint handler for checking feasibility (and propagation) */
5107  int sepafreq, /**< frequency for separating cuts; zero means to separate only in the root node */
5108  int propfreq, /**< frequency for propagating domains; zero means only preprocessing propagation */
5109  int eagerfreq, /**< frequency for using all instead of only the useful constraints in separation,
5110  * propagation and enforcement, -1 for no eager evaluations, 0 for first only */
5111  int maxprerounds, /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
5112  SCIP_Bool delaysepa, /**< should separation method be delayed, if other separators found cuts? */
5113  SCIP_Bool delayprop, /**< should propagation method be delayed, if other propagators found reductions? */
5114  SCIP_Bool needscons, /**< should the constraint handler be skipped, if no constraints are available? */
5115  SCIP_PROPTIMING proptiming, /**< positions in the node solving loop where propagation method of constraint handlers should be executed */
5116  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the constraint handler's presolving method */
5117  SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), /**< copy method of constraint handler or NULL if you don't want to copy your plugin into sub-SCIPs */
5118  SCIP_DECL_CONSFREE ((*consfree)), /**< destructor of constraint handler */
5119  SCIP_DECL_CONSINIT ((*consinit)), /**< initialize constraint handler */
5120  SCIP_DECL_CONSEXIT ((*consexit)), /**< deinitialize constraint handler */
5121  SCIP_DECL_CONSINITPRE ((*consinitpre)), /**< presolving initialization method of constraint handler */
5122  SCIP_DECL_CONSEXITPRE ((*consexitpre)), /**< presolving deinitialization method of constraint handler */
5123  SCIP_DECL_CONSINITSOL ((*consinitsol)), /**< solving process initialization method of constraint handler */
5124  SCIP_DECL_CONSEXITSOL ((*consexitsol)), /**< solving process deinitialization method of constraint handler */
5125  SCIP_DECL_CONSDELETE ((*consdelete)), /**< free specific constraint data */
5126  SCIP_DECL_CONSTRANS ((*constrans)), /**< transform constraint data into data belonging to the transformed problem */
5127  SCIP_DECL_CONSINITLP ((*consinitlp)), /**< initialize LP with relaxations of "initial" constraints */
5128  SCIP_DECL_CONSSEPALP ((*conssepalp)), /**< separate cutting planes for LP solution */
5129  SCIP_DECL_CONSSEPASOL ((*conssepasol)), /**< separate cutting planes for arbitrary primal solution */
5130  SCIP_DECL_CONSENFOLP ((*consenfolp)), /**< enforcing constraints for LP solutions */
5131  SCIP_DECL_CONSENFOPS ((*consenfops)), /**< enforcing constraints for pseudo solutions */
5132  SCIP_DECL_CONSCHECK ((*conscheck)), /**< check feasibility of primal solution */
5133  SCIP_DECL_CONSPROP ((*consprop)), /**< propagate variable domains */
5134  SCIP_DECL_CONSPRESOL ((*conspresol)), /**< presolving method */
5135  SCIP_DECL_CONSRESPROP ((*consresprop)), /**< propagation conflict resolving method */
5136  SCIP_DECL_CONSLOCK ((*conslock)), /**< variable rounding lock method */
5137  SCIP_DECL_CONSACTIVE ((*consactive)), /**< activation notification method */
5138  SCIP_DECL_CONSDEACTIVE((*consdeactive)), /**< deactivation notification method */
5139  SCIP_DECL_CONSENABLE ((*consenable)), /**< enabling notification method */
5140  SCIP_DECL_CONSDISABLE ((*consdisable)), /**< disabling notification method */
5141  SCIP_DECL_CONSDELVARS ((*consdelvars)), /**< variable deletion method */
5142  SCIP_DECL_CONSPRINT ((*consprint)), /**< constraint display method */
5143  SCIP_DECL_CONSCOPY ((*conscopy)), /**< constraint copying method */
5144  SCIP_DECL_CONSPARSE ((*consparse)), /**< constraint parsing method */
5145  SCIP_DECL_CONSGETVARS ((*consgetvars)), /**< constraint get variables method */
5146  SCIP_DECL_CONSGETNVARS((*consgetnvars)), /**< constraint get number of variable method */
5147  SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)), /**< constraint handler diving solution enforcement method */
5148  SCIP_CONSHDLRDATA* conshdlrdata /**< constraint handler data */
5149  )
5150 {
5151  SCIP_CONSHDLR* conshdlr;
5152 
5153  SCIP_CALL( checkStage(scip, "SCIPincludeConshdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5154 
5155  /* check whether constraint handler is already present */
5156  if( SCIPfindConshdlr(scip, name) != NULL )
5157  {
5158  SCIPerrorMessage("constraint handler <%s> already included.\n", name);
5159  return SCIP_INVALIDDATA;
5160  }
5161 
5162  SCIP_CALL( SCIPconshdlrCreate(&conshdlr, scip->set, scip->messagehdlr, scip->mem->setmem,
5163  name, desc, sepapriority, enfopriority, chckpriority, sepafreq, propfreq, eagerfreq, maxprerounds,
5164  delaysepa, delayprop, needscons, proptiming, presoltiming, conshdlrcopy,
5165  consfree, consinit, consexit, consinitpre, consexitpre, consinitsol, consexitsol,
5166  consdelete, constrans, consinitlp, conssepalp, conssepasol, consenfolp, consenfops, conscheck, consprop,
5167  conspresol, consresprop, conslock, consactive, consdeactive, consenable, consdisable, consdelvars, consprint,
5168  conscopy, consparse, consgetvars, consgetnvars, consgetdivebdchgs, conshdlrdata) );
5169  SCIP_CALL( SCIPsetIncludeConshdlr(scip->set, conshdlr) );
5170 
5171  return SCIP_OKAY;
5172 }
5173 
5174 /** creates a constraint handler and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
5175  * Optional callbacks can be set via specific setter functions, see SCIPsetConshdlrInit(), SCIPsetConshdlrExit(),
5176  * SCIPsetConshdlrCopy(), SCIPsetConshdlrFree(), SCIPsetConshdlrInitsol(), SCIPsetConshdlrExitsol(),
5177  * SCIPsetConshdlrInitpre(), SCIPsetConshdlrExitpre(), SCIPsetConshdlrPresol(), SCIPsetConshdlrDelete(),
5178  * SCIPsetConshdlrDelvars(), SCIPsetConshdlrInitlp(), SCIPsetConshdlrActive(), SCIPsetConshdlrDeactive(),
5179  * SCIPsetConshdlrEnable(), SCIPsetConshdlrDisable(), SCIPsetConshdlrResprop(), SCIPsetConshdlrTrans(),
5180  * SCIPsetConshdlrPrint(), SCIPsetConshdlrParse(), SCIPsetConshdlrGetVars(), SCIPsetConshdlrGetNVars(), and
5181  * SCIPsetConshdlrGetDiveBdChgs().
5182  *
5183  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5184  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5185  *
5186  * @pre This method can be called if SCIP is in one of the following stages:
5187  * - \ref SCIP_STAGE_INIT
5188  * - \ref SCIP_STAGE_PROBLEM
5189  *
5190  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeConshdlr() instead
5191  */
5193  SCIP* scip, /**< SCIP data structure */
5194  SCIP_CONSHDLR** conshdlrptr, /**< reference to a constraint handler pointer, or NULL */
5195  const char* name, /**< name of constraint handler */
5196  const char* desc, /**< description of constraint handler */
5197  int enfopriority, /**< priority of the constraint handler for constraint enforcing */
5198  int chckpriority, /**< priority of the constraint handler for checking feasibility (and propagation) */
5199  int eagerfreq, /**< frequency for using all instead of only the useful constraints in separation,
5200  * propagation and enforcement, -1 for no eager evaluations, 0 for first only */
5201  SCIP_Bool needscons, /**< should the constraint handler be skipped, if no constraints are available? */
5202  SCIP_DECL_CONSENFOLP ((*consenfolp)), /**< enforcing constraints for LP solutions */
5203  SCIP_DECL_CONSENFOPS ((*consenfops)), /**< enforcing constraints for pseudo solutions */
5204  SCIP_DECL_CONSCHECK ((*conscheck)), /**< check feasibility of primal solution */
5205  SCIP_DECL_CONSLOCK ((*conslock)), /**< variable rounding lock method */
5206  SCIP_CONSHDLRDATA* conshdlrdata /**< constraint handler data */
5207  )
5208 {
5209  SCIP_CONSHDLR* conshdlr;
5210 
5211  SCIP_CALL( checkStage(scip, "SCIPincludeConshdlrBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5212 
5213  /* check whether constraint handler is already present */
5214  if( SCIPfindConshdlr(scip, name) != NULL )
5215  {
5216  SCIPerrorMessage("constraint handler <%s> already included.\n", name);
5217  return SCIP_INVALIDDATA;
5218  }
5219 
5220  SCIP_CALL( SCIPconshdlrCreate(&conshdlr, scip->set, scip->messagehdlr, scip->mem->setmem,
5221  name, desc, 0, enfopriority, chckpriority, -1, -1, eagerfreq, 0,
5222  FALSE, FALSE, needscons,
5224  NULL,
5225  NULL, NULL, NULL, NULL, NULL, NULL, NULL,
5226  NULL, NULL, NULL, NULL, NULL, consenfolp, consenfops, conscheck, NULL,
5227  NULL, NULL, conslock, NULL, NULL, NULL, NULL, NULL, NULL,
5228  NULL, NULL, NULL, NULL, NULL, conshdlrdata) );
5229  SCIP_CALL( SCIPsetIncludeConshdlr(scip->set, conshdlr) );
5230 
5231  if( conshdlrptr != NULL )
5232  *conshdlrptr = conshdlr;
5233 
5234  return SCIP_OKAY;
5235 }
5236 
5237 /** sets all separation related callbacks/parameters of the constraint handler
5238  *
5239  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5240  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5241  *
5242  * @pre This method can be called if SCIP is in one of the following stages:
5243  * - \ref SCIP_STAGE_INIT
5244  * - \ref SCIP_STAGE_PROBLEM
5245  */
5247  SCIP* scip, /**< SCIP data structure */
5248  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5249  SCIP_DECL_CONSSEPALP ((*conssepalp)), /**< separate cutting planes for LP solution */
5250  SCIP_DECL_CONSSEPASOL ((*conssepasol)), /**< separate cutting planes for arbitrary primal solution */
5251  int sepafreq, /**< frequency for separating cuts; zero means to separate only in the root node */
5252  int sepapriority, /**< priority of the constraint handler for separation */
5253  SCIP_Bool delaysepa /**< should separation method be delayed, if other separators found cuts? */
5254  )
5255 {
5256  int oldsepapriority;
5257  const char* name;
5258  char paramname[SCIP_MAXSTRLEN];
5259 
5260  assert(scip != NULL);
5261  assert(conshdlr != NULL);
5262 
5263  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrSepa", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5264 
5265  oldsepapriority = SCIPconshdlrGetSepaPriority(conshdlr);
5266  SCIPconshdlrSetSepa(conshdlr, conssepalp, conssepasol, sepafreq, sepapriority, delaysepa);
5267 
5268  /* change the position of the constraint handler in the constraint handler array w.r.t. its new sepa priority */
5269  if( oldsepapriority != sepapriority )
5270  SCIPsetReinsertConshdlrSepaPrio(scip->set, conshdlr, oldsepapriority);
5271 
5272  name = SCIPconshdlrGetName(conshdlr);
5273 
5274  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", name);
5275  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, sepafreq) );
5276 
5277  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/delaysepa", name);
5278  SCIP_CALL( SCIPsetSetDefaultBoolParam(scip->set, paramname, delaysepa) );
5279 
5280  return SCIP_OKAY;
5281 }
5282 
5283 /** sets both the propagation callback and the propagation frequency of the constraint handler
5284  *
5285  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5286  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5287  *
5288  * @pre This method can be called if SCIP is in one of the following stages:
5289  * - \ref SCIP_STAGE_INIT
5290  * - \ref SCIP_STAGE_PROBLEM
5291  */
5293  SCIP* scip, /**< SCIP data structure */
5294  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5295  SCIP_DECL_CONSPROP ((*consprop)), /**< propagate variable domains */
5296  int propfreq, /**< frequency for propagating domains; zero means only preprocessing propagation */
5297  SCIP_Bool delayprop, /**< should propagation method be delayed, if other propagators found reductions? */
5298  SCIP_PROPTIMING proptiming /**< positions in the node solving loop where propagation should be executed */
5299  )
5300 {
5301  const char* name;
5302  char paramname[SCIP_MAXSTRLEN];
5303 
5304  assert(scip != NULL);
5305  assert(conshdlr != NULL);
5306 
5307  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrProp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5308 
5309  SCIPconshdlrSetProp(conshdlr, consprop, propfreq, delayprop, proptiming);
5310 
5311  name = SCIPconshdlrGetName(conshdlr);
5312 
5313  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/propfreq", name);
5314  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, propfreq) );
5315 
5316  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/proptiming", name);
5317  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, (int) proptiming) );
5318 
5319  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/delaysepa", name);
5320  SCIP_CALL( SCIPsetSetDefaultBoolParam(scip->set, paramname, delayprop) );
5321 
5322  return SCIP_OKAY;
5323 }
5324 
5325 /** sets copy method of both the constraint handler and each associated constraint
5326  *
5327  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5328  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5329  *
5330  * @pre This method can be called if SCIP is in one of the following stages:
5331  * - \ref SCIP_STAGE_INIT
5332  * - \ref SCIP_STAGE_PROBLEM
5333  */
5335  SCIP* scip, /**< SCIP data structure */
5336  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5337  SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), /**< copy method of constraint handler or NULL if you don't want to copy your plugin into sub-SCIPs */
5338  SCIP_DECL_CONSCOPY ((*conscopy)) /**< constraint copying method */
5339  )
5340 {
5341  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5342 
5343  assert(conshdlr != NULL);
5344 
5345  SCIPconshdlrSetCopy(conshdlr, conshdlrcopy, conscopy);
5346 
5347  return SCIP_OKAY;
5348 }
5349 
5350 /** sets destructor method of constraint handler
5351  *
5352  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5353  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5354  *
5355  * @pre This method can be called if SCIP is in one of the following stages:
5356  * - \ref SCIP_STAGE_INIT
5357  * - \ref SCIP_STAGE_PROBLEM
5358  */
5360  SCIP* scip, /**< SCIP data structure */
5361  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5362  SCIP_DECL_CONSFREE ((*consfree)) /**< destructor of constraint handler */
5363  )
5364 {
5365  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5366 
5367  assert(conshdlr != NULL);
5368 
5369  SCIPconshdlrSetFree(conshdlr, consfree);
5370 
5371  return SCIP_OKAY;
5372 }
5373 
5374 /** sets initialization method of constraint handler
5375  *
5376  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5377  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5378  *
5379  * @pre This method can be called if SCIP is in one of the following stages:
5380  * - \ref SCIP_STAGE_INIT
5381  * - \ref SCIP_STAGE_PROBLEM
5382  */
5384  SCIP* scip, /**< SCIP data structure */
5385  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5386  SCIP_DECL_CONSINIT ((*consinit)) /**< initialize constraint handler */
5387  )
5388 {
5389  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5390 
5391  assert(conshdlr != NULL);
5392 
5393  SCIPconshdlrSetInit(conshdlr, consinit);
5394 
5395  return SCIP_OKAY;
5396 }
5397 
5398 /** sets deinitialization method of constraint handler
5399  *
5400  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5401  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5402  *
5403  * @pre This method can be called if SCIP is in one of the following stages:
5404  * - \ref SCIP_STAGE_INIT
5405  * - \ref SCIP_STAGE_PROBLEM
5406  */
5408  SCIP* scip, /**< SCIP data structure */
5409  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5410  SCIP_DECL_CONSEXIT ((*consexit)) /**< deinitialize constraint handler */
5411  )
5412 {
5413  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5414 
5415  assert(conshdlr != NULL);
5416 
5417  SCIPconshdlrSetExit(conshdlr, consexit);
5418 
5419  return SCIP_OKAY;
5420 }
5421 
5422 /** sets solving process initialization method of constraint handler
5423  *
5424  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5425  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5426  *
5427  * @pre This method can be called if SCIP is in one of the following stages:
5428  * - \ref SCIP_STAGE_INIT
5429  * - \ref SCIP_STAGE_PROBLEM
5430  */
5432  SCIP* scip, /**< SCIP data structure */
5433  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5434  SCIP_DECL_CONSINITSOL((*consinitsol)) /**< solving process initialization method of constraint handler */
5435  )
5436 {
5437  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5438 
5439  assert(conshdlr != NULL);
5440 
5441  SCIPconshdlrSetInitsol(conshdlr, consinitsol);
5442 
5443  return SCIP_OKAY;
5444 }
5445 
5446 /** sets solving process deinitialization method of constraint handler
5447  *
5448  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5449  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5450  *
5451  * @pre This method can be called if SCIP is in one of the following stages:
5452  * - \ref SCIP_STAGE_INIT
5453  * - \ref SCIP_STAGE_PROBLEM
5454  */
5456  SCIP* scip, /**< SCIP data structure */
5457  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5458  SCIP_DECL_CONSEXITSOL ((*consexitsol))/**< solving process deinitialization method of constraint handler */
5459  )
5460 {
5461  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5462 
5463  assert(conshdlr != NULL);
5464 
5465  SCIPconshdlrSetExitsol(conshdlr, consexitsol);
5466 
5467  return SCIP_OKAY;
5468 }
5469 
5470 /** sets preprocessing initialization method of constraint handler
5471  *
5472  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5473  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5474  *
5475  * @pre This method can be called if SCIP is in one of the following stages:
5476  * - \ref SCIP_STAGE_INIT
5477  * - \ref SCIP_STAGE_PROBLEM
5478  */
5480  SCIP* scip, /**< SCIP data structure */
5481  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5482  SCIP_DECL_CONSINITPRE((*consinitpre)) /**< preprocessing initialization method of constraint handler */
5483  )
5484 {
5485  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5486 
5487  assert(conshdlr != NULL);
5488 
5489  SCIPconshdlrSetInitpre(conshdlr, consinitpre);
5490 
5491  return SCIP_OKAY;
5492 }
5493 
5494 /** sets preprocessing deinitialization method of constraint handler
5495  *
5496  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5497  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5498  *
5499  * @pre This method can be called if SCIP is in one of the following stages:
5500  * - \ref SCIP_STAGE_INIT
5501  * - \ref SCIP_STAGE_PROBLEM
5502  */
5504  SCIP* scip, /**< SCIP data structure */
5505  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5506  SCIP_DECL_CONSEXITPRE((*consexitpre)) /**< preprocessing deinitialization method of constraint handler */
5507  )
5508 {
5509  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrExitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5510 
5511  assert(conshdlr != NULL);
5512 
5513  SCIPconshdlrSetExitpre(conshdlr, consexitpre);
5514 
5515  return SCIP_OKAY;
5516 }
5517 
5518 /** sets presolving method of constraint handler
5519  *
5520  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5521  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5522  *
5523  * @pre This method can be called if SCIP is in one of the following stages:
5524  * - \ref SCIP_STAGE_INIT
5525  * - \ref SCIP_STAGE_PROBLEM
5526  */
5528  SCIP* scip, /**< SCIP data structure */
5529  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5530  SCIP_DECL_CONSPRESOL ((*conspresol)), /**< presolving method of constraint handler */
5531  int maxprerounds, /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
5532  SCIP_PRESOLTIMING presoltiming /**< timing mask of the constraint handler's presolving method */
5533  )
5534 {
5535  const char* name;
5536  char paramname[SCIP_MAXSTRLEN];
5537 
5538  assert(scip != NULL);
5539  assert(conshdlr != NULL);
5540 
5541  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrPresol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5542 
5543  SCIP_CALL( SCIPconshdlrSetPresol(conshdlr, conspresol, maxprerounds, presoltiming) );
5544 
5545  name = SCIPconshdlrGetName(conshdlr);
5546 
5547  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxprerounds", name);
5548  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, maxprerounds) );
5549 
5550  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/presoltiming", name);
5551  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, (int) presoltiming) );
5552 
5553  return SCIP_OKAY;
5554 }
5555 
5556 /** sets method of constraint handler to free specific constraint data
5557  *
5558  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5559  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5560  *
5561  * @pre This method can be called if SCIP is in one of the following stages:
5562  * - \ref SCIP_STAGE_INIT
5563  * - \ref SCIP_STAGE_PROBLEM
5564  */
5566  SCIP* scip, /**< SCIP data structure */
5567  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5568  SCIP_DECL_CONSDELETE ((*consdelete)) /**< free specific constraint data */
5569  )
5570 {
5571  assert(scip != NULL);
5572  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDelete", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5573 
5574  SCIPconshdlrSetDelete(conshdlr, consdelete);
5575 
5576  return SCIP_OKAY;
5577 }
5578 
5579 /** sets method of constraint handler to transform constraint data into data belonging to the transformed problem
5580  *
5581  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5582  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5583  *
5584  * @pre This method can be called if SCIP is in one of the following stages:
5585  * - \ref SCIP_STAGE_INIT
5586  * - \ref SCIP_STAGE_PROBLEM
5587  */
5589  SCIP* scip, /**< SCIP data structure */
5590  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5591  SCIP_DECL_CONSTRANS ((*constrans)) /**< transform constraint data into data belonging to the transformed problem */
5592  )
5593 {
5594  assert(scip != NULL);
5595  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrTrans", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5596 
5597  SCIPconshdlrSetTrans(conshdlr, constrans);
5598 
5599  return SCIP_OKAY;
5600 }
5601 
5602 /** sets method of constraint handler to initialize LP with relaxations of "initial" constraints
5603  *
5604  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5605  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5606  *
5607  * @pre This method can be called if SCIP is in one of the following stages:
5608  * - \ref SCIP_STAGE_INIT
5609  * - \ref SCIP_STAGE_PROBLEM
5610  */
5612  SCIP* scip, /**< SCIP data structure */
5613  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5614  SCIP_DECL_CONSINITLP ((*consinitlp)) /**< initialize LP with relaxations of "initial" constraints */
5615  )
5616 {
5617  assert(scip != NULL);
5618  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInitlp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5619 
5620  SCIPconshdlrSetInitlp(conshdlr, consinitlp);
5621 
5622  return SCIP_OKAY;
5623 }
5624 
5625 /** sets propagation conflict resolving method of constraint handler
5626  *
5627  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5628  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5629  *
5630  * @pre This method can be called if SCIP is in one of the following stages:
5631  * - \ref SCIP_STAGE_INIT
5632  * - \ref SCIP_STAGE_PROBLEM
5633  */
5635  SCIP* scip, /**< SCIP data structure */
5636  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5637  SCIP_DECL_CONSRESPROP ((*consresprop)) /**< propagation conflict resolving method */
5638  )
5639 {
5640  assert(scip != NULL);
5641  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrResprop", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5642 
5643  SCIPconshdlrSetResprop(conshdlr, consresprop);
5644 
5645  return SCIP_OKAY;
5646 }
5647 
5648 /** sets activation notification method of constraint handler
5649  *
5650  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5651  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5652  *
5653  * @pre This method can be called if SCIP is in one of the following stages:
5654  * - \ref SCIP_STAGE_INIT
5655  * - \ref SCIP_STAGE_PROBLEM
5656  */
5658  SCIP* scip, /**< SCIP data structure */
5659  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5660  SCIP_DECL_CONSACTIVE ((*consactive)) /**< activation notification method */
5661  )
5662 {
5663  assert(scip != NULL);
5664  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrActive", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5665 
5666  SCIPconshdlrSetActive(conshdlr, consactive);
5667 
5668  return SCIP_OKAY;
5669 }
5670 
5671 /** sets deactivation notification method of constraint handler
5672  *
5673  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5674  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5675  *
5676  * @pre This method can be called if SCIP is in one of the following stages:
5677  * - \ref SCIP_STAGE_INIT
5678  * - \ref SCIP_STAGE_PROBLEM
5679  */
5681  SCIP* scip, /**< SCIP data structure */
5682  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5683  SCIP_DECL_CONSDEACTIVE((*consdeactive)) /**< deactivation notification method */
5684  )
5685 {
5686  assert(scip != NULL);
5687  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDeactive", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5688 
5689  SCIPconshdlrSetDeactive(conshdlr, consdeactive);
5690 
5691  return SCIP_OKAY;
5692 }
5693 
5694 /** sets enabling notification method of constraint handler
5695  *
5696  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5697  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5698  *
5699  * @pre This method can be called if SCIP is in one of the following stages:
5700  * - \ref SCIP_STAGE_INIT
5701  * - \ref SCIP_STAGE_PROBLEM
5702  */
5704  SCIP* scip, /**< SCIP data structure */
5705  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5706  SCIP_DECL_CONSENABLE ((*consenable)) /**< enabling notification method */
5707  )
5708 {
5709  assert(scip != NULL);
5710  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrEnable", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5711 
5712  SCIPconshdlrSetEnable(conshdlr, consenable);
5713 
5714  return SCIP_OKAY;
5715 }
5716 
5717 /** sets disabling notification method of constraint handler
5718  *
5719  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5720  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5721  *
5722  * @pre This method can be called if SCIP is in one of the following stages:
5723  * - \ref SCIP_STAGE_INIT
5724  * - \ref SCIP_STAGE_PROBLEM
5725  */
5727  SCIP* scip, /**< SCIP data structure */
5728  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5729  SCIP_DECL_CONSDISABLE ((*consdisable)) /**< disabling notification method */
5730  )
5731 {
5732  assert(scip != NULL);
5733  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDisable", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5734 
5735  SCIPconshdlrSetDisable(conshdlr, consdisable);
5736 
5737  return SCIP_OKAY;
5738 }
5739 
5740 /** sets variable deletion method of constraint handler
5741  *
5742  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5743  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5744  *
5745  * @pre This method can be called if SCIP is in one of the following stages:
5746  * - \ref SCIP_STAGE_INIT
5747  * - \ref SCIP_STAGE_PROBLEM
5748  */
5750  SCIP* scip, /**< SCIP data structure */
5751  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5752  SCIP_DECL_CONSDELVARS ((*consdelvars)) /**< variable deletion method */
5753  )
5754 {
5755  assert(scip != NULL);
5756  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDelvars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5757 
5758  SCIPconshdlrSetDelvars(conshdlr, consdelvars);
5759 
5760  return SCIP_OKAY;
5761 }
5762 
5763 /** sets constraint display method of constraint handler
5764  *
5765  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5766  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5767  *
5768  * @pre This method can be called if SCIP is in one of the following stages:
5769  * - \ref SCIP_STAGE_INIT
5770  * - \ref SCIP_STAGE_PROBLEM
5771  */
5773  SCIP* scip, /**< SCIP data structure */
5774  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5775  SCIP_DECL_CONSPRINT ((*consprint)) /**< constraint display method */
5776  )
5777 {
5778  assert(scip != NULL);
5779  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrPrint", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5780 
5781  SCIPconshdlrSetPrint(conshdlr, consprint);
5782 
5783  return SCIP_OKAY;
5784 }
5785 
5786 /** sets constraint parsing method of constraint handler
5787  *
5788  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5789  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5790  *
5791  * @pre This method can be called if SCIP is in one of the following stages:
5792  * - \ref SCIP_STAGE_INIT
5793  * - \ref SCIP_STAGE_PROBLEM
5794  */
5796  SCIP* scip, /**< SCIP data structure */
5797  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5798  SCIP_DECL_CONSPARSE ((*consparse)) /**< constraint parsing method */
5799  )
5800 {
5801  assert(scip != NULL);
5802  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrParse", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5803 
5804  SCIPconshdlrSetParse(conshdlr, consparse);
5805 
5806  return SCIP_OKAY;
5807 }
5808 
5809 /** sets constraint variable getter method of constraint handler
5810  *
5811  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5812  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5813  *
5814  * @pre This method can be called if SCIP is in one of the following stages:
5815  * - \ref SCIP_STAGE_INIT
5816  * - \ref SCIP_STAGE_PROBLEM
5817  */
5819  SCIP* scip, /**< SCIP data structure */
5820  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5821  SCIP_DECL_CONSGETVARS ((*consgetvars)) /**< constraint variable getter method */
5822  )
5823 {
5824  assert(scip != NULL);
5825  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrGetVars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5826 
5827  SCIPconshdlrSetGetVars(conshdlr, consgetvars);
5828 
5829  return SCIP_OKAY;
5830 }
5831 
5832 /** sets constraint variable number getter method of constraint handler
5833  *
5834  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5835  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5836  *
5837  * @pre This method can be called if SCIP is in one of the following stages:
5838  * - \ref SCIP_STAGE_INIT
5839  * - \ref SCIP_STAGE_PROBLEM
5840  */
5842  SCIP* scip, /**< SCIP data structure */
5843  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5844  SCIP_DECL_CONSGETNVARS((*consgetnvars)) /**< constraint variable number getter method */
5845  )
5846 {
5847  assert(scip != NULL);
5848  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrGetNVars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5849 
5850  SCIPconshdlrSetGetNVars(conshdlr, consgetnvars);
5851 
5852  return SCIP_OKAY;
5853 }
5854 
5855 /** sets diving bound change method of constraint handler
5856  *
5857  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5858  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5859  *
5860  * @pre This method can be called if SCIP is in one of the following stages:
5861  * - \ref SCIP_STAGE_INIT
5862  * - \ref SCIP_STAGE_PROBLEM
5863  */
5865  SCIP* scip, /**< SCIP data structure */
5866  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5867  SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)) /**< constraint handler diving solution enforcement method */
5868  )
5869 {
5870  assert(scip != NULL);
5871  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrGetDiveBdChgs", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5872 
5873  SCIPconshdlrSetGetDiveBdChgs(conshdlr, consgetdivebdchgs);
5874 
5875  return SCIP_OKAY;
5876 }
5877 /** returns the constraint handler of the given name, or NULL if not existing */
5879  SCIP* scip, /**< SCIP data structure */
5880  const char* name /**< name of constraint handler */
5881  )
5882 {
5883  assert(scip != NULL);
5884  assert(scip->set != NULL);
5885  assert(name != NULL);
5886 
5887  return SCIPsetFindConshdlr(scip->set, name);
5888 }
5889 
5890 /** returns the array of currently available constraint handlers */
5892  SCIP* scip /**< SCIP data structure */
5893  )
5894 {
5895  assert(scip != NULL);
5896  assert(scip->set != NULL);
5897 
5898  return scip->set->conshdlrs;
5899 }
5900 
5901 /** returns the number of currently available constraint handlers */
5903  SCIP* scip /**< SCIP data structure */
5904  )
5905 {
5906  assert(scip != NULL);
5907  assert(scip->set != NULL);
5908 
5909  return scip->set->nconshdlrs;
5910 }
5911 
5912 /** creates a conflict handler and includes it in SCIP
5913  *
5914  * @note method has all conflict handler callbacks as arguments and is thus changed every time a new
5915  * callback is added
5916  * in future releases; consider using SCIPincludeConflicthdlrBasic() and setter functions
5917  * if you seek for a method which is less likely to change in future releases
5918  */
5920  SCIP* scip, /**< SCIP data structure */
5921  const char* name, /**< name of conflict handler */
5922  const char* desc, /**< description of conflict handler */
5923  int priority, /**< priority of the conflict handler */
5924  SCIP_DECL_CONFLICTCOPY((*conflictcopy)), /**< copy method of conflict handler or NULL if you don't want to copy your plugin into sub-SCIPs */
5925  SCIP_DECL_CONFLICTFREE((*conflictfree)), /**< destructor of conflict handler */
5926  SCIP_DECL_CONFLICTINIT((*conflictinit)), /**< initialize conflict handler */
5927  SCIP_DECL_CONFLICTEXIT((*conflictexit)), /**< deinitialize conflict handler */
5928  SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)),/**< solving process initialization method of conflict handler */
5929  SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)),/**< solving process deinitialization method of conflict handler */
5930  SCIP_DECL_CONFLICTEXEC((*conflictexec)), /**< conflict processing method of conflict handler */
5931  SCIP_CONFLICTHDLRDATA* conflicthdlrdata /**< conflict handler data */
5932  )
5933 {
5934  SCIP_CONFLICTHDLR* conflicthdlr;
5935 
5936  SCIP_CALL( checkStage(scip, "SCIPincludeConflicthdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5937 
5938  /* check whether conflict handler is already present */
5939  if( SCIPfindConflicthdlr(scip, name) != NULL )
5940  {
5941  SCIPerrorMessage("conflict handler <%s> already included.\n", name);
5942  return SCIP_INVALIDDATA;
5943  }
5944 
5945  SCIP_CALL( SCIPconflicthdlrCreate(&conflicthdlr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
5946  conflictcopy,
5947  conflictfree, conflictinit, conflictexit, conflictinitsol, conflictexitsol, conflictexec,
5948  conflicthdlrdata) );
5949  SCIP_CALL( SCIPsetIncludeConflicthdlr(scip->set, conflicthdlr) );
5950 
5951  return SCIP_OKAY;
5952 }
5953 
5954 /** creates a conflict handler and includes it in SCIP with its most fundamental callbacks. All non-fundamental
5955  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
5956  * Optional callbacks can be set via specific setter functions SCIPsetConflicthdlrCopy(), SCIPsetConflicthdlrFree(),
5957  * SCIPsetConflicthdlrInit(), SCIPsetConflicthdlrExit(), SCIPsetConflicthdlrInitsol(),
5958  * and SCIPsetConflicthdlrExitsol()
5959  *
5960  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeConflicthdlr() instead
5961  */
5963  SCIP* scip, /**< SCIP data structure */
5964  SCIP_CONFLICTHDLR** conflicthdlrptr, /**< reference to a conflict handler pointer, or NULL */
5965  const char* name, /**< name of conflict handler */
5966  const char* desc, /**< description of conflict handler */
5967  int priority, /**< priority of the conflict handler */
5968  SCIP_DECL_CONFLICTEXEC((*conflictexec)), /**< conflict processing method of conflict handler */
5969  SCIP_CONFLICTHDLRDATA* conflicthdlrdata /**< conflict handler data */
5970  )
5971 {
5972  SCIP_CONFLICTHDLR* conflicthdlr;
5973 
5974  SCIP_CALL( checkStage(scip, "SCIPincludeConflicthdlrBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5975 
5976  /* check whether conflict handler is already present */
5977  if( SCIPfindConflicthdlr(scip, name) != NULL )
5978  {
5979  SCIPerrorMessage("conflict handler <%s> already included.\n", name);
5980  return SCIP_INVALIDDATA;
5981  }
5982 
5983  SCIP_CALL( SCIPconflicthdlrCreate(&conflicthdlr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
5984  NULL, NULL, NULL, NULL, NULL, NULL, conflictexec, conflicthdlrdata) );
5985  SCIP_CALL( SCIPsetIncludeConflicthdlr(scip->set, conflicthdlr) );
5986 
5987  if( conflicthdlrptr != NULL )
5988  *conflicthdlrptr = conflicthdlr;
5989 
5990  return SCIP_OKAY;
5991 }
5992 
5993 /** set copy method of conflict handler */
5995  SCIP* scip, /**< SCIP data structure */
5996  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
5997  SCIP_DECL_CONFLICTCOPY((*conflictcopy)) /**< copy method of conflict handler */
5998  )
5999 {
6000  assert(scip != NULL);
6001 
6002  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6003 
6004  SCIPconflicthdlrSetCopy(conflicthdlr, conflictcopy);
6005 
6006  return SCIP_OKAY;
6007 }
6008 
6009 /** set destructor of conflict handler */
6011  SCIP* scip, /**< SCIP data structure */
6012  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6013  SCIP_DECL_CONFLICTFREE((*conflictfree)) /**< destructor of conflict handler */
6014  )
6015 {
6016  assert(scip != NULL);
6017 
6018  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6019 
6020  SCIPconflicthdlrSetFree(conflicthdlr, conflictfree);
6021 
6022  return SCIP_OKAY;
6023 }
6024 
6025 /** set initialization method of conflict handler */
6027  SCIP* scip, /**< SCIP data structure */
6028  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6029  SCIP_DECL_CONFLICTINIT((*conflictinit)) /**< initialize conflict handler */
6030  )
6031 {
6032  assert(scip != NULL);
6033 
6034  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6035 
6036  SCIPconflicthdlrSetInit(conflicthdlr, conflictinit);
6037 
6038  return SCIP_OKAY;
6039 }
6040 
6041 /** set deinitialization method of conflict handler */
6043  SCIP* scip, /**< SCIP data structure */
6044  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6045  SCIP_DECL_CONFLICTEXIT((*conflictexit)) /**< deinitialize conflict handler */
6046  )
6047 {
6048  assert(scip != NULL);
6049 
6050  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6051 
6052  SCIPconflicthdlrSetExit(conflicthdlr, conflictexit);
6053 
6054  return SCIP_OKAY;
6055 }
6056 
6057 /** set solving process initialization method of conflict handler */
6059  SCIP* scip, /**< SCIP data structure */
6060  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6061  SCIP_DECL_CONFLICTINITSOL((*conflictinitsol))/**< solving process initialization method of conflict handler */
6062  )
6063 {
6064  assert(scip != NULL);
6065 
6066  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6067 
6068  SCIPconflicthdlrSetInitsol(conflicthdlr, conflictinitsol);
6069 
6070  return SCIP_OKAY;
6071 }
6072 
6073 /** set solving process deinitialization method of conflict handler */
6075  SCIP* scip, /**< SCIP data structure */
6076  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6077  SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol))/**< solving process deinitialization method of conflict handler */
6078  )
6079 {
6080  assert(scip != NULL);
6081 
6082  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6083 
6084  SCIPconflicthdlrSetExitsol(conflicthdlr, conflictexitsol);
6085 
6086  return SCIP_OKAY;
6087 }
6088 
6089 /** returns the conflict handler of the given name, or NULL if not existing */
6091  SCIP* scip, /**< SCIP data structure */
6092  const char* name /**< name of conflict handler */
6093  )
6094 {
6095  assert(scip != NULL);
6096  assert(scip->set != NULL);
6097  assert(name != NULL);
6098 
6099  return SCIPsetFindConflicthdlr(scip->set, name);
6100 }
6101 
6102 /** returns the array of currently available conflict handlers */
6104  SCIP* scip /**< SCIP data structure */
6105  )
6106 {
6107  assert(scip != NULL);
6108  assert(scip->set != NULL);
6109 
6111 
6112  return scip->set->conflicthdlrs;
6113 }
6114 
6115 /** returns the number of currently available conflict handlers */
6117  SCIP* scip /**< SCIP data structure */
6118  )
6119 {
6120  assert(scip != NULL);
6121  assert(scip->set != NULL);
6122 
6123  return scip->set->nconflicthdlrs;
6124 }
6125 
6126 /** sets the priority of a conflict handler */
6128  SCIP* scip, /**< SCIP data structure */
6129  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6130  int priority /**< new priority of the conflict handler */
6131  )
6132 {
6133  assert(scip != NULL);
6134  assert(scip->set != NULL);
6135 
6136  SCIPconflicthdlrSetPriority(conflicthdlr, scip->set, priority);
6137 
6138  return SCIP_OKAY;
6139 }
6140 
6141 /** creates a presolver and includes it in SCIP.
6142  *
6143  * @note method has all presolver callbacks as arguments and is thus changed every time a new
6144  * callback is added
6145  * in future releases; consider using SCIPincludePresolBasic() and setter functions
6146  * if you seek for a method which is less likely to change in future releases
6147  */
6149  SCIP* scip, /**< SCIP data structure */
6150  const char* name, /**< name of presolver */
6151  const char* desc, /**< description of presolver */
6152  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
6153  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
6154  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
6155  SCIP_DECL_PRESOLCOPY ((*presolcopy)), /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
6156  SCIP_DECL_PRESOLFREE ((*presolfree)), /**< destructor of presolver to free user data (called when SCIP is exiting) */
6157  SCIP_DECL_PRESOLINIT ((*presolinit)), /**< initialization method of presolver (called after problem was transformed) */
6158  SCIP_DECL_PRESOLEXIT ((*presolexit)), /**< deinitialization method of presolver (called before transformed problem is freed) */
6159  SCIP_DECL_PRESOLINITPRE((*presolinitpre)),/**< presolving initialization method of presolver (called when presolving is about to begin) */
6160  SCIP_DECL_PRESOLEXITPRE((*presolexitpre)),/**< presolving deinitialization method of presolver (called after presolving has been finished) */
6161  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
6162  SCIP_PRESOLDATA* presoldata /**< presolver data */
6163  )
6164 {
6165  SCIP_PRESOL* presol;
6166 
6167  SCIP_CALL( checkStage(scip, "SCIPincludePresol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6168 
6169  /* check whether presolver is already present */
6170  if( SCIPfindPresol(scip, name) != NULL )
6171  {
6172  SCIPerrorMessage("presolver <%s> already included.\n", name);
6173  return SCIP_INVALIDDATA;
6174  }
6175 
6176  SCIP_CALL( SCIPpresolCreate(&presol, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
6177  maxrounds, timing, presolcopy,
6178  presolfree, presolinit, presolexit, presolinitpre, presolexitpre, presolexec, presoldata) );
6179  SCIP_CALL( SCIPsetIncludePresol(scip->set, presol) );
6180 
6181  return SCIP_OKAY;
6182 }
6183 
6184 /** creates a presolver and includes it in SCIP with its fundamental callback. All non-fundamental (or optional)
6185  * callbacks as, e.g., init and exit callbacks, will be set to NULL. Optional callbacks can be set via specific setter
6186  * functions. These are SCIPsetPresolCopy(), SCIPsetPresolFree(), SCIPsetPresolInit(), SCIPsetPresolExit(),
6187  * SCIPsetPresolInitpre(), and SCIPsetPresolExitPre().
6188  *
6189  * @note if you want to set all callbacks with a single method call, consider using SCIPincludePresol() instead
6190  */
6192  SCIP* scip, /**< SCIP data structure */
6193  SCIP_PRESOL** presolptr, /**< reference to presolver, or NULL */
6194  const char* name, /**< name of presolver */
6195  const char* desc, /**< description of presolver */
6196  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
6197  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
6198  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
6199  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
6200  SCIP_PRESOLDATA* presoldata /**< presolver data */
6201  )
6202 {
6203  SCIP_PRESOL* presol;
6204 
6205  SCIP_CALL( checkStage(scip, "SCIPincludePresolBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6206 
6207  /* check whether presolver is already present */
6208  if( SCIPfindPresol(scip, name) != NULL )
6209  {
6210  SCIPerrorMessage("presolver <%s> already included.\n", name);
6211  return SCIP_INVALIDDATA;
6212  }
6213 
6214  SCIP_CALL( SCIPpresolCreate(&presol, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority, maxrounds, timing,
6215  NULL,
6216  NULL, NULL, NULL, NULL, NULL, presolexec, presoldata) );
6217  SCIP_CALL( SCIPsetIncludePresol(scip->set, presol) );
6218 
6219  if( presolptr != NULL )
6220  *presolptr = presol;
6221 
6222  return SCIP_OKAY;
6223 }
6224 
6225 /** sets copy method of presolver */
6227  SCIP* scip, /**< SCIP data structure */
6228  SCIP_PRESOL* presol, /**< presolver */
6229  SCIP_DECL_PRESOLCOPY ((*presolcopy)) /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
6230  )
6231 {
6232  SCIP_CALL( checkStage(scip, "SCIPsetPresolCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6233 
6234  assert(presol != NULL);
6235 
6236  SCIPpresolSetCopy(presol, presolcopy);
6237 
6238  return SCIP_OKAY;
6239 }
6240 
6241 /** sets destructor method of presolver */
6243  SCIP* scip, /**< SCIP data structure */
6244  SCIP_PRESOL* presol, /**< presolver */
6245  SCIP_DECL_PRESOLFREE ((*presolfree)) /**< destructor of presolver */
6246  )
6247 {
6248  SCIP_CALL( checkStage(scip, "SCIPsetPresolFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6249 
6250  assert(presol != NULL);
6251 
6252  SCIPpresolSetFree(presol, presolfree);
6253 
6254  return SCIP_OKAY;
6255 }
6256 
6257 /** sets initialization method of presolver */
6259  SCIP* scip, /**< SCIP data structure */
6260  SCIP_PRESOL* presol, /**< presolver */
6261  SCIP_DECL_PRESOLINIT ((*presolinit)) /**< initialize presolver */
6262  )
6263 {
6264  SCIP_CALL( checkStage(scip, "SCIPsetPresolInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6265 
6266  assert(presol != NULL);
6267 
6268  SCIPpresolSetInit(presol, presolinit);
6269 
6270  return SCIP_OKAY;
6271 }
6272 
6273 /** sets deinitialization method of presolver */
6275  SCIP* scip, /**< SCIP data structure */
6276  SCIP_PRESOL* presol, /**< presolver */
6277  SCIP_DECL_PRESOLEXIT ((*presolexit)) /**< deinitialize presolver */
6278  )
6279 {
6280  SCIP_CALL( checkStage(scip, "SCIPsetPresolExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6281 
6282  assert(presol != NULL);
6283 
6284  SCIPpresolSetExit(presol, presolexit);
6285 
6286  return SCIP_OKAY;
6287 }
6288 
6289 /** sets solving process initialization method of presolver */
6291  SCIP* scip, /**< SCIP data structure */
6292  SCIP_PRESOL* presol, /**< presolver */
6293  SCIP_DECL_PRESOLINITPRE ((*presolinitpre))/**< solving process initialization method of presolver */
6294  )
6295 {
6296  SCIP_CALL( checkStage(scip, "SCIPsetPresolInitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6297 
6298  assert(presol != NULL);
6299 
6300  SCIPpresolSetInitpre(presol, presolinitpre);
6301 
6302  return SCIP_OKAY;
6303 }
6304 
6305 /** sets solving process deinitialization method of presolver */
6307  SCIP* scip, /**< SCIP data structure */
6308  SCIP_PRESOL* presol, /**< presolver */
6309  SCIP_DECL_PRESOLEXITPRE ((*presolexitpre))/**< solving process deinitialization method of presolver */
6310  )
6311 {
6312  SCIP_CALL( checkStage(scip, "SCIPsetPresolExitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6313 
6314  assert(presol != NULL);
6315 
6316  SCIPpresolSetExitpre(presol, presolexitpre);
6317 
6318  return SCIP_OKAY;
6319 }
6320 
6321 /** returns the presolver of the given name, or NULL if not existing */
6323  SCIP* scip, /**< SCIP data structure */
6324  const char* name /**< name of presolver */
6325  )
6326 {
6327  assert(scip != NULL);
6328  assert(scip->set != NULL);
6329  assert(name != NULL);
6330 
6331  return SCIPsetFindPresol(scip->set, name);
6332 }
6333 
6334 /** returns the array of currently available presolvers */
6336  SCIP* scip /**< SCIP data structure */
6337  )
6338 {
6339  assert(scip != NULL);
6340  assert(scip->set != NULL);
6341 
6342  SCIPsetSortPresols(scip->set);
6343 
6344  return scip->set->presols;
6345 }
6346 
6347 /** returns the number of currently available presolvers */
6349  SCIP* scip /**< SCIP data structure */
6350  )
6351 {
6352  assert(scip != NULL);
6353  assert(scip->set != NULL);
6354 
6355  return scip->set->npresols;
6356 }
6357 
6358 /** sets the priority of a presolver */
6360  SCIP* scip, /**< SCIP data structure */
6361  SCIP_PRESOL* presol, /**< presolver */
6362  int priority /**< new priority of the presolver */
6363  )
6364 {
6365  assert(scip != NULL);
6366  assert(scip->set != NULL);
6367 
6368  SCIPpresolSetPriority(presol, scip->set, priority);
6369 
6370  return SCIP_OKAY;
6371 }
6372 
6373 /** creates a relaxation handler and includes it in SCIP
6374  *
6375  * @note method has all relaxation handler callbacks as arguments and is thus changed every time a new
6376  * callback is added
6377  * in future releases; consider using SCIPincludeRelaxBasic() and setter functions
6378  * if you seek for a method which is less likely to change in future releases
6379  */
6381  SCIP* scip, /**< SCIP data structure */
6382  const char* name, /**< name of relaxation handler */
6383  const char* desc, /**< description of relaxation handler */
6384  int priority, /**< priority of the relaxation handler (negative: after LP, non-negative: before LP) */
6385  int freq, /**< frequency for calling relaxation handler */
6386  SCIP_DECL_RELAXCOPY ((*relaxcopy)), /**< copy method of relaxation handler or NULL if you don't want to copy your plugin into sub-SCIPs */
6387  SCIP_DECL_RELAXFREE ((*relaxfree)), /**< destructor of relaxation handler */
6388  SCIP_DECL_RELAXINIT ((*relaxinit)), /**< initialize relaxation handler */
6389  SCIP_DECL_RELAXEXIT ((*relaxexit)), /**< deinitialize relaxation handler */
6390  SCIP_DECL_RELAXINITSOL((*relaxinitsol)), /**< solving process initialization method of relaxation handler */
6391  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), /**< solving process deinitialization method of relaxation handler */
6392  SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxation handler */
6393  SCIP_RELAXDATA* relaxdata /**< relaxation handler data */
6394  )
6395 {
6396  SCIP_RELAX* relax;
6397 
6398  SCIP_CALL( checkStage(scip, "SCIPincludeRelax", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6399 
6400  /* check whether relaxation handler is already present */
6401  if( SCIPfindRelax(scip, name) != NULL )
6402  {
6403  SCIPerrorMessage("relaxation handler <%s> already included.\n", name);
6404  return SCIP_INVALIDDATA;
6405  }
6406 
6407  SCIP_CALL( SCIPrelaxCreate(&relax, scip->set, scip->messagehdlr, scip->mem->setmem,
6408  name, desc, priority, freq,
6409  relaxcopy,
6410  relaxfree, relaxinit, relaxexit, relaxinitsol, relaxexitsol, relaxexec, relaxdata) );
6411  SCIP_CALL( SCIPsetIncludeRelax(scip->set, relax) );
6412 
6413  return SCIP_OKAY;
6414 }
6415 
6416 /** creates a relaxation handler and includes it in SCIP. All non fundamental
6417  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
6418  * Optional callbacks can be set via specific setter functions, see SCIPsetRelaxInit(), SCIPsetRelaxExit(),
6419  * SCIPsetRelaxCopy(), SCIPsetRelaxFree(), SCIPsetRelaxInitsol(), and SCIPsetRelaxExitsol()
6420  *
6421  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeRelax() instead
6422  */
6424  SCIP* scip, /**< SCIP data structure */
6425  SCIP_RELAX** relaxptr, /**< reference to relaxation pointer, or NULL */
6426  const char* name, /**< name of relaxation handler */
6427  const char* desc, /**< description of relaxation handler */
6428  int priority, /**< priority of the relaxation handler (negative: after LP, non-negative: before LP) */
6429  int freq, /**< frequency for calling relaxation handler */
6430  SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxation handler */
6431  SCIP_RELAXDATA* relaxdata /**< relaxation handler data */
6432  )
6433 {
6434  SCIP_RELAX* relax;
6435 
6436  SCIP_CALL( checkStage(scip, "SCIPincludeRelaxBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6437 
6438  /* check whether relaxation handler is already present */
6439  if( SCIPfindRelax(scip, name) != NULL )
6440  {
6441  SCIPerrorMessage("relaxation handler <%s> already included.\n", name);
6442  return SCIP_INVALIDDATA;
6443  }
6444 
6445  SCIP_CALL( SCIPrelaxCreate(&relax, scip->set, scip->messagehdlr, scip->mem->setmem,
6446  name, desc, priority, freq,
6447  NULL, NULL, NULL, NULL, NULL, NULL, relaxexec, relaxdata) );
6448  SCIP_CALL( SCIPsetIncludeRelax(scip->set, relax) );
6449 
6450  if( relaxptr != NULL )
6451  *relaxptr = relax;
6452 
6453  return SCIP_OKAY;
6454 }
6455 
6456 /** sets copy method of relaxation handler */
6458  SCIP* scip, /**< SCIP data structure */
6459  SCIP_RELAX* relax, /**< relaxation handler */
6460  SCIP_DECL_RELAXCOPY ((*relaxcopy)) /**< copy method of relaxation handler or NULL if you don't want to copy your plugin into sub-SCIPs */
6461  )
6462 {
6463  SCIP_CALL( checkStage(scip, "SCIPsetRelaxCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6464 
6465  assert(relax != NULL);
6466 
6467  SCIPrelaxSetCopy(relax, relaxcopy);
6468 
6469  return SCIP_OKAY;
6470 }
6471 
6472 /** sets destructor method of relaxation handler */
6474  SCIP* scip, /**< SCIP data structure */
6475  SCIP_RELAX* relax, /**< relaxation handler */
6476  SCIP_DECL_RELAXFREE ((*relaxfree)) /**< destructor of relaxation handler */
6477  )
6478 {
6479  SCIP_CALL( checkStage(scip, "SCIPsetRelaxFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6480 
6481  assert(relax != NULL);
6482 
6483  SCIPrelaxSetFree(relax, relaxfree);
6484 
6485  return SCIP_OKAY;
6486 }
6487 
6488 /** sets initialization method of relaxation handler */
6490  SCIP* scip, /**< SCIP data structure */
6491  SCIP_RELAX* relax, /**< relaxation handler */
6492  SCIP_DECL_RELAXINIT ((*relaxinit)) /**< initialize relaxation handler */
6493  )
6494 {
6495  SCIP_CALL( checkStage(scip, "SCIPsetRelaxInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6496 
6497  assert(relax != NULL);
6498 
6499  SCIPrelaxSetInit(relax, relaxinit);
6500 
6501  return SCIP_OKAY;
6502 }
6503 
6504 /** sets deinitialization method of relaxation handler */
6506  SCIP* scip, /**< SCIP data structure */
6507  SCIP_RELAX* relax, /**< relaxation handler */
6508  SCIP_DECL_RELAXEXIT ((*relaxexit)) /**< deinitialize relaxation handler */
6509  )
6510 {
6511  SCIP_CALL( checkStage(scip, "SCIPsetRelaxExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6512 
6513  assert(relax != NULL);
6514 
6515  SCIPrelaxSetExit(relax, relaxexit);
6516 
6517  return SCIP_OKAY;
6518 }
6519 
6520 /** sets solving process initialization method of relaxation handler */
6522  SCIP* scip, /**< SCIP data structure */
6523  SCIP_RELAX* relax, /**< relaxation handler */
6524  SCIP_DECL_RELAXINITSOL((*relaxinitsol)) /**< solving process initialization method of relaxation handler */
6525  )
6526 {
6527  SCIP_CALL( checkStage(scip, "SCIPsetRelaxInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6528 
6529  assert(relax != NULL);
6530 
6531  SCIPrelaxSetInitsol(relax, relaxinitsol);
6532 
6533  return SCIP_OKAY;
6534 }
6535 
6536 /** sets solving process deinitialization method of relaxation handler */
6538  SCIP* scip, /**< SCIP data structure */
6539  SCIP_RELAX* relax, /**< relaxation handler */
6540  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)) /**< solving process deinitialization method of relaxation handler */
6541  )
6542 {
6543  SCIP_CALL( checkStage(scip, "SCIPsetRelaxExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6544 
6545  assert(relax != NULL);
6546 
6547  SCIPrelaxSetExitsol(relax, relaxexitsol);
6548 
6549  return SCIP_OKAY;
6550 }
6551 
6552 
6553 /** returns the relaxation handler of the given name, or NULL if not existing */
6555  SCIP* scip, /**< SCIP data structure */
6556  const char* name /**< name of relaxation handler */
6557  )
6558 {
6559  assert(scip != NULL);
6560  assert(scip->set != NULL);
6561  assert(name != NULL);
6562 
6563  return SCIPsetFindRelax(scip->set, name);
6564 }
6565 
6566 /** returns the array of currently available relaxation handlers */
6568  SCIP* scip /**< SCIP data structure */
6569  )
6570 {
6571  assert(scip != NULL);
6572  assert(scip->set != NULL);
6573 
6574  SCIPsetSortRelaxs(scip->set);
6575 
6576  return scip->set->relaxs;
6577 }
6578 
6579 /** returns the number of currently available relaxation handlers */
6581  SCIP* scip /**< SCIP data structure */
6582  )
6583 {
6584  assert(scip != NULL);
6585  assert(scip->set != NULL);
6586 
6587  return scip->set->nrelaxs;
6588 }
6589 
6590 /** sets the priority of a relaxation handler */
6592  SCIP* scip, /**< SCIP data structure */
6593  SCIP_RELAX* relax, /**< relaxation handler */
6594  int priority /**< new priority of the relaxation handler */
6595  )
6596 {
6597  assert(scip != NULL);
6598  assert(scip->set != NULL);
6599 
6600  SCIPrelaxSetPriority(relax, scip->set, priority);
6601 
6602  return SCIP_OKAY;
6603 }
6604 
6605 /** creates a separator and includes it in SCIP.
6606  *
6607  * @note method has all separator callbacks as arguments and is thus changed every time a new
6608  * callback is added
6609  * in future releases; consider using SCIPincludeSepaBasic() and setter functions
6610  * if you seek for a method which is less likely to change in future releases
6611  */
6613  SCIP* scip, /**< SCIP data structure */
6614  const char* name, /**< name of separator */
6615  const char* desc, /**< description of separator */
6616  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
6617  int freq, /**< frequency for calling separator */
6618  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
6619  * to best node's dual bound for applying separation */
6620  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
6621  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
6622  SCIP_DECL_SEPACOPY ((*sepacopy)), /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
6623  SCIP_DECL_SEPAFREE ((*sepafree)), /**< destructor of separator */
6624  SCIP_DECL_SEPAINIT ((*sepainit)), /**< initialize separator */
6625  SCIP_DECL_SEPAEXIT ((*sepaexit)), /**< deinitialize separator */
6626  SCIP_DECL_SEPAINITSOL ((*sepainitsol)), /**< solving process initialization method of separator */
6627  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)), /**< solving process deinitialization method of separator */
6628  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
6629  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
6630  SCIP_SEPADATA* sepadata /**< separator data */
6631  )
6632 {
6633  SCIP_SEPA* sepa;
6634 
6635  SCIP_CALL( checkStage(scip, "SCIPincludeSepa", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6636 
6637  /* check whether separator is already present */
6638  if( SCIPfindSepa(scip, name) != NULL )
6639  {
6640  SCIPerrorMessage("separator <%s> already included.\n", name);
6641  return SCIP_INVALIDDATA;
6642  }
6643 
6644  SCIP_CALL( SCIPsepaCreate(&sepa, scip->set, scip->messagehdlr, scip->mem->setmem,
6645  name, desc, priority, freq, maxbounddist, usessubscip, delay,
6646  sepacopy,
6647  sepafree, sepainit, sepaexit, sepainitsol, sepaexitsol, sepaexeclp, sepaexecsol, sepadata) );
6648  SCIP_CALL( SCIPsetIncludeSepa(scip->set, sepa) );
6649 
6650  return SCIP_OKAY;
6651 }
6652 
6653 /** creates a separator and includes it in SCIP with its most fundamental callbacks. All non-fundamental
6654  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
6655  * Optional callbacks can be set via specific setter functions, see SCIPsetSepaInit(), SCIPsetSepaFree(),
6656  * SCIPsetSepaInitsol(), SCIPsetSepaExitsol(), SCIPsetSepaCopy(), SCIPsetExit().
6657  *
6658  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeSepa() instead
6659  */
6661  SCIP* scip, /**< SCIP data structure */
6662  SCIP_SEPA** sepa, /**< reference to a separator, or NULL */
6663  const char* name, /**< name of separator */
6664  const char* desc, /**< description of separator */
6665  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
6666  int freq, /**< frequency for calling separator */
6667  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
6668  * to best node's dual bound for applying separation */
6669  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
6670  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
6671  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
6672  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
6673  SCIP_SEPADATA* sepadata /**< separator data */
6674  )
6675 {
6676  SCIP_SEPA* sepaptr;
6677 
6678  SCIP_CALL( checkStage(scip, "SCIPincludeSepaBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6679 
6680  /* check whether separator is already present */
6681  if( SCIPfindSepa(scip, name) != NULL )
6682  {
6683  SCIPerrorMessage("separator <%s> already included.\n", name);
6684  return SCIP_INVALIDDATA;
6685  }
6686 
6687  SCIP_CALL( SCIPsepaCreate(&sepaptr, scip->set, scip->messagehdlr, scip->mem->setmem,
6688  name, desc, priority, freq, maxbounddist, usessubscip, delay,
6689  NULL, NULL, NULL, NULL, NULL, NULL, sepaexeclp, sepaexecsol, sepadata) );
6690 
6691  assert(sepaptr != NULL);
6692 
6693  SCIP_CALL( SCIPsetIncludeSepa(scip->set, sepaptr) );
6694 
6695  if( sepa != NULL)
6696  *sepa = sepaptr;
6697 
6698  return SCIP_OKAY;
6699 }
6700 
6701 /** sets copy method of separator */
6703  SCIP* scip, /**< SCIP data structure */
6704  SCIP_SEPA* sepa, /**< separator */
6705  SCIP_DECL_SEPACOPY ((*sepacopy)) /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
6706  )
6707 {
6708  SCIP_CALL( checkStage(scip, "SCIPsetSepaCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6709 
6710  assert(sepa != NULL);
6711 
6712  SCIPsepaSetCopy(sepa, sepacopy);
6713 
6714  return SCIP_OKAY;
6715 }
6716 
6717 /** sets destructor method of separator */
6719  SCIP* scip, /**< SCIP data structure */
6720  SCIP_SEPA* sepa, /**< separator */
6721  SCIP_DECL_SEPAFREE ((*sepafree)) /**< destructor of separator */
6722  )
6723 {
6724  SCIP_CALL( checkStage(scip, "SCIPsetSepaFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6725 
6726  assert(sepa != NULL);
6727 
6728  SCIPsepaSetFree(sepa, sepafree);
6729 
6730  return SCIP_OKAY;
6731 }
6732 
6733 /** sets initialization method of separator */
6735  SCIP* scip, /**< SCIP data structure */
6736  SCIP_SEPA* sepa, /**< separator */
6737  SCIP_DECL_SEPAINIT ((*sepainit)) /**< initialize separator */
6738  )
6739 {
6740  SCIP_CALL( checkStage(scip, "SCIPsetSepaInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6741 
6742  assert(sepa != NULL);
6743 
6744  SCIPsepaSetInit(sepa, sepainit);
6745 
6746  return SCIP_OKAY;
6747 }
6748 
6749 /** sets deinitialization method of separator */
6751  SCIP* scip, /**< SCIP data structure */
6752  SCIP_SEPA* sepa, /**< separator */
6753  SCIP_DECL_SEPAEXIT ((*sepaexit)) /**< deinitialize separator */
6754  )
6755 {
6756  SCIP_CALL( checkStage(scip, "SCIPsetSepaExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6757 
6758  assert(sepa != NULL);
6759 
6760  SCIPsepaSetExit(sepa, sepaexit);
6761 
6762  return SCIP_OKAY;
6763 }
6764 
6765 /** sets solving process initialization method of separator */
6767  SCIP* scip, /**< SCIP data structure */
6768  SCIP_SEPA* sepa, /**< separator */
6769  SCIP_DECL_SEPAINITSOL ((*sepainitsol)) /**< solving process initialization method of separator */
6770  )
6771 {
6772  SCIP_CALL( checkStage(scip, "SCIPsetSepaInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6773 
6774  assert(sepa != NULL);
6775 
6776  SCIPsepaSetInitsol(sepa, sepainitsol);
6777 
6778  return SCIP_OKAY;
6779 }
6780 
6781 /** sets solving process deinitialization method of separator */
6783  SCIP* scip, /**< SCIP data structure */
6784  SCIP_SEPA* sepa, /**< separator */
6785  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)) /**< solving process deinitialization method of separator */
6786  )
6787 {
6788  SCIP_CALL( checkStage(scip, "SCIPsetSepaExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6789 
6790  assert(sepa != NULL);
6791 
6792  SCIPsepaSetExitsol(sepa, sepaexitsol);
6793 
6794  return SCIP_OKAY;
6795 }
6796 
6797 /** returns the separator of the given name, or NULL if not existing */
6799  SCIP* scip, /**< SCIP data structure */
6800  const char* name /**< name of separator */
6801  )
6802 {
6803  assert(scip != NULL);
6804  assert(scip->set != NULL);
6805  assert(name != NULL);
6806 
6807  return SCIPsetFindSepa(scip->set, name);
6808 }
6809 
6810 /** returns the array of currently available separators */
6812  SCIP* scip /**< SCIP data structure */
6813  )
6814 {
6815  assert(scip != NULL);
6816  assert(scip->set != NULL);
6817 
6818  SCIPsetSortSepas(scip->set);
6819 
6820  return scip->set->sepas;
6821 }
6822 
6823 /** returns the number of currently available separators */
6825  SCIP* scip /**< SCIP data structure */
6826  )
6827 {
6828  assert(scip != NULL);
6829  assert(scip->set != NULL);
6830 
6831  return scip->set->nsepas;
6832 }
6833 
6834 /** sets the priority of a separator */
6836  SCIP* scip, /**< SCIP data structure */
6837  SCIP_SEPA* sepa, /**< separator */
6838  int priority /**< new priority of the separator */
6839  )
6840 {
6841  assert(scip != NULL);
6842  assert(scip->set != NULL);
6843 
6844  SCIPsepaSetPriority(sepa, scip->set, priority);
6845 
6846  return SCIP_OKAY;
6847 }
6848 
6849 /** creates a propagator and includes it in SCIP.
6850  *
6851  * @note method has all propagator callbacks as arguments and is thus changed every time a new
6852  * callback is added in future releases; consider using SCIPincludePropBasic() and setter functions
6853  * if you seek for a method which is less likely to change in future releases
6854  */
6856  SCIP* scip, /**< SCIP data structure */
6857  const char* name, /**< name of propagator */
6858  const char* desc, /**< description of propagator */
6859  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
6860  int freq, /**< frequency for calling propagator */
6861  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
6862  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagator should be executed */
6863  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
6864  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
6865  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the propagator's presolving method */
6866  SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
6867  SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */
6868  SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */
6869  SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */
6870  SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */
6871  SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */
6872  SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */
6873  SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */
6874  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
6875  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
6876  SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */
6877  SCIP_PROPDATA* propdata /**< propagator data */
6878  )
6879 {
6880  SCIP_PROP* prop;
6881 
6882  SCIP_CALL( checkStage(scip, "SCIPincludeProp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6883 
6884  /* check whether propagator is already present */
6885  if( SCIPfindProp(scip, name) != NULL )
6886  {
6887  SCIPerrorMessage("propagator <%s> already included.\n", name);
6888  return SCIP_INVALIDDATA;
6889  }
6890 
6891  SCIP_CALL( SCIPpropCreate(&prop, scip->set, scip->messagehdlr, scip->mem->setmem,
6892  name, desc, priority, freq, delay, timingmask, presolpriority, presolmaxrounds, presoltiming,
6893  propcopy,
6894  propfree, propinit, propexit, propinitpre, propexitpre, propinitsol, propexitsol,
6895  proppresol, propexec, propresprop, propdata) );
6896  SCIP_CALL( SCIPsetIncludeProp(scip->set, prop) );
6897 
6898  return SCIP_OKAY;
6899 }
6900 
6901 /** creates a propagator and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
6902  * Optional callbacks can be set via specific setter functions, see SCIPsetPropInit(), SCIPsetPropExit(),
6903  * SCIPsetPropCopy(), SCIPsetPropFree(), SCIPsetPropInitsol(), SCIPsetPropExitsol(),
6904  * SCIPsetPropInitpre(), SCIPsetPropExitpre(), SCIPsetPropPresol(), and SCIPsetPropResprop().
6905  *
6906 * @note if you want to set all callbacks with a single method call, consider using SCIPincludeProp() instead
6907  */
6909  SCIP* scip, /**< SCIP data structure */
6910  SCIP_PROP** propptr, /**< reference to a propagator pointer, or NULL */
6911  const char* name, /**< name of propagator */
6912  const char* desc, /**< description of propagator */
6913  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
6914  int freq, /**< frequency for calling propagator */
6915  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
6916  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagators should be executed */
6917  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
6918  SCIP_PROPDATA* propdata /**< propagator data */
6919  )
6920 {
6921  SCIP_PROP* prop;
6922 
6923  SCIP_CALL( checkStage(scip, "SCIPincludePropBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6924 
6925  /* check whether propagator is already present */
6926  if( SCIPfindProp(scip, name) != NULL )
6927  {
6928  SCIPerrorMessage("propagator <%s> already included.\n", name);
6929  return SCIP_INVALIDDATA;
6930  }
6931 
6932  SCIP_CALL( SCIPpropCreate(&prop, scip->set, scip->messagehdlr, scip->mem->setmem,
6933  name, desc, priority, freq, delay, timingmask, 0, -1, SCIP_PRESOLTIMING_ALWAYS,
6934  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
6935  NULL, propexec, NULL, propdata) );
6936  SCIP_CALL( SCIPsetIncludeProp(scip->set, prop) );
6937 
6938  if( propptr != NULL )
6939  *propptr = prop;
6940 
6941  return SCIP_OKAY;
6942 }
6943 
6944 /** sets copy method of propagator */
6946  SCIP* scip, /**< SCIP data structure */
6947  SCIP_PROP* prop, /**< propagator */
6948  SCIP_DECL_PROPCOPY ((*propcopy)) /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
6949  )
6950 {
6951  SCIP_CALL( checkStage(scip, "SCIPsetPropCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6952 
6953  assert(prop != NULL);
6954 
6955  SCIPpropSetCopy(prop, propcopy);
6956 
6957  return SCIP_OKAY;
6958 }
6959 
6960 /** sets destructor method of propagator */
6962  SCIP* scip, /**< SCIP data structure */
6963  SCIP_PROP* prop, /**< propagator */
6964  SCIP_DECL_PROPFREE ((*propfree)) /**< destructor of propagator */
6965  )
6966 {
6967  SCIP_CALL( checkStage(scip, "SCIPsetPropFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6968 
6969  assert(prop != NULL);
6970 
6971  SCIPpropSetFree(prop, propfree);
6972 
6973  return SCIP_OKAY;
6974 }
6975 
6976 /** sets initialization method of propagator */
6978  SCIP* scip, /**< SCIP data structure */
6979  SCIP_PROP* prop, /**< propagator */
6980  SCIP_DECL_PROPINIT ((*propinit)) /**< initialize propagator */
6981  )
6982 {
6983  SCIP_CALL( checkStage(scip, "SCIPsetPropInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6984 
6985  assert(prop != NULL);
6986 
6987  SCIPpropSetInit(prop, propinit);
6988 
6989  return SCIP_OKAY;
6990 }
6991 
6992 /** sets deinitialization method of propagator */
6994  SCIP* scip, /**< SCIP data structure */
6995  SCIP_PROP* prop, /**< propagator */
6996  SCIP_DECL_PROPEXIT ((*propexit)) /**< deinitialize propagator */
6997  )
6998 {
6999  SCIP_CALL( checkStage(scip, "SCIPsetPropExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7000 
7001  assert(prop != NULL);
7002 
7003  SCIPpropSetExit(prop, propexit);
7004 
7005  return SCIP_OKAY;
7006 }
7007 
7008 /** sets solving process initialization method of propagator */
7010  SCIP* scip, /**< SCIP data structure */
7011  SCIP_PROP* prop, /**< propagator */
7012  SCIP_DECL_PROPINITSOL((*propinitsol)) /**< solving process initialization method of propagator */
7013  )
7014 {
7015  SCIP_CALL( checkStage(scip, "SCIPsetPropInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7016 
7017  assert(prop != NULL);
7018 
7019  SCIPpropSetInitsol(prop, propinitsol);
7020 
7021  return SCIP_OKAY;
7022 }
7023 
7024 /** sets solving process deinitialization method of propagator */
7026  SCIP* scip, /**< SCIP data structure */
7027  SCIP_PROP* prop, /**< propagator */
7028  SCIP_DECL_PROPEXITSOL ((*propexitsol)) /**< solving process deinitialization method of propagator */
7029  )
7030 {
7031  SCIP_CALL( checkStage(scip, "SCIPsetPropExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7032 
7033  assert(prop != NULL);
7034 
7035  SCIPpropSetExitsol(prop, propexitsol);
7036 
7037  return SCIP_OKAY;
7038 }
7039 
7040 /** sets preprocessing initialization method of propagator */
7042  SCIP* scip, /**< SCIP data structure */
7043  SCIP_PROP* prop, /**< propagator */
7044  SCIP_DECL_PROPINITPRE((*propinitpre)) /**< preprocessing initialization method of propagator */
7045  )
7046 {
7047  SCIP_CALL( checkStage(scip, "SCIPsetPropInitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7048 
7049  assert(prop != NULL);
7050 
7051  SCIPpropSetInitpre(prop, propinitpre);
7052 
7053  return SCIP_OKAY;
7054 }
7055 
7056 /** sets preprocessing deinitialization method of propagator */
7058  SCIP* scip, /**< SCIP data structure */
7059  SCIP_PROP* prop, /**< propagator */
7060  SCIP_DECL_PROPEXITPRE((*propexitpre)) /**< preprocessing deinitialization method of propagator */
7061  )
7062 {
7063  SCIP_CALL( checkStage(scip, "SCIPsetPropExitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7064 
7065  assert(prop != NULL);
7066 
7067  SCIPpropSetExitpre(prop, propexitpre);
7068 
7069  return SCIP_OKAY;
7070 }
7071 
7072 /** sets presolving method of propagator */
7074  SCIP* scip, /**< SCIP data structure */
7075  SCIP_PROP* prop, /**< propagator */
7076  SCIP_DECL_PROPPRESOL((*proppresol)), /**< presolving method of propagator */
7077  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
7078  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
7079  SCIP_PRESOLTIMING presoltiming /**< timing mask of the propagator's presolving method */
7080  )
7081 {
7082  const char* name;
7083  char paramname[SCIP_MAXSTRLEN];
7084 
7085  assert(scip != NULL);
7086  SCIP_CALL( checkStage(scip, "SCIPsetPropPresol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7087 
7088  assert(prop != NULL);
7089  SCIP_CALL( SCIPpropSetPresol(prop, proppresol, presolpriority, presolmaxrounds, presoltiming) );
7090 
7091  name = SCIPpropGetName(prop);
7092 
7093  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/maxprerounds", name);
7094  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, presolmaxrounds) );
7095 
7096  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/presolpriority", name);
7097  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, presolpriority) );
7098 
7099  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/presoltiming", name);
7100  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, (int) presoltiming) );
7101 
7102  return SCIP_OKAY;
7103 }
7104 
7105 /** sets propagation conflict resolving callback of propagator */
7107  SCIP* scip, /**< SCIP data structure */
7108  SCIP_PROP* prop, /**< propagator */
7109  SCIP_DECL_PROPRESPROP ((*propresprop)) /**< propagation conflict resolving callback */
7110  )
7111 {
7112  SCIP_CALL( checkStage(scip, "SCIPsetPropResprop", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7113 
7114  assert(prop != NULL);
7115 
7116  SCIPpropSetResprop(prop, propresprop);
7117 
7118  return SCIP_OKAY;
7119 }
7120 
7121 
7122 /** returns the propagator of the given name, or NULL if not existing */
7124  SCIP* scip, /**< SCIP data structure */
7125  const char* name /**< name of propagator */
7126  )
7127 {
7128  assert(scip != NULL);
7129  assert(scip->set != NULL);
7130  assert(name != NULL);
7131 
7132  return SCIPsetFindProp(scip->set, name);
7133 }
7134 
7135 /** returns the array of currently available propagators */
7137  SCIP* scip /**< SCIP data structure */
7138  )
7139 {
7140  assert(scip != NULL);
7141  assert(scip->set != NULL);
7142 
7143  SCIPsetSortProps(scip->set);
7144 
7145  return scip->set->props;
7146 }
7147 
7148 /** returns the number of currently available propagators */
7150  SCIP* scip /**< SCIP data structure */
7151  )
7152 {
7153  assert(scip != NULL);
7154  assert(scip->set != NULL);
7155 
7156  return scip->set->nprops;
7157 }
7158 
7159 /** sets the priority of a propagator */
7161  SCIP* scip, /**< SCIP data structure */
7162  SCIP_PROP* prop, /**< propagator */
7163  int priority /**< new priority of the propagator */
7164  )
7165 {
7166  assert(scip != NULL);
7167  assert(scip->set != NULL);
7168 
7169  SCIPpropSetPriority(prop, scip->set, priority);
7170 
7171  return SCIP_OKAY;
7172 }
7173 
7174 /** sets the presolving priority of a propagator */
7176  SCIP* scip, /**< SCIP data structure */
7177  SCIP_PROP* prop, /**< propagator */
7178  int presolpriority /**< new presol priority of the propagator */
7179  )
7180 {
7181  assert(scip != NULL);
7182  assert(scip->set != NULL);
7183 
7184  SCIPpropSetPresolPriority(prop, scip->set, presolpriority);
7185 
7186  return SCIP_OKAY;
7187 }
7188 
7189 /** creates a primal heuristic and includes it in SCIP.
7190  *
7191  * @note method has all heuristic callbacks as arguments and is thus changed every time a new
7192  * callback is added in future releases; consider using SCIPincludeHeurBasic() and setter functions
7193  * if you seek for a method which is less likely to change in future releases
7194  *
7195  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
7196  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
7197  *
7198  * @pre This method can be called if @p scip is in one of the following stages:
7199  * - \ref SCIP_STAGE_INIT
7200  * - \ref SCIP_STAGE_PROBLEM
7201  */
7203  SCIP* scip, /**< SCIP data structure */
7204  const char* name, /**< name of primal heuristic */
7205  const char* desc, /**< description of primal heuristic */
7206  char dispchar, /**< display character of primal heuristic */
7207  int priority, /**< priority of the primal heuristic */
7208  int freq, /**< frequency for calling primal heuristic */
7209  int freqofs, /**< frequency offset for calling primal heuristic */
7210  int maxdepth, /**< maximal depth level to call heuristic at (-1: no limit) */
7211  unsigned int timingmask, /**< positions in the node solving loop where heuristic should be executed;
7212  * see definition of SCIP_HeurTiming for possible values */
7213  SCIP_Bool usessubscip, /**< does the heuristic use a secondary SCIP instance? */
7214  SCIP_DECL_HEURCOPY ((*heurcopy)), /**< copy method of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
7215  SCIP_DECL_HEURFREE ((*heurfree)), /**< destructor of primal heuristic */
7216  SCIP_DECL_HEURINIT ((*heurinit)), /**< initialize primal heuristic */
7217  SCIP_DECL_HEUREXIT ((*heurexit)), /**< deinitialize primal heuristic */
7218  SCIP_DECL_HEURINITSOL ((*heurinitsol)), /**< solving process initialization method of primal heuristic */
7219  SCIP_DECL_HEUREXITSOL ((*heurexitsol)), /**< solving process deinitialization method of primal heuristic */
7220  SCIP_DECL_HEUREXEC ((*heurexec)), /**< execution method of primal heuristic */
7221  SCIP_HEURDATA* heurdata /**< primal heuristic data */
7222  )
7223 {
7224  SCIP_HEUR* heur;
7225 
7226  SCIP_CALL( checkStage(scip, "SCIPincludeHeur", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7227 
7228  /* check whether heuristic is already present */
7229  if( SCIPfindHeur(scip, name) != NULL )
7230  {
7231  SCIPerrorMessage("heuristic <%s> already included.\n", name);
7232  return SCIP_INVALIDDATA;
7233  }
7234 
7235  SCIP_CALL( SCIPheurCreate(&heur, scip->set, scip->messagehdlr, scip->mem->setmem,
7236  name, desc, dispchar, priority, freq, freqofs, maxdepth, timingmask, usessubscip,
7237  heurcopy, heurfree, heurinit, heurexit, heurinitsol, heurexitsol, heurexec, heurdata) );
7238 
7239  SCIP_CALL( SCIPsetIncludeHeur(scip->set, heur) );
7240 
7241  return SCIP_OKAY;
7242 }
7243 
7244 /** creates a primal heuristic and includes it in SCIP with its most fundamental callbacks.
7245  * All non-fundamental (or optional) callbacks
7246  * as, e. g., init and exit callbacks, will be set to NULL.
7247  * Optional callbacks can be set via specific setter functions, see SCIPsetHeurCopy(), SCIPsetHeurFree(),
7248  * SCIPsetHeurInit(), SCIPsetHeurExit(), SCIPsetHeurInitsol(), and SCIPsetHeurExitsol()
7249  *
7250 * @note if you want to set all callbacks with a single method call, consider using SCIPincludeHeur() instead
7251  */
7253  SCIP* scip, /**< SCIP data structure */
7254  SCIP_HEUR** heur, /**< pointer to primal heuristic */
7255  const char* name, /**< name of primal heuristic */
7256  const char* desc, /**< description of primal heuristic */
7257  char dispchar, /**< display character of primal heuristic */
7258  int priority, /**< priority of the primal heuristic */
7259  int freq, /**< frequency for calling primal heuristic */
7260  int freqofs, /**< frequency offset for calling primal heuristic */
7261  int maxdepth, /**< maximal depth level to call heuristic at (-1: no limit) */
7262  unsigned int timingmask, /**< positions in the node solving loop where heuristic should be executed;
7263  * see definition of SCIP_HeurTiming for possible values */
7264  SCIP_Bool usessubscip, /**< does the heuristic use a secondary SCIP instance? */
7265  SCIP_DECL_HEUREXEC ((*heurexec)), /**< execution method of primal heuristic */
7266  SCIP_HEURDATA* heurdata /**< primal heuristic data */
7267  )
7268 {
7269  SCIP_HEUR* heurptr;
7270 
7271  SCIP_CALL( checkStage(scip, "SCIPincludeHeurBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7272 
7273  /* check whether heuristic is already present */
7274  if( SCIPfindHeur(scip, name) != NULL )
7275  {
7276  SCIPerrorMessage("heuristic <%s> already included.\n", name);
7277  return SCIP_INVALIDDATA;
7278  }
7279 
7280  SCIP_CALL( SCIPheurCreate(&heurptr, scip->set, scip->messagehdlr, scip->mem->setmem,
7281  name, desc, dispchar, priority, freq, freqofs, maxdepth, timingmask, usessubscip,
7282  NULL, NULL, NULL, NULL, NULL, NULL, heurexec, heurdata) );
7283 
7284  assert(heurptr != NULL);
7285 
7286  SCIP_CALL( SCIPsetIncludeHeur(scip->set, heurptr) );
7287 
7288  if( heur != NULL )
7289  *heur = heurptr;
7290 
7291  return SCIP_OKAY;
7292 }
7293 
7294 /* new callback/method setter methods */
7295 
7296 /** sets copy method of primal heuristic */
7298  SCIP* scip, /**< SCIP data structure */
7299  SCIP_HEUR* heur, /**< primal heuristic */
7300  SCIP_DECL_HEURCOPY ((*heurcopy)) /**< copy method of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
7301  )
7302 {
7303  SCIP_CALL( checkStage(scip, "SCIPsetHeurCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7304 
7305  assert(heur != NULL);
7306 
7307  SCIPheurSetCopy(heur, heurcopy);
7308 
7309  return SCIP_OKAY;
7310 }
7311 
7312 /** sets destructor method of primal heuristic */
7314  SCIP* scip, /**< SCIP data structure */
7315  SCIP_HEUR* heur, /**< primal heuristic */
7316  SCIP_DECL_HEURFREE ((*heurfree)) /**< destructor of primal heuristic */
7317  )
7318 {
7319  SCIP_CALL( checkStage(scip, "SCIPsetHeurFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7320 
7321  assert(heur != NULL);
7322 
7323  SCIPheurSetFree(heur, heurfree);
7324 
7325  return SCIP_OKAY;
7326 }
7327 
7328 /** sets initialization method of primal heuristic */
7330  SCIP* scip, /**< SCIP data structure */
7331  SCIP_HEUR* heur, /**< primal heuristic */
7332  SCIP_DECL_HEURINIT ((*heurinit)) /**< initialize primal heuristic */
7333  )
7334 {
7335  SCIP_CALL( checkStage(scip, "SCIPsetHeurInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7336 
7337  assert(heur != NULL);
7338 
7339  SCIPheurSetInit(heur, heurinit);
7340 
7341  return SCIP_OKAY;
7342 }
7343 
7344 /** sets deinitialization method of primal heuristic */
7346  SCIP* scip, /**< SCIP data structure */
7347  SCIP_HEUR* heur, /**< primal heuristic */
7348  SCIP_DECL_HEUREXIT ((*heurexit)) /**< deinitialize primal heuristic */
7349  )
7350 {
7351  SCIP_CALL( checkStage(scip, "SCIPsetHeurExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7352 
7353  assert(heur != NULL);
7354 
7355  SCIPheurSetExit(heur, heurexit);
7356 
7357  return SCIP_OKAY;
7358 }
7359 
7360 /** sets solving process initialization method of primal heuristic */
7362  SCIP* scip, /**< SCIP data structure */
7363  SCIP_HEUR* heur, /**< primal heuristic */
7364  SCIP_DECL_HEURINITSOL ((*heurinitsol)) /**< solving process initialization method of primal heuristic */
7365  )
7366 {
7367  SCIP_CALL( checkStage(scip, "SCIPsetHeurInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7368 
7369  assert(heur != NULL);
7370 
7371  SCIPheurSetInitsol(heur, heurinitsol);
7372 
7373  return SCIP_OKAY;
7374 }
7375 
7376 /** sets solving process deinitialization method of primal heuristic */
7378  SCIP* scip, /**< SCIP data structure */
7379  SCIP_HEUR* heur, /**< primal heuristic */
7380  SCIP_DECL_HEUREXITSOL ((*heurexitsol)) /**< solving process deinitialization method of primal heuristic */
7381  )
7382 {
7383  SCIP_CALL( checkStage(scip, "SCIPsetHeurExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7384 
7385  assert(heur != NULL);
7386 
7387  SCIPheurSetExitsol(heur, heurexitsol);
7388 
7389  return SCIP_OKAY;
7390 }
7391 
7392 /** returns the primal heuristic of the given name, or NULL if not existing */
7394  SCIP* scip, /**< SCIP data structure */
7395  const char* name /**< name of primal heuristic */
7396  )
7397 {
7398  assert(scip != NULL);
7399  assert(scip->set != NULL);
7400  assert(name != NULL);
7401 
7402  return SCIPsetFindHeur(scip->set, name);
7403 }
7404 
7405 /** returns the array of currently available primal heuristics */
7407  SCIP* scip /**< SCIP data structure */
7408  )
7409 {
7410  assert(scip != NULL);
7411  assert(scip->set != NULL);
7412 
7413  SCIPsetSortHeurs(scip->set);
7414 
7415  return scip->set->heurs;
7416 }
7417 
7418 /** returns the number of currently available primal heuristics */
7420  SCIP* scip /**< SCIP data structure */
7421  )
7422 {
7423  assert(scip != NULL);
7424  assert(scip->set != NULL);
7425 
7426  return scip->set->nheurs;
7427 }
7428 
7429 /** sets the priority of a primal heuristic */
7431  SCIP* scip, /**< SCIP data structure */
7432  SCIP_HEUR* heur, /**< primal heuristic */
7433  int priority /**< new priority of the primal heuristic */
7434  )
7435 {
7436  assert(scip != NULL);
7437  assert(scip->set != NULL);
7438 
7439  SCIPheurSetPriority(heur, scip->set, priority);
7440 
7441  return SCIP_OKAY;
7442 }
7443 
7444 /** creates a tree compression and includes it in SCIP.
7445  *
7446  * @note method has all compression callbacks as arguments and is thus changed every time a new
7447  * callback is added in future releases; consider using SCIPincludeComprBasic() and setter functions
7448  * if you seek for a method which is less likely to change in future releases
7449  */
7451  SCIP* scip, /**< SCIP data structure */
7452  const char* name, /**< name of tree compression */
7453  const char* desc, /**< description of tree compression */
7454  int priority, /**< priority of the tree compression */
7455  int minnnodes, /**< minimal number of nodes to call compression */
7456  SCIP_DECL_COMPRCOPY ((*comprcopy)), /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
7457  SCIP_DECL_COMPRFREE ((*comprfree)), /**< destructor of tree compression */
7458  SCIP_DECL_COMPRINIT ((*comprinit)), /**< initialize tree compression */
7459  SCIP_DECL_COMPREXIT ((*comprexit)), /**< deinitialize tree compression */
7460  SCIP_DECL_COMPRINITSOL ((*comprinitsol)), /**< solving process initialization method of tree compression */
7461  SCIP_DECL_COMPREXITSOL ((*comprexitsol)), /**< solving process deinitialization method of tree compression */
7462  SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
7463  SCIP_COMPRDATA* comprdata /**< tree compression data */
7464  )
7465 {
7466  SCIP_COMPR* compr;
7467 
7468  SCIP_CALL( checkStage(scip, "SCIPincludeCompr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7469 
7470  /* check whether compression is already present */
7471  if( SCIPfindCompr(scip, name) != NULL )
7472  {
7473  SCIPerrorMessage("compression <%s> already included.\n", name);
7474  return SCIP_INVALIDDATA;
7475  }
7476 
7477  SCIP_CALL( SCIPcomprCreate(&compr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority, minnnodes,
7478  comprcopy, comprfree, comprinit, comprexit, comprinitsol, comprexitsol, comprexec, comprdata) );
7479 
7480  SCIP_CALL( SCIPsetIncludeCompr(scip->set, compr) );
7481 
7482  return SCIP_OKAY;
7483 }
7484 
7485 /** creates a tree compression and includes it in SCIP with its most fundamental callbacks.
7486  * All non-fundamental (or optional) callbacks
7487  * as, e. g., init and exit callbacks, will be set to NULL.
7488  * Optional callbacks can be set via specific setter functions, see SCIPsetComprCopy(), SCIPsetComprFree(),
7489  * SCIPsetComprInit(), SCIPsetComprExit(), SCIPsetComprInitsol(), and SCIPsetComprExitsol()
7490  *
7491  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeCompr() instead
7492  */
7494  SCIP* scip, /**< SCIP data structure */
7495  SCIP_COMPR** compr, /**< pointer to tree compression */
7496  const char* name, /**< name of tree compression */
7497  const char* desc, /**< description of tree compression */
7498  int priority, /**< priority of the tree compression */
7499  int minnnodes, /**< minimal number of nodes to call the compression */
7500  SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
7501  SCIP_COMPRDATA* comprdata /**< tree compression data */
7502  )
7503 {
7504  SCIP_COMPR* comprptr;
7505 
7506  SCIP_CALL( checkStage(scip, "SCIPincludeComprBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7507 
7508  /* check whether heuristic is already present */
7509  if( SCIPfindCompr(scip, name) != NULL )
7510  {
7511  SCIPerrorMessage("tree compression <%s> already included.\n", name);
7512  return SCIP_INVALIDDATA;
7513  }
7514 
7515  SCIP_CALL( SCIPcomprCreate(&comprptr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
7516  minnnodes, NULL, NULL, NULL, NULL, NULL, NULL, comprexec, comprdata) );
7517 
7518  assert(comprptr != NULL);
7519 
7520  SCIP_CALL( SCIPsetIncludeCompr(scip->set, comprptr) );
7521 
7522  if( compr != NULL )
7523  *compr = comprptr;
7524 
7525  return SCIP_OKAY;
7526 }
7527 
7528 /* new callback/method setter methods */
7529 
7530 /** sets copy method of tree compression */
7532  SCIP* scip, /**< SCIP data structure */
7533  SCIP_COMPR* compr, /**< tree compression */
7534  SCIP_DECL_COMPRCOPY ((*comprcopy)) /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
7535  )
7536 {
7537  SCIP_CALL( checkStage(scip, "SCIPsetComprCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7538 
7539  assert(compr != NULL);
7540 
7541  SCIPcomprSetCopy(compr, comprcopy);
7542 
7543  return SCIP_OKAY;
7544 }
7545 
7546 /** sets destructor method of tree compression */
7548  SCIP* scip, /**< SCIP data structure */
7549  SCIP_COMPR* compr, /**< tree compression */
7550  SCIP_DECL_COMPRFREE ((*comprfree)) /**< destructor of tree compression */
7551  )
7552 {
7553  SCIP_CALL( checkStage(scip, "SCIPsetComprFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7554 
7555  assert(compr != NULL);
7556 
7557  SCIPcomprSetFree(compr, comprfree);
7558 
7559  return SCIP_OKAY;
7560 }
7561 
7562 /** sets initialization method of tree compression */
7564  SCIP* scip, /**< SCIP data structure */
7565  SCIP_COMPR* compr, /**< tree compression */
7566  SCIP_DECL_COMPRINIT ((*comprinit)) /**< initialize tree compression */
7567  )
7568 {
7569  SCIP_CALL( checkStage(scip, "SCIPsetComprInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7570 
7571  assert(compr != NULL);
7572 
7573  SCIPcomprSetInit(compr, comprinit);
7574 
7575  return SCIP_OKAY;
7576 }
7577 
7578 /** sets deinitialization method of tree compression */
7580  SCIP* scip, /**< SCIP data structure */
7581  SCIP_COMPR* compr, /**< tree compression */
7582  SCIP_DECL_COMPREXIT ((*comprexit)) /**< deinitialize tree compression */
7583  )
7584 {
7585  SCIP_CALL( checkStage(scip, "SCIPsetComprExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7586 
7587  assert(compr != NULL);
7588 
7589  SCIPcomprSetExit(compr, comprexit);
7590 
7591  return SCIP_OKAY;
7592 }
7593 
7594 /** sets solving process initialization method of tree compression */
7596  SCIP* scip, /**< SCIP data structure */
7597  SCIP_COMPR* compr, /**< tree compression */
7598  SCIP_DECL_COMPRINITSOL ((*comprinitsol)) /**< solving process initialization method of tree compression */
7599  )
7600 {
7601  SCIP_CALL( checkStage(scip, "SCIPsetComprInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7602 
7603  assert(compr != NULL);
7604 
7605  SCIPcomprSetInitsol(compr, comprinitsol);
7606 
7607  return SCIP_OKAY;
7608 }
7609 
7610 /** sets solving process deinitialization method of tree compression */
7612  SCIP* scip, /**< SCIP data structure */
7613  SCIP_COMPR* compr, /**< tree compression */
7614  SCIP_DECL_COMPREXITSOL ((*comprexitsol)) /**< solving process deinitialization method of tree compression */
7615  )
7616 {
7617  SCIP_CALL( checkStage(scip, "SCIPsetComprExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7618 
7619  assert(compr != NULL);
7620 
7621  SCIPcomprSetExitsol(compr, comprexitsol);
7622 
7623  return SCIP_OKAY;
7624 }
7625 
7626 /** returns the tree compression of the given name, or NULL if not existing */
7628  SCIP* scip, /**< SCIP data structure */
7629  const char* name /**< name of tree compression */
7630  )
7631 {
7632  assert(scip != NULL);
7633  assert(scip->set != NULL);
7634  assert(name != NULL);
7635 
7636  return SCIPsetFindCompr(scip->set, name);
7637 }
7638 
7639 /** returns the array of currently available tree compression */
7641  SCIP* scip /**< SCIP data structure */
7642  )
7643 {
7644  assert(scip != NULL);
7645  assert(scip->set != NULL);
7646 
7647  SCIPsetSortComprs(scip->set);
7648 
7649  return scip->set->comprs;
7650 }
7651 
7652 /** returns the number of currently available tree compression */
7654  SCIP* scip /**< SCIP data structure */
7655  )
7656 {
7657  assert(scip != NULL);
7658  assert(scip->set != NULL);
7659 
7660  return scip->set->ncomprs;
7661 }
7662 
7663 /** set the priority of a tree compression method */
7665  SCIP* scip, /**< SCIP data structure */
7666  SCIP_COMPR* compr, /**< compression */
7667  int priority /**< new priority of the tree compression */
7668  )
7669 {
7670  assert(scip != NULL);
7671  assert(scip->set != NULL);
7672 
7673  SCIPcomprSetPriority(compr, scip->set, priority);
7674 
7675  return SCIP_OKAY;
7676 }
7677 
7678 /** create a diving set associated with a primal heuristic. The primal heuristic needs to be included
7679  * before this method can be called. The diveset is installed in the array of divesets of the heuristic
7680  * and can be retrieved later by accessing SCIPheurGetDivesets()
7681  *
7682  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
7683  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
7684  *
7685  * @pre This method can be called if @p scip is in one of the following stages:
7686  * - \ref SCIP_STAGE_INIT
7687  * - \ref SCIP_STAGE_PROBLEM
7688  */
7690  SCIP* scip, /**< SCIP data structure */
7691  SCIP_DIVESET** diveset, /**< pointer to created diving heuristic settings, or NULL if not needed */
7692  SCIP_HEUR* heur, /**< primal heuristic to which the diveset belongs */
7693  const char* name, /**< name for the diveset, or NULL if the name of the heuristic should be used */
7694  SCIP_Real minreldepth, /**< minimal relative depth to start diving */
7695  SCIP_Real maxreldepth, /**< maximal relative depth to start diving */
7696  SCIP_Real maxlpiterquot, /**< maximal fraction of diving LP iterations compared to node LP iterations */
7697  SCIP_Real maxdiveubquot, /**< maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound)
7698  * where diving is performed (0.0: no limit) */
7699  SCIP_Real maxdiveavgquot, /**< maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound)
7700  * where diving is performed (0.0: no limit) */
7701  SCIP_Real maxdiveubquotnosol, /**< maximal UBQUOT when no solution was found yet (0.0: no limit) */
7702  SCIP_Real maxdiveavgquotnosol,/**< maximal AVGQUOT when no solution was found yet (0.0: no limit) */
7703  SCIP_Real lpresolvedomchgquot,/**< percentage of immediate domain changes during probing to trigger LP resolve */
7704  int lpsolvefreq, /**< LP solve frequency for (0: only if enough domain reductions are found by propagation)*/
7705  int maxlpiterofs, /**< additional number of allowed LP iterations */
7706  SCIP_Bool backtrack, /**< use one level of backtracking if infeasibility is encountered? */
7707  SCIP_Bool onlylpbranchcands, /**< should only LP branching candidates be considered instead of the slower but
7708  * more general constraint handler diving variable selection? */
7709  SCIP_Bool specificsos1score, /**< should SOS1 variables be scored by the diving heuristics specific score function;
7710  * otherwise use the score function of the SOS1 constraint handler */
7711  SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)) /**< method for candidate score and rounding direction */
7712  )
7713 {
7714  SCIP_DIVESET* divesetptr;
7715  SCIP_CALL( checkStage(scip, "SCIPcreateDiveset", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7716 
7717  divesetptr = NULL;
7718  /* create the diveset (this will add diving specific parameters for this heuristic) */
7719  SCIP_CALL( SCIPdivesetCreate(&divesetptr, heur, name, scip->set, scip->messagehdlr, scip->mem->setmem,
7720  minreldepth, maxreldepth, maxlpiterquot, maxdiveubquot, maxdiveavgquot, maxdiveubquotnosol,
7721  maxdiveavgquotnosol, lpresolvedomchgquot, lpsolvefreq, maxlpiterofs, backtrack, onlylpbranchcands, specificsos1score, divesetgetscore) );
7722 
7723  assert(divesetptr != NULL);
7724  if( diveset != NULL )
7725  *diveset = divesetptr;
7726 
7727  return SCIP_OKAY;
7728 }
7729 
7730 /** creates an event handler and includes it in SCIP
7731  *
7732  * @note method has all event handler callbacks as arguments and is thus changed every time a new
7733  * callback is added in future releases; consider using SCIPincludeEventhdlrBasic() and setter functions
7734  * if you seek for a method which is less likely to change in future releases
7735  */
7737  SCIP* scip, /**< SCIP data structure */
7738  const char* name, /**< name of event handler */
7739  const char* desc, /**< description of event handler */
7740  SCIP_DECL_EVENTCOPY ((*eventcopy)), /**< copy method of event handler or NULL if you don't want to copy your plugin into sub-SCIPs */
7741  SCIP_DECL_EVENTFREE ((*eventfree)), /**< destructor of event handler */
7742  SCIP_DECL_EVENTINIT ((*eventinit)), /**< initialize event handler */
7743  SCIP_DECL_EVENTEXIT ((*eventexit)), /**< deinitialize event handler */
7744  SCIP_DECL_EVENTINITSOL((*eventinitsol)), /**< solving process initialization method of event handler */
7745  SCIP_DECL_EVENTEXITSOL((*eventexitsol)), /**< solving process deinitialization method of event handler */
7746  SCIP_DECL_EVENTDELETE ((*eventdelete)), /**< free specific event data */
7747  SCIP_DECL_EVENTEXEC ((*eventexec)), /**< execute event handler */
7748  SCIP_EVENTHDLRDATA* eventhdlrdata /**< event handler data */
7749  )
7750 {
7751  SCIP_EVENTHDLR* eventhdlr;
7752 
7753  SCIP_CALL( checkStage(scip, "SCIPincludeEventhdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7754 
7755  /* check whether event handler is already present */
7756  if( SCIPfindEventhdlr(scip, name) != NULL )
7757  {
7758  SCIPerrorMessage("event handler <%s> already included.\n", name);
7759  return SCIP_INVALIDDATA;
7760  }
7761 
7762  SCIP_CALL( SCIPeventhdlrCreate(&eventhdlr, name, desc,
7763  eventcopy,
7764  eventfree, eventinit, eventexit, eventinitsol, eventexitsol, eventdelete, eventexec,
7765  eventhdlrdata) );
7766  SCIP_CALL( SCIPsetIncludeEventhdlr(scip->set, eventhdlr) );
7767 
7768  return SCIP_OKAY;
7769 }
7770 
7771 /** creates an event handler and includes it in SCIP with all its non-fundamental callbacks set
7772  * to NULL; if needed, non-fundamental callbacks can be set afterwards via setter functions
7773  * SCIPsetEventhdlrCopy(), SCIPsetEventhdlrFree(), SCIPsetEventhdlrInit(), SCIPsetEventhdlrExit(),
7774  * SCIPsetEventhdlrInitsol(), SCIPsetEventhdlrExitsol(), and SCIPsetEventhdlrDelete()
7775  *
7776  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeEventhdlr() instead
7777  */
7779  SCIP* scip, /**< SCIP data structure */
7780  SCIP_EVENTHDLR** eventhdlrptr, /**< reference to an event handler, or NULL */
7781  const char* name, /**< name of event handler */
7782  const char* desc, /**< description of event handler */
7783  SCIP_DECL_EVENTEXEC ((*eventexec)), /**< execute event handler */
7784  SCIP_EVENTHDLRDATA* eventhdlrdata /**< event handler data */
7785  )
7786 {
7787  SCIP_EVENTHDLR* eventhdlr;
7788 
7789  SCIP_CALL( checkStage(scip, "SCIPincludeEventhdlrBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7790 
7791  /* check whether event handler is already present */
7792  if( SCIPfindEventhdlr(scip, name) != NULL )
7793  {
7794  SCIPerrorMessage("event handler <%s> already included.\n", name);
7795  return SCIP_INVALIDDATA;
7796  }
7797 
7798  SCIP_CALL( SCIPeventhdlrCreate(&eventhdlr, name, desc,
7799  NULL, NULL, NULL, NULL, NULL, NULL, NULL, eventexec,
7800  eventhdlrdata) );
7801  SCIP_CALL( SCIPsetIncludeEventhdlr(scip->set, eventhdlr) );
7802 
7803  if( eventhdlrptr != NULL )
7804  *eventhdlrptr = eventhdlr;
7805 
7806  return SCIP_OKAY;
7807 }
7808 
7809 /** sets copy callback of the event handler */
7811  SCIP* scip, /**< scip instance */
7812  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
7813  SCIP_DECL_EVENTCOPY ((*eventcopy)) /**< copy callback of the event handler */
7814  )
7815 {
7816  assert(scip != NULL);
7817  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7818 
7819  SCIPeventhdlrSetCopy(eventhdlr, eventcopy);
7820  return SCIP_OKAY;
7821 }
7822 
7823 /** sets deinitialization callback of the event handler */
7825  SCIP* scip, /**< scip instance */
7826  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
7827  SCIP_DECL_EVENTFREE ((*eventfree)) /**< deinitialization callback of the event handler */
7828  )
7829 {
7830  assert(scip != NULL);
7831  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7832 
7833  SCIPeventhdlrSetFree(eventhdlr, eventfree);
7834  return SCIP_OKAY;
7835 }
7836 
7837 /** sets initialization callback of the event handler */
7839  SCIP* scip, /**< scip instance */
7840  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
7841  SCIP_DECL_EVENTINIT ((*eventinit)) /**< initialize event handler */
7842  )
7843 {
7844  assert(scip != NULL);
7845  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7846 
7847  SCIPeventhdlrSetInit(eventhdlr, eventinit);
7848  return SCIP_OKAY;
7849 }
7850 
7851 /** sets deinitialization callback of the event handler */
7853  SCIP* scip, /**< scip instance */
7854  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
7855  SCIP_DECL_EVENTEXIT ((*eventexit)) /**< deinitialize event handler */
7856  )
7857 {
7858  assert(scip != NULL);
7859  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7860 
7861  SCIPeventhdlrSetExit(eventhdlr, eventexit);
7862  return SCIP_OKAY;
7863 }
7864 
7865 /** sets solving process initialization callback of the event handler */
7867  SCIP* scip, /**< scip instance */
7868  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
7869  SCIP_DECL_EVENTINITSOL((*eventinitsol)) /**< solving process initialization callback of event handler */
7870  )
7871 {
7872  assert(scip != NULL);
7873  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7874 
7875  SCIPeventhdlrSetInitsol(eventhdlr, eventinitsol);
7876  return SCIP_OKAY;
7877 }
7878 
7879 /** sets solving process deinitialization callback of the event handler */
7881  SCIP* scip, /**< scip instance */
7882  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
7883  SCIP_DECL_EVENTEXITSOL((*eventexitsol)) /**< solving process deinitialization callback of event handler */
7884  )
7885 {
7886  assert(scip != NULL);
7887  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7888 
7889  SCIPeventhdlrSetExitsol(eventhdlr, eventexitsol);
7890  return SCIP_OKAY;
7891 }
7892 
7893 /** sets callback of the event handler to free specific event data */
7895  SCIP* scip, /**< scip instance */
7896  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
7897  SCIP_DECL_EVENTDELETE ((*eventdelete)) /**< free specific event data */
7898  )
7899 {
7900  assert(scip != NULL);
7901  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrDelete", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7902 
7903  SCIPeventhdlrSetDelete(eventhdlr, eventdelete);
7904  return SCIP_OKAY;
7905 }
7906 
7907 /** returns the event handler of the given name, or NULL if not existing */
7909  SCIP* scip, /**< SCIP data structure */
7910  const char* name /**< name of event handler */
7911  )
7912 {
7913  assert(scip != NULL);
7914  assert(scip->set != NULL);
7915  assert(name != NULL);
7916 
7917  return SCIPsetFindEventhdlr(scip->set, name);
7918 }
7919 
7920 /** returns the array of currently available event handlers */
7922  SCIP* scip /**< SCIP data structure */
7923  )
7924 {
7925  assert(scip != NULL);
7926  assert(scip->set != NULL);
7927 
7928  return scip->set->eventhdlrs;
7929 }
7930 
7931 /** returns the number of currently available event handlers */
7933  SCIP* scip /**< SCIP data structure */
7934  )
7935 {
7936  assert(scip != NULL);
7937  assert(scip->set != NULL);
7938 
7939  return scip->set->neventhdlrs;
7940 }
7941 
7942 /** creates a node selector and includes it in SCIP.
7943  *
7944  * @note method has all node selector callbacks as arguments and is thus changed every time a new
7945  * callback is added in future releases; consider using SCIPincludeNodeselBasic() and setter functions
7946  * if you seek for a method which is less likely to change in future releases
7947  */
7949  SCIP* scip, /**< SCIP data structure */
7950  const char* name, /**< name of node selector */
7951  const char* desc, /**< description of node selector */
7952  int stdpriority, /**< priority of the node selector in standard mode */
7953  int memsavepriority, /**< priority of the node selector in memory saving mode */
7954  SCIP_DECL_NODESELCOPY ((*nodeselcopy)), /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
7955  SCIP_DECL_NODESELFREE ((*nodeselfree)), /**< destructor of node selector */
7956  SCIP_DECL_NODESELINIT ((*nodeselinit)), /**< initialize node selector */
7957  SCIP_DECL_NODESELEXIT ((*nodeselexit)), /**< deinitialize node selector */
7958  SCIP_DECL_NODESELINITSOL((*nodeselinitsol)),/**< solving process initialization method of node selector */
7959  SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)),/**< solving process deinitialization method of node selector */
7960  SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
7961  SCIP_DECL_NODESELCOMP ((*nodeselcomp)), /**< node comparison method */
7962  SCIP_NODESELDATA* nodeseldata /**< node selector data */
7963  )
7964 {
7965  SCIP_NODESEL* nodesel;
7966 
7967  SCIP_CALL( checkStage(scip, "SCIPincludeNodesel", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7968 
7969  /* check whether node selector is already present */
7970  if( SCIPfindNodesel(scip, name) != NULL )
7971  {
7972  SCIPerrorMessage("node selector <%s> already included.\n", name);
7973  return SCIP_INVALIDDATA;
7974  }
7975 
7976  SCIP_CALL( SCIPnodeselCreate(&nodesel, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, stdpriority, memsavepriority,
7977  nodeselcopy,
7978  nodeselfree, nodeselinit, nodeselexit, nodeselinitsol, nodeselexitsol,
7979  nodeselselect, nodeselcomp, nodeseldata) );
7980  SCIP_CALL( SCIPsetIncludeNodesel(scip->set, nodesel) );
7981 
7982  return SCIP_OKAY;
7983 }
7984 
7985 /** Creates a node selector and includes it in SCIP with its most fundamental callbacks. All non-fundamental
7986  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
7987  * Optional callbacks can be set via specific setter functions, see SCIPsetNodeselCopy(), SCIPsetNodeselFree(),
7988  * SCIPsetNodeselInit(), SCIPsetNodeselExit(), SCIPsetNodeselInitsol(), and SCIPsetNodeselExitsol()
7989  *
7990  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeNodesel() instead
7991  */
7993  SCIP* scip, /**< SCIP data structure */
7994  SCIP_NODESEL** nodesel, /**< reference to a node selector, or NULL */
7995  const char* name, /**< name of node selector */
7996  const char* desc, /**< description of node selector */
7997  int stdpriority, /**< priority of the node selector in standard mode */
7998  int memsavepriority, /**< priority of the node selector in memory saving mode */
7999  SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
8000  SCIP_DECL_NODESELCOMP ((*nodeselcomp)), /**< node comparison method */
8001  SCIP_NODESELDATA* nodeseldata /**< node selector data */
8002  )
8003 {
8004  SCIP_NODESEL* nodeselptr;
8005 
8006  SCIP_CALL( checkStage(scip, "SCIPincludeNodeselBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8007 
8008  /* check whether node selector is already present */
8009  if( SCIPfindNodesel(scip, name) != NULL )
8010  {
8011  SCIPerrorMessage("node selector <%s> already included.\n", name);
8012  return SCIP_INVALIDDATA;
8013  }
8014 
8015  SCIP_CALL( SCIPnodeselCreate(&nodeselptr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, stdpriority, memsavepriority,
8016  NULL,
8017  NULL, NULL, NULL, NULL, NULL,
8018  nodeselselect, nodeselcomp, nodeseldata) );
8019  SCIP_CALL( SCIPsetIncludeNodesel(scip->set, nodeselptr) );
8020 
8021  if( nodesel != NULL )
8022  *nodesel = nodeselptr;
8023 
8024  return SCIP_OKAY;
8025 }
8026 
8027 /** sets copy method of node selector */
8029  SCIP* scip, /**< SCIP data structure */
8030  SCIP_NODESEL* nodesel, /**< node selector */
8031  SCIP_DECL_NODESELCOPY ((*nodeselcopy)) /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
8032  )
8033 {
8034  SCIP_CALL( checkStage(scip, "SCIPsetNodeselCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8035 
8036  assert(nodesel != NULL);
8037 
8038  SCIPnodeselSetCopy(nodesel, nodeselcopy);
8039 
8040  return SCIP_OKAY;
8041 }
8042 
8043 /** sets destructor method of node selector */
8045  SCIP* scip, /**< SCIP data structure */
8046  SCIP_NODESEL* nodesel, /**< node selector */
8047  SCIP_DECL_NODESELFREE ((*nodeselfree)) /**< destructor of node selector */
8048  )
8049 {
8050  SCIP_CALL( checkStage(scip, "SCIPsetNodeselFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8051 
8052  assert(nodesel != NULL);
8053 
8054  SCIPnodeselSetFree(nodesel, nodeselfree);
8055 
8056  return SCIP_OKAY;
8057 }
8058 
8059 /** sets initialization method of node selector */
8061  SCIP* scip, /**< SCIP data structure */
8062  SCIP_NODESEL* nodesel, /**< node selector */
8063  SCIP_DECL_NODESELINIT ((*nodeselinit)) /**< initialize node selector */
8064  )
8065 {
8066  SCIP_CALL( checkStage(scip, "SCIPsetNodeselInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8067 
8068  assert(nodesel != NULL);
8069 
8070  SCIPnodeselSetInit(nodesel, nodeselinit);
8071 
8072  return SCIP_OKAY;
8073 }
8074 
8075 /** sets deinitialization method of node selector */
8077  SCIP* scip, /**< SCIP data structure */
8078  SCIP_NODESEL* nodesel, /**< node selector */
8079  SCIP_DECL_NODESELEXIT ((*nodeselexit)) /**< deinitialize node selector */
8080  )
8081 {
8082  SCIP_CALL( checkStage(scip, "SCIPsetNodeselExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8083 
8084  assert(nodesel != NULL);
8085 
8086  SCIPnodeselSetExit(nodesel, nodeselexit);
8087 
8088  return SCIP_OKAY;
8089 }
8090 
8091 /** sets solving process initialization method of node selector */
8093  SCIP* scip, /**< SCIP data structure */
8094  SCIP_NODESEL* nodesel, /**< node selector */
8095  SCIP_DECL_NODESELINITSOL ((*nodeselinitsol))/**< solving process initialization method of node selector */
8096  )
8097 {
8098  SCIP_CALL( checkStage(scip, "SCIPsetNodeselInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8099 
8100  assert(nodesel != NULL);
8101 
8102  SCIPnodeselSetInitsol(nodesel, nodeselinitsol);
8103 
8104  return SCIP_OKAY;
8105 }
8106 
8107 /** sets solving process deinitialization method of node selector */
8109  SCIP* scip, /**< SCIP data structure */
8110  SCIP_NODESEL* nodesel, /**< node selector */
8111  SCIP_DECL_NODESELEXITSOL ((*nodeselexitsol))/**< solving process deinitialization method of node selector */
8112  )
8113 {
8114  SCIP_CALL( checkStage(scip, "SCIPsetNodeselExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8115 
8116  assert(nodesel != NULL);
8117 
8118  SCIPnodeselSetExitsol(nodesel, nodeselexitsol);
8119 
8120  return SCIP_OKAY;
8121 }
8122 
8123 /** returns the node selector of the given name, or NULL if not existing */
8125  SCIP* scip, /**< SCIP data structure */
8126  const char* name /**< name of node selector */
8127  )
8128 {
8129  assert(scip != NULL);
8130  assert(scip->set != NULL);
8131  assert(name != NULL);
8132 
8133  return SCIPsetFindNodesel(scip->set, name);
8134 }
8135 
8136 /** returns the array of currently available node selectors */
8138  SCIP* scip /**< SCIP data structure */
8139  )
8140 {
8141  assert(scip != NULL);
8142  assert(scip->set != NULL);
8143 
8144  return scip->set->nodesels;
8145 }
8146 
8147 /** returns the number of currently available node selectors */
8149  SCIP* scip /**< SCIP data structure */
8150  )
8151 {
8152  assert(scip != NULL);
8153  assert(scip->set != NULL);
8154 
8155  return scip->set->nnodesels;
8156 }
8157 
8158 /** sets the priority of a node selector in standard mode */
8160  SCIP* scip, /**< SCIP data structure */
8161  SCIP_NODESEL* nodesel, /**< node selector */
8162  int priority /**< new standard priority of the node selector */
8163  )
8164 {
8165  assert(scip != NULL);
8166  assert(scip->set != NULL);
8167 
8168  SCIPnodeselSetStdPriority(nodesel, scip->set, priority);
8169 
8170  return SCIP_OKAY;
8171 }
8172 
8173 /** sets the priority of a node selector in memory saving mode */
8175  SCIP* scip, /**< SCIP data structure */
8176  SCIP_NODESEL* nodesel, /**< node selector */
8177  int priority /**< new memory saving priority of the node selector */
8178  )
8179 {
8180  assert(scip != NULL);
8181  assert(scip->set != NULL);
8182 
8183  SCIPnodeselSetMemsavePriority(nodesel, scip->set, priority);
8184 
8185  return SCIP_OKAY;
8186 }
8187 
8188 /** returns the currently used node selector */
8190  SCIP* scip /**< SCIP data structure */
8191  )
8192 {
8193  assert(scip != NULL);
8194  assert(scip->set != NULL);
8195 
8196  return SCIPsetGetNodesel(scip->set, scip->stat);
8197 }
8198 
8199 /** creates a branching rule and includes it in SCIP
8200  *
8201  * @note method has all branching rule callbacks as arguments and is thus changed every time a new
8202  * callback is added in future releases; consider using SCIPincludeBranchruleBasic() and setter functions
8203  * if you seek for a method which is less likely to change in future releases
8204  */
8206  SCIP* scip, /**< SCIP data structure */
8207  const char* name, /**< name of branching rule */
8208  const char* desc, /**< description of branching rule */
8209  int priority, /**< priority of the branching rule */
8210  int maxdepth, /**< maximal depth level, up to which this branching rule should be used (or -1) */
8211  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound
8212  * compared to best node's dual bound for applying branching rule
8213  * (0.0: only on current best node, 1.0: on all nodes) */
8214  SCIP_DECL_BRANCHCOPY ((*branchcopy)), /**< copy method of branching rule or NULL if you don't want to copy your plugin into sub-SCIPs */
8215  SCIP_DECL_BRANCHFREE ((*branchfree)), /**< destructor of branching rule */
8216  SCIP_DECL_BRANCHINIT ((*branchinit)), /**< initialize branching rule */
8217  SCIP_DECL_BRANCHEXIT ((*branchexit)), /**< deinitialize branching rule */
8218  SCIP_DECL_BRANCHINITSOL((*branchinitsol)),/**< solving process initialization method of branching rule */
8219  SCIP_DECL_BRANCHEXITSOL((*branchexitsol)),/**< solving process deinitialization method of branching rule */
8220  SCIP_DECL_BRANCHEXECLP((*branchexeclp)), /**< branching execution method for fractional LP solutions */
8221  SCIP_DECL_BRANCHEXECEXT((*branchexecext)),/**< branching execution method for external candidates */
8222  SCIP_DECL_BRANCHEXECPS((*branchexecps)), /**< branching execution method for not completely fixed pseudo solutions */
8223  SCIP_BRANCHRULEDATA* branchruledata /**< branching rule data */
8224  )
8225 {
8226  SCIP_BRANCHRULE* branchrule;
8227 
8228  SCIP_CALL( checkStage(scip, "SCIPincludeBranchrule", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8229 
8230  /* check whether branching rule is already present */
8231  if( SCIPfindBranchrule(scip, name) != NULL )
8232  {
8233  SCIPerrorMessage("branching rule <%s> already included.\n", name);
8234  return SCIP_INVALIDDATA;
8235  }
8236 
8237  SCIP_CALL( SCIPbranchruleCreate(&branchrule, scip->set, scip->messagehdlr, scip->mem->setmem,
8238  name, desc, priority, maxdepth,
8239  maxbounddist, branchcopy, branchfree, branchinit, branchexit, branchinitsol, branchexitsol,
8240  branchexeclp, branchexecext, branchexecps, branchruledata) );
8241  SCIP_CALL( SCIPsetIncludeBranchrule(scip->set, branchrule) );
8242 
8243  return SCIP_OKAY;
8244 }
8245 
8246 /** creates a branching rule and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
8247  * Optional callbacks can be set via specific setter functions, see SCIPsetBranchruleInit(), SCIPsetBranchruleExit(),
8248  * SCIPsetBranchruleCopy(), SCIPsetBranchruleFree(), SCIPsetBranchruleInitsol(), SCIPsetBranchruleExitsol(),
8249  * SCIPsetBranchruleExecLp(), SCIPsetBranchruleExecExt(), and SCIPsetBranchruleExecPs().
8250  *
8251  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeBranchrule() instead
8252  */
8254  SCIP* scip, /**< SCIP data structure */
8255  SCIP_BRANCHRULE** branchruleptr, /**< pointer to branching rule, or NULL */
8256  const char* name, /**< name of branching rule */
8257  const char* desc, /**< description of branching rule */
8258  int priority, /**< priority of the branching rule */
8259  int maxdepth, /**< maximal depth level, up to which this branching rule should be used (or -1) */
8260  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound
8261  * compared to best node's dual bound for applying branching rule
8262  * (0.0: only on current best node, 1.0: on all nodes) */
8263  SCIP_BRANCHRULEDATA* branchruledata /**< branching rule data */
8264  )
8265 {
8266  SCIP_BRANCHRULE* branchrule;
8267 
8268  SCIP_CALL( checkStage(scip, "SCIPincludeBranchruleBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8269 
8270  /* check whether branching rule is already present */
8271  if( SCIPfindBranchrule(scip, name) != NULL )
8272  {
8273  SCIPerrorMessage("branching rule <%s> already included.\n", name);
8274  return SCIP_INVALIDDATA;
8275  }
8276 
8277  SCIP_CALL( SCIPbranchruleCreate(&branchrule, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority, maxdepth,
8278  maxbounddist, NULL, NULL, NULL, NULL, NULL, NULL,
8279  NULL, NULL, NULL, branchruledata) );
8280 
8281  SCIP_CALL( SCIPsetIncludeBranchrule(scip->set, branchrule) );
8282 
8283  if( branchruleptr != NULL )
8284  *branchruleptr = branchrule;
8285 
8286  return SCIP_OKAY;
8287 }
8288 
8289 /** sets copy method of branching rule */
8291  SCIP* scip, /**< SCIP data structure */
8292  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8293  SCIP_DECL_BRANCHCOPY ((*branchcopy)) /**< copy method of branching rule or NULL if you don't want to copy your plugin into sub-SCIPs */
8294  )
8295 {
8296  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8297 
8298  assert(branchrule != NULL);
8299 
8300  SCIPbranchruleSetCopy(branchrule, branchcopy);
8301 
8302  return SCIP_OKAY;
8303 }
8304 
8305 /** sets destructor method of branching rule */
8307  SCIP* scip, /**< SCIP data structure */
8308  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8309  SCIP_DECL_BRANCHFREE ((*branchfree)) /**< destructor of branching rule */
8310  )
8311 {
8312  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8313 
8314  assert(branchrule != NULL);
8315 
8316  SCIPbranchruleSetFree(branchrule, branchfree);
8317 
8318  return SCIP_OKAY;
8319 }
8320 
8321 /** sets initialization method of branching rule */
8323  SCIP* scip, /**< SCIP data structure */
8324  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8325  SCIP_DECL_BRANCHINIT ((*branchinit)) /**< initialize branching rule */
8326  )
8327 {
8328  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8329 
8330  assert(branchrule != NULL);
8331 
8332  SCIPbranchruleSetInit(branchrule, branchinit);
8333 
8334  return SCIP_OKAY;
8335 }
8336 
8337 /** sets deinitialization method of branching rule */
8339  SCIP* scip, /**< SCIP data structure */
8340  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8341  SCIP_DECL_BRANCHEXIT ((*branchexit)) /**< deinitialize branching rule */
8342  )
8343 {
8344  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8345 
8346  assert(branchrule != NULL);
8347 
8348  SCIPbranchruleSetExit(branchrule, branchexit);
8349 
8350  return SCIP_OKAY;
8351 }
8352 
8353 /** sets solving process initialization method of branching rule */
8355  SCIP* scip, /**< SCIP data structure */
8356  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8357  SCIP_DECL_BRANCHINITSOL((*branchinitsol)) /**< solving process initialization method of branching rule */
8358  )
8359 {
8360  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8361 
8362  assert(branchrule != NULL);
8363 
8364  SCIPbranchruleSetInitsol(branchrule, branchinitsol);
8365 
8366  return SCIP_OKAY;
8367 }
8368 
8369 /** sets solving process deinitialization method of branching rule */
8371  SCIP* scip, /**< SCIP data structure */
8372  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8373  SCIP_DECL_BRANCHEXITSOL((*branchexitsol)) /**< solving process deinitialization method of branching rule */
8374  )
8375 {
8376  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8377 
8378  assert(branchrule != NULL);
8379 
8380  SCIPbranchruleSetExitsol(branchrule, branchexitsol);
8381 
8382  return SCIP_OKAY;
8383 }
8384 
8385 
8386 
8387 /** sets branching execution method for fractional LP solutions */
8389  SCIP* scip, /**< SCIP data structure */
8390  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8391  SCIP_DECL_BRANCHEXECLP((*branchexeclp)) /**< branching execution method for fractional LP solutions */
8392  )
8393 {
8394  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExecLp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8395 
8396  assert(branchrule != NULL);
8397 
8398  SCIPbranchruleSetExecLp(branchrule, branchexeclp);
8399 
8400  return SCIP_OKAY;
8401 }
8402 
8403 /** sets branching execution method for external candidates */
8405  SCIP* scip, /**< SCIP data structure */
8406  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8407  SCIP_DECL_BRANCHEXECEXT((*branchexecext)) /**< branching execution method for external candidates */
8408  )
8409 {
8410  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExecExt", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8411 
8412  assert(branchrule != NULL);
8413 
8414  SCIPbranchruleSetExecExt(branchrule, branchexecext);
8415 
8416  return SCIP_OKAY;
8417 }
8418 
8419 /** sets branching execution method for not completely fixed pseudo solutions */
8421  SCIP* scip, /**< SCIP data structure */
8422  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8423  SCIP_DECL_BRANCHEXECPS((*branchexecps)) /**< branching execution method for not completely fixed pseudo solutions */
8424  )
8425 {
8426  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExecPs", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8427 
8428  assert(branchrule != NULL);
8429 
8430  SCIPbranchruleSetExecPs(branchrule, branchexecps);
8431 
8432  return SCIP_OKAY;
8433 }
8434 
8435 /** returns the branching rule of the given name, or NULL if not existing */
8437  SCIP* scip, /**< SCIP data structure */
8438  const char* name /**< name of branching rule */
8439  )
8440 {
8441  assert(scip != NULL);
8442  assert(scip->set != NULL);
8443  assert(name != NULL);
8444 
8445  SCIPsetSortBranchrules(scip->set);
8446 
8447  return SCIPsetFindBranchrule(scip->set, name);
8448 }
8449 
8450 /** returns the array of currently available branching rules */
8452  SCIP* scip /**< SCIP data structure */
8453  )
8454 {
8455  assert(scip != NULL);
8456  assert(scip->set != NULL);
8457 
8458  return scip->set->branchrules;
8459 }
8460 
8461 /** returns the number of currently available branching rules */
8463  SCIP* scip /**< SCIP data structure */
8464  )
8465 {
8466  assert(scip != NULL);
8467  assert(scip->set != NULL);
8468 
8469  return scip->set->nbranchrules;
8470 }
8471 
8472 /** sets the priority of a branching rule */
8474  SCIP* scip, /**< SCIP data structure */
8475  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8476  int priority /**< new priority of the branching rule */
8477  )
8478 {
8479  assert(scip != NULL);
8480  assert(scip->set != NULL);
8481 
8482  SCIPbranchruleSetPriority(branchrule, scip->set, priority);
8483 
8484  return SCIP_OKAY;
8485 }
8486 
8487 /** sets maximal depth level, up to which this branching rule should be used (-1 for no limit) */
8489  SCIP* scip, /**< SCIP data structure */
8490  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8491  int maxdepth /**< new maxdepth of the branching rule */
8492  )
8493 {
8494  assert(scip != NULL);
8495  assert(scip->set != NULL);
8496 
8497  SCIPbranchruleSetMaxdepth(branchrule, maxdepth);
8498 
8499  return SCIP_OKAY;
8500 }
8501 
8502 /** sets maximal relative distance from current node's dual bound to primal bound for applying branching rule */
8504  SCIP* scip, /**< SCIP data structure */
8505  SCIP_BRANCHRULE* branchrule, /**< branching rule */
8506  SCIP_Real maxbounddist /**< new maxbounddist of the branching rule */
8507  )
8508 {
8509  assert(scip != NULL);
8510  assert(scip->set != NULL);
8511 
8512  SCIPbranchruleSetMaxbounddist(branchrule, maxbounddist);
8513 
8514  return SCIP_OKAY;
8515 }
8516 
8517 /** creates a display column and includes it in SCIP */
8519  SCIP* scip, /**< SCIP data structure */
8520  const char* name, /**< name of display column */
8521  const char* desc, /**< description of display column */
8522  const char* header, /**< head line of display column */
8523  SCIP_DISPSTATUS dispstatus, /**< display activation status of display column */
8524  SCIP_DECL_DISPCOPY ((*dispcopy)), /**< copy method of display column or NULL if you don't want to copy your plugin into sub-SCIPs */
8525  SCIP_DECL_DISPFREE ((*dispfree)), /**< destructor of display column */
8526  SCIP_DECL_DISPINIT ((*dispinit)), /**< initialize display column */
8527  SCIP_DECL_DISPEXIT ((*dispexit)), /**< deinitialize display column */
8528  SCIP_DECL_DISPINITSOL ((*dispinitsol)), /**< solving process initialization method of display column */
8529  SCIP_DECL_DISPEXITSOL ((*dispexitsol)), /**< solving process deinitialization method of display column */
8530  SCIP_DECL_DISPOUTPUT ((*dispoutput)), /**< output method */
8531  SCIP_DISPDATA* dispdata, /**< display column data */
8532  int width, /**< width of display column (no. of chars used) */
8533  int priority, /**< priority of display column */
8534  int position, /**< relative position of display column */
8535  SCIP_Bool stripline /**< should the column be separated with a line from its right neighbor? */
8536  )
8537 {
8538  SCIP_DISP* disp;
8539 
8540  SCIP_CALL( checkStage(scip, "SCIPincludeDisp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8541 
8542  /* check whether display column is already present */
8543  if( SCIPfindDisp(scip, name) != NULL )
8544  {
8545  SCIPerrorMessage("display column <%s> already included.\n", name);
8546  return SCIP_INVALIDDATA;
8547  }
8548 
8549  SCIP_CALL( SCIPdispCreate(&disp, scip->set, scip->messagehdlr, scip->mem->setmem,
8550  name, desc, header, dispstatus,
8551  dispcopy,
8552  dispfree, dispinit, dispexit, dispinitsol, dispexitsol, dispoutput, dispdata,
8553  width, priority, position, stripline) );
8554  SCIP_CALL( SCIPsetIncludeDisp(scip->set, disp) );
8555 
8556  return SCIP_OKAY;
8557 }
8558 
8559 /** returns the display column of the given name, or NULL if not existing */
8561  SCIP* scip, /**< SCIP data structure */
8562  const char* name /**< name of display column */
8563  )
8564 {
8565  assert(scip != NULL);
8566  assert(scip->set != NULL);
8567  assert(name != NULL);
8568 
8569  return SCIPsetFindDisp(scip->set, name);
8570 }
8571 
8572 /** returns the array of currently available display columns */
8574  SCIP* scip /**< SCIP data structure */
8575  )
8576 {
8577  assert(scip != NULL);
8578  assert(scip->set != NULL);
8579 
8580  return scip->set->disps;
8581 }
8582 
8583 /** returns the number of currently available display columns */
8585  SCIP* scip /**< SCIP data structure */
8586  )
8587 {
8588  assert(scip != NULL);
8589  assert(scip->set != NULL);
8590 
8591  return scip->set->ndisps;
8592 }
8593 
8594 /** automatically selects display columns for being shown w.r.t. the display width parameter */
8596  SCIP* scip /**< SCIP data structure */
8597  )
8598 {
8599  assert(scip != NULL);
8600  assert(scip->set != NULL);
8601 
8603 
8604  return SCIP_OKAY;
8605 }
8606 
8607 /** method to call, when the priority of an NLPI was changed */
8608 static
8609 SCIP_DECL_PARAMCHGD(paramChgdNlpiPriority)
8610 { /*lint --e{715}*/
8611  SCIP_PARAMDATA* paramdata;
8612 
8613  paramdata = SCIPparamGetData(param);
8614  assert(paramdata != NULL);
8615 
8616  /* use SCIPsetSetPriorityNlpi() to mark the nlpis unsorted */
8617  SCIP_CALL( SCIPsetNlpiPriority(scip, (SCIP_NLPI*)paramdata, SCIPparamGetInt(param)) );
8618 
8619  return SCIP_OKAY;
8620 }
8621 
8622 /** includes an NLPI in SCIP */
8624  SCIP* scip, /**< SCIP data structure */
8625  SCIP_NLPI* nlpi /**< NLPI data structure */
8626  )
8627 {
8628  char paramname[SCIP_MAXSTRLEN];
8629  char paramdesc[SCIP_MAXSTRLEN];
8630 
8631  assert(scip != NULL);
8632  assert(nlpi != NULL);
8633 
8634  SCIP_CALL( checkStage(scip, "SCIPincludeNlpi", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8635 
8636  /* check whether NLPI is already present */
8637  if( SCIPfindNlpi(scip, SCIPnlpiGetName(nlpi)) != NULL )
8638  {
8639  SCIPerrorMessage("NLPI <%s> already included.\n", SCIPnlpiGetName(nlpi));
8640  return SCIP_INVALIDDATA;
8641  }
8642 
8643  SCIP_CALL( SCIPsetIncludeNlpi(scip->set, nlpi) );
8644 
8645  /* add parameters */
8646  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "nlpi/%s/priority", SCIPnlpiGetName(nlpi));
8647  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of NLPI <%s>", SCIPnlpiGetName(nlpi));
8648  SCIP_CALL( SCIPaddIntParam(scip, paramname, paramdesc,
8649  NULL, FALSE, SCIPnlpiGetPriority(nlpi), INT_MIN/4, INT_MAX/4,
8650  paramChgdNlpiPriority, (SCIP_PARAMDATA*)nlpi) ); /*lint !e740*/
8651 
8652  /* pass message handler (may be NULL) */
8654 
8655  return SCIP_OKAY;
8656 }
8657 
8658 /** returns the NLPI of the given name, or NULL if not existing */
8660  SCIP* scip, /**< SCIP data structure */
8661  const char* name /**< name of NLPI */
8662  )
8663 {
8664  assert(scip != NULL);
8665  assert(scip->set != NULL);
8666  assert(name != NULL);
8667 
8668  return SCIPsetFindNlpi(scip->set, name);
8669 }
8670 
8671 /** returns the array of currently available NLPIs (sorted by priority) */
8673  SCIP* scip /**< SCIP data structure */
8674  )
8675 {
8676  assert(scip != NULL);
8677  assert(scip->set != NULL);
8678 
8679  SCIPsetSortNlpis(scip->set);
8680 
8681  return scip->set->nlpis;
8682 }
8683 
8684 /** returns the number of currently available NLPIs */
8686  SCIP* scip /**< SCIP data structure */
8687  )
8688 {
8689  assert(scip != NULL);
8690  assert(scip->set != NULL);
8691 
8692  return scip->set->nnlpis;
8693 }
8694 
8695 /** sets the priority of an NLPI */
8697  SCIP* scip, /**< SCIP data structure */
8698  SCIP_NLPI* nlpi, /**< NLPI */
8699  int priority /**< new priority of the NLPI */
8700  )
8701 {
8702  assert(scip != NULL);
8703  assert(scip->set != NULL);
8704 
8705  SCIPsetSetPriorityNlpi(scip->set, nlpi, priority);
8706 
8707  return SCIP_OKAY;
8708 }
8709 
8710 /** includes information about an external code linked into the SCIP library */
8712  SCIP* scip, /**< SCIP data structure */
8713  const char* name, /**< name of external code */
8714  const char* description /**< description of external code, or NULL */
8715  )
8716 {
8717  assert(scip != NULL);
8718  assert(name != NULL);
8719 
8720  SCIP_CALL( checkStage(scip, "SCIPincludeExternalCodeInformation", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8721 
8722  SCIP_CALL( SCIPsetIncludeExternalCode(scip->set, name, description) );
8723 
8724  return SCIP_OKAY;
8725 }
8726 
8727 /** returns an array of names of currently included external codes */
8729  SCIP* scip /**< SCIP data structure */
8730  )
8731 {
8732  assert(scip != NULL);
8733  assert(scip->set != NULL);
8734 
8735  return scip->set->extcodenames;
8736 }
8737 
8738 /** returns an array of the descriptions of currently included external codes
8739  *
8740  * @note some descriptions may be NULL
8741  */
8743  SCIP* scip /**< SCIP data structure */
8744  )
8745 {
8746  assert(scip != NULL);
8747  assert(scip->set != NULL);
8748 
8749  return scip->set->extcodedescs;
8750 }
8751 
8752 /** returns the number of currently included information on external codes */
8754  SCIP* scip /**< SCIP data structure */
8755  )
8756 {
8757  assert(scip != NULL);
8758  assert(scip->set != NULL);
8759 
8760  return scip->set->nextcodes;
8761 }
8762 
8763 /** prints information on external codes to a file stream via the message handler system
8764  *
8765  * @note If the message handler is set to a NULL pointer nothing will be printed
8766  */
8768  SCIP* scip, /**< SCIP data structure */
8769  FILE* file /**< output file (or NULL for standard output) */
8770  )
8771 {
8772  int i;
8773 
8774  SCIPmessageFPrintInfo(scip->messagehdlr, file, "External codes: ");
8775  if( scip->set->nextcodes == 0 )
8776  {
8777  SCIPinfoMessage(scip, file, "none\n");
8778  return;
8779  }
8780  SCIPinfoMessage(scip, file, "\n");
8781 
8782  for( i = 0; i < scip->set->nextcodes; ++i )
8783  {
8784  SCIPinfoMessage(scip, file, " %-20s %s\n", scip->set->extcodenames[i], scip->set->extcodedescs[i] != NULL ? scip->set->extcodedescs[i] : "");
8785  }
8786 }
8787 
8788 
8789 /*
8790  * user interactive dialog methods
8791  */
8792 
8793 /** creates and includes dialog
8794  *
8795  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
8796  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
8797  */
8799  SCIP* scip, /**< SCIP data structure */
8800  SCIP_DIALOG** dialog, /**< pointer to store the dialog */
8801  SCIP_DECL_DIALOGCOPY ((*dialogcopy)), /**< copy method of dialog or NULL if you don't want to copy your plugin into sub-SCIPs */
8802  SCIP_DECL_DIALOGEXEC ((*dialogexec)), /**< execution method of dialog */
8803  SCIP_DECL_DIALOGDESC ((*dialogdesc)), /**< description output method of dialog, or NULL */
8804  SCIP_DECL_DIALOGFREE ((*dialogfree)), /**< destructor of dialog to free user data, or NULL */
8805  const char* name, /**< name of dialog: command name appearing in parent's dialog menu */
8806  const char* desc, /**< description of dialog used if description output method is NULL */
8807  SCIP_Bool issubmenu, /**< is the dialog a submenu? */
8808  SCIP_DIALOGDATA* dialogdata /**< user defined dialog data */
8809  )
8810 {
8811  assert(scip != NULL);
8812  assert(dialog != NULL);
8813 
8814  /* check whether display column is already present */
8815  if( dialogcopy != NULL && SCIPexistsDialog(scip, *dialog) )
8816  {
8817  SCIPerrorMessage("dialog <%s> already included.\n", name);
8818  return SCIP_INVALIDDATA;
8819  }
8820 
8821  SCIP_CALL( SCIPdialogCreate(dialog, dialogcopy, dialogexec, dialogdesc, dialogfree, name, desc, issubmenu, dialogdata) );
8822  SCIP_CALL( SCIPsetIncludeDialog(scip->set, *dialog) );
8823 
8824  return SCIP_OKAY;
8825 }
8826 
8827 /** returns if the dialog already exists
8828  *
8829  * @return TRUE is returned if the dialog exits, otherwise FALSE.
8830  */
8832  SCIP* scip, /**< SCIP data structure */
8833  SCIP_DIALOG* dialog /**< dialog */
8834  )
8835 {
8836  assert(scip != NULL);
8837 
8838  return SCIPsetExistsDialog(scip->set, dialog);
8839 }
8840 
8841 /** captures a dialog
8842  *
8843  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
8844  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
8845  */
8847  SCIP* scip, /**< SCIP data structure */
8848  SCIP_DIALOG* dialog /**< dialog */
8849  )
8850 {
8851  assert(scip != NULL);
8852 
8853  SCIPdialogCapture(dialog);
8854 
8855  return SCIP_OKAY;
8856 }
8857 
8858 /** releases a dialog
8859  *
8860  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
8861  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
8862  */
8864  SCIP* scip, /**< SCIP data structure */
8865  SCIP_DIALOG** dialog /**< pointer to the dialog */
8866  )
8867 {
8868  assert(scip != NULL);
8869 
8870  SCIP_CALL( SCIPdialogRelease(scip, dialog) );
8871 
8872  return SCIP_OKAY;
8873 }
8874 
8875 /** makes given dialog the root dialog of SCIP's interactive user shell; captures dialog and releases former root dialog
8876  *
8877  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
8878  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
8879  */
8881  SCIP* scip, /**< SCIP data structure */
8882  SCIP_DIALOG* dialog /**< dialog to be the root */
8883  )
8884 {
8885  assert(scip != NULL);
8886 
8887  SCIP_CALL( SCIPdialoghdlrSetRoot(scip, scip->dialoghdlr, dialog) );
8888 
8889  return SCIP_OKAY;
8890 }
8891 
8892 /** returns the root dialog of SCIP's interactive user shell
8893  *
8894  * @return the root dialog of SCIP's interactive user shell is returned.
8895  */
8897  SCIP* scip /**< SCIP data structure */
8898  )
8899 {
8900  assert(scip != NULL);
8901 
8902  return SCIPdialoghdlrGetRoot(scip->dialoghdlr);
8903 }
8904 
8905 /** adds a sub dialog to the given dialog as menu entry and captures it
8906  *
8907  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
8908  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
8909  */
8911  SCIP* scip, /**< SCIP data structure */
8912  SCIP_DIALOG* dialog, /**< dialog to extend, or NULL for root dialog */
8913  SCIP_DIALOG* subdialog /**< subdialog to add as menu entry in dialog */
8914  )
8915 {
8916  assert(scip != NULL);
8917 
8918  if( dialog == NULL )
8919  dialog = SCIPdialoghdlrGetRoot(scip->dialoghdlr);
8920 
8921  SCIP_CALL( SCIPdialogAddEntry(dialog, scip->set, subdialog) );
8922 
8923  return SCIP_OKAY;
8924 }
8925 
8926 /** adds a single line of input which is treated as if the user entered the command line
8927  *
8928  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
8929  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
8930  */
8932  SCIP* scip, /**< SCIP data structure */
8933  const char* inputline /**< input line to add */
8934  )
8935 {
8936  assert(scip != NULL);
8937 
8938  SCIP_CALL( SCIPdialoghdlrAddInputLine(scip->dialoghdlr, inputline) );
8939 
8940  return SCIP_OKAY;
8941 }
8942 
8943 /** adds a single line of input to the command history which can be accessed with the cursor keys
8944  *
8945  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
8946  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
8947  */
8949  SCIP* scip, /**< SCIP data structure */
8950  const char* inputline /**< input line to add */
8951  )
8952 {
8953  assert(scip != NULL);
8954 
8955  SCIP_CALL( SCIPdialoghdlrAddHistory(scip->dialoghdlr, NULL, inputline, FALSE) );
8956 
8957  return SCIP_OKAY;
8958 }
8959 
8960 /** starts interactive mode of SCIP by executing the root dialog
8961  *
8962  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
8963  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
8964  *
8965  * @pre This method can be called if @p scip is in one of the following stages:
8966  * - \ref SCIP_STAGE_INIT
8967  * - \ref SCIP_STAGE_FREE
8968  *
8969  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the
8970  * interactive shell was closed:
8971  * - \ref SCIP_STAGE_PROBLEM if the interactive shell was closed after the problem was created
8972  * - \ref SCIP_STAGE_TRANSFORMED if the interactive shell was closed after the problem was transformed
8973  * - \ref SCIP_STAGE_PRESOLVING if the interactive shell was closed during presolving
8974  * - \ref SCIP_STAGE_PRESOLVED if the interactive shell was closed after presolve
8975  * - \ref SCIP_STAGE_SOLVING if the interactive shell was closed during the tree search
8976  * - \ref SCIP_STAGE_SOLVED if the interactive shell was closed after the problem was solved
8977  * - \ref SCIP_STAGE_FREE if the interactive shell was closed after the problem was freed
8978  *
8979  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
8980  */
8982  SCIP* scip /**< SCIP data structure */
8983  )
8984 {
8985  SCIP_CALL( checkStage(scip, "SCIPstartInteraction", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
8986 
8987  /* includes or updates the default dialog menus in SCIP */
8989 
8990  SCIP_CALL( SCIPdialoghdlrExec(scip->dialoghdlr, scip->set) );
8991 
8992  return SCIP_OKAY;
8993 }
8994 
8995 /*
8996  * global problem methods
8997  */
8998 
8999 /** creates empty problem and initializes all solving data structures (the objective sense is set to MINIMIZE)
9000  * If the problem type requires the use of variable pricers, these pricers should be added to the problem with calls
9001  * to SCIPactivatePricer(). These pricers are automatically deactivated, when the problem is freed.
9002  *
9003  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9004  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9005  *
9006  * @pre This method can be called if @p scip is in one of the following stages:
9007  * - \ref SCIP_STAGE_INIT
9008  * - \ref SCIP_STAGE_PROBLEM
9009  * - \ref SCIP_STAGE_TRANSFORMED
9010  * - \ref SCIP_STAGE_PRESOLVING
9011  * - \ref SCIP_STAGE_PRESOLVED
9012  * - \ref SCIP_STAGE_SOLVING
9013  * - \ref SCIP_STAGE_SOLVED
9014  * - \ref SCIP_STAGE_FREE
9015  *
9016  * @post After calling this method, \SCIP reaches the following stage:
9017  * - \ref SCIP_STAGE_PROBLEM
9018  */
9020  SCIP* scip, /**< SCIP data structure */
9021  const char* name, /**< problem name */
9022  SCIP_DECL_PROBDELORIG ((*probdelorig)), /**< frees user data of original problem */
9023  SCIP_DECL_PROBTRANS ((*probtrans)), /**< creates user data of transformed problem by transforming original user data */
9024  SCIP_DECL_PROBDELTRANS((*probdeltrans)), /**< frees user data of transformed problem */
9025  SCIP_DECL_PROBINITSOL ((*probinitsol)), /**< solving process initialization method of transformed data */
9026  SCIP_DECL_PROBEXITSOL ((*probexitsol)), /**< solving process deinitialization method of transformed data */
9027  SCIP_DECL_PROBCOPY ((*probcopy)), /**< copies user data if you want to copy it to a subscip, or NULL */
9028  SCIP_PROBDATA* probdata /**< user problem data set by the reader */
9029  )
9030 {
9031  SCIP_CALL( checkStage(scip, "SCIPcreateProb", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
9032 
9033  /* free old problem */
9034  SCIP_CALL( SCIPfreeProb(scip) );
9035  assert(scip->set->stage == SCIP_STAGE_INIT);
9036 
9037  /* switch stage to PROBLEM */
9038  scip->set->stage = SCIP_STAGE_PROBLEM;
9039 
9040  SCIP_CALL( SCIPstatCreate(&scip->stat, scip->mem->probmem, scip->set, scip->messagehdlr) );
9041 
9042  SCIP_CALL( SCIPprobCreate(&scip->origprob, scip->mem->probmem, scip->set, name,
9043  probdelorig, probtrans, probdeltrans, probinitsol, probexitsol, probcopy, probdata, FALSE) );
9044 
9045  /* create solution pool for original solution candidates */
9047 
9048  /* initialize reoptimization structure, if needed */
9050 
9051  return SCIP_OKAY;
9052 }
9053 
9054 /** creates empty problem and initializes all solving data structures (the objective sense is set to MINIMIZE)
9055  * all callback methods will be set to NULL and can be set afterwards, if needed, via SCIPsetProbDelorig(),
9056  * SCIPsetProbTrans(), SCIPsetProbDeltrans(), SCIPsetProbInitsol(), SCIPsetProbExitsol(), and
9057  * SCIPsetProbCopy()
9058  * If the problem type requires the use of variable pricers, these pricers should be added to the problem with calls
9059  * to SCIPactivatePricer(). These pricers are automatically deactivated, when the problem is freed.
9060  *
9061  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9062  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9063  *
9064  * @pre This method can be called if @p scip is in one of the following stages:
9065  * - \ref SCIP_STAGE_INIT
9066  * - \ref SCIP_STAGE_PROBLEM
9067  * - \ref SCIP_STAGE_TRANSFORMED
9068  * - \ref SCIP_STAGE_PRESOLVING
9069  * - \ref SCIP_STAGE_PRESOLVED
9070  * - \ref SCIP_STAGE_SOLVING
9071  * - \ref SCIP_STAGE_SOLVED
9072  * - \ref SCIP_STAGE_FREE
9073  *
9074  * @post After calling this method, \SCIP reaches the following stage:
9075  * - \ref SCIP_STAGE_PROBLEM
9076  */
9078  SCIP* scip, /**< SCIP data structure */
9079  const char* name /**< problem name */
9080  )
9081 {
9082  SCIP_CALL( checkStage(scip, "SCIPcreateProbBasic", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
9083 
9084  SCIP_CALL( SCIPcreateProb(scip, name, NULL, NULL, NULL, NULL, NULL, NULL, NULL) );
9085 
9086  return SCIP_OKAY;
9087 }
9088 
9089 /** sets callback to free user data of original problem
9090  *
9091  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9092  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9093  *
9094  * @pre This method can be called if @p scip is in one of the following stages:
9095  * - \ref SCIP_STAGE_PROBLEM
9096  */
9098  SCIP* scip, /**< SCIP data structure */
9099  SCIP_DECL_PROBDELORIG ((*probdelorig)) /**< frees user data of original problem */
9100  )
9101 {
9102  assert(scip != NULL);
9103  SCIP_CALL( checkStage(scip, "SCIPsetProbDelorig", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9104 
9105  SCIPprobSetDelorig(scip->origprob, probdelorig);
9106 
9107  return SCIP_OKAY;
9108 }
9109 
9110 /** sets callback to create user data of transformed problem by transforming original user data
9111  *
9112  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9113  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9114  *
9115  * @pre This method can be called if @p scip is in one of the following stages:
9116  * - \ref SCIP_STAGE_PROBLEM
9117  */
9119  SCIP* scip, /**< SCIP data structure */
9120  SCIP_DECL_PROBTRANS ((*probtrans)) /**< creates user data of transformed problem by transforming original user data */
9121  )
9122 {
9123  assert(scip != NULL);
9124  SCIP_CALL( checkStage(scip, "SCIPsetProbTrans", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9125 
9126  SCIPprobSetTrans(scip->origprob, probtrans);
9127 
9128  return SCIP_OKAY;
9129 }
9130 
9131 /** sets callback to free user data of transformed problem
9132  *
9133  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9134  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9135  *
9136  * @pre This method can be called if @p scip is in one of the following stages:
9137  * - \ref SCIP_STAGE_PROBLEM
9138  */
9140  SCIP* scip, /**< SCIP data structure */
9141  SCIP_DECL_PROBDELTRANS((*probdeltrans)) /**< frees user data of transformed problem */
9142  )
9143 {
9144  assert(scip != NULL);
9145  SCIP_CALL( checkStage(scip, "SCIPsetProbDeltrans", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9146 
9147  SCIPprobSetDeltrans(scip->origprob, probdeltrans);
9148 
9149  return SCIP_OKAY;
9150 }
9151 
9152 /** sets solving process initialization callback of transformed data
9153  *
9154  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9155  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9156  *
9157  * @pre This method can be called if @p scip is in one of the following stages:
9158  * - \ref SCIP_STAGE_PROBLEM
9159  */
9161  SCIP* scip, /**< SCIP data structure */
9162  SCIP_DECL_PROBINITSOL ((*probinitsol)) /**< solving process initialization method of transformed data */
9163  )
9164 {
9165  assert(scip != NULL);
9166 
9167  SCIP_CALL( checkStage(scip, "SCIPsetProbInitsol", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9168 
9169  SCIPprobSetInitsol(scip->origprob, probinitsol);
9170 
9171  return SCIP_OKAY;
9172 }
9173 
9174 /** sets solving process deinitialization callback of transformed data
9175  *
9176  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9177  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9178  *
9179  * @pre This method can be called if @p scip is in one of the following stages:
9180  * - \ref SCIP_STAGE_PROBLEM
9181  */
9183  SCIP* scip, /**< SCIP data structure */
9184  SCIP_DECL_PROBEXITSOL ((*probexitsol)) /**< solving process deinitialization method of transformed data */
9185  )
9186 {
9187  assert(scip != NULL);
9188  SCIP_CALL( checkStage(scip, "SCIPsetProbExitsol", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9189 
9190  SCIPprobSetExitsol(scip->origprob, probexitsol);
9191 
9192  return SCIP_OKAY;
9193 }
9194 
9195 /** sets callback to copy user data to a subscip
9196  *
9197  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9198  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9199  *
9200  * @pre This method can be called if @p scip is in one of the following stages:
9201  * - \ref SCIP_STAGE_PROBLEM
9202  */
9204  SCIP* scip, /**< SCIP data structure */
9205  SCIP_DECL_PROBCOPY ((*probcopy)) /**< copies user data if you want to copy it to a subscip, or NULL */
9206  )
9207 {
9208  assert(scip != NULL);
9209  SCIP_CALL( checkStage(scip, "SCIPsetProbCopy", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9210 
9211  SCIPprobSetCopy(scip->origprob, probcopy);
9212 
9213  return SCIP_OKAY;
9214 }
9215 
9216 /** reads problem from file and initializes all solving data structures
9217  *
9218  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9219  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9220  *
9221  * @pre This method can be called if @p scip is in one of the following stages:
9222  * - \ref SCIP_STAGE_INIT
9223  * - \ref SCIP_STAGE_PROBLEM
9224  * - \ref SCIP_STAGE_TRANSFORMED
9225  * - \ref SCIP_STAGE_INITPRESOLVE
9226  * - \ref SCIP_STAGE_PRESOLVING
9227  * - \ref SCIP_STAGE_EXITPRESOLVE
9228  * - \ref SCIP_STAGE_PRESOLVED
9229  * - \ref SCIP_STAGE_SOLVING
9230  * - \ref SCIP_STAGE_EXITSOLVE
9231  *
9232  * @post After the method was called, \SCIP is in one of the following stages:
9233  * - \ref SCIP_STAGE_INIT if reading failed (usually, when a SCIP_READERROR occurs)
9234  * - \ref SCIP_STAGE_PROBLEM if the problem file was successfully read
9235  */
9237  SCIP* scip, /**< SCIP data structure */
9238  const char* filename, /**< problem file name */
9239  const char* extension /**< extension of the desired file reader,
9240  * or NULL if file extension should be used */
9241  )
9242 {
9243  SCIP_RETCODE retcode;
9244  SCIP_RESULT result;
9245  SCIP_Bool usevartable;
9246  SCIP_Bool useconstable;
9247  int i;
9248  char* tmpfilename;
9249  char* fileextension;
9250 
9251  assert(scip != NULL);
9252  assert(filename != NULL);
9253 
9254  SCIP_CALL( checkStage(scip, "SCIPreadProb", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
9255 
9256  SCIP_CALL( SCIPgetBoolParam(scip, "misc/usevartable", &usevartable) );
9257  SCIP_CALL( SCIPgetBoolParam(scip, "misc/useconstable", &useconstable) );
9258 
9259  if( !usevartable || !useconstable )
9260  {
9261  SCIPerrorMessage("Cannot read problem if vartable or constable is disabled. Make sure parameters 'misc/usevartable' and 'misc/useconstable' are set to TRUE.\n");
9262  return SCIP_READERROR;
9263  }
9264 
9265  /* try all readers until one could read the file */
9266  result = SCIP_DIDNOTRUN;
9267 
9268  /* copy filename */
9269  SCIP_CALL( SCIPduplicateBufferArray(scip, &tmpfilename, filename, (int)strlen(filename)+1) );
9270 
9271  fileextension = NULL;
9272  if( extension == NULL )
9273  {
9274  /* get extension from filename */
9275  SCIPsplitFilename(tmpfilename, NULL, NULL, &fileextension, NULL);
9276  }
9277 
9278  for( i = 0; i < scip->set->nreaders && result == SCIP_DIDNOTRUN; ++i )
9279  {
9280  retcode = SCIPreaderRead(scip->set->readers[i], scip->set, filename,
9281  extension != NULL ? extension : fileextension, &result);
9282 
9283  /* check for reader errors */
9284  if( retcode == SCIP_NOFILE || retcode == SCIP_READERROR )
9285  goto TERMINATE;
9286  SCIP_CALL( retcode );
9287  }
9288 
9289  switch( result )
9290  {
9291  case SCIP_DIDNOTRUN:
9292  retcode = SCIP_PLUGINNOTFOUND;
9293  break;
9294  case SCIP_SUCCESS:
9295  if( scip->origprob != NULL )
9296  {
9297  SCIP_Real readingtime;
9298 
9300  "original problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
9301  scip->origprob->nvars, scip->origprob->nbinvars, scip->origprob->nintvars,
9302  scip->origprob->nimplvars, scip->origprob->ncontvars,
9303  scip->origprob->nconss);
9304 
9305  /* in full verbose mode we will also print the number of constraints per constraint handler */
9306  if( scip->set->disp_verblevel == SCIP_VERBLEVEL_FULL )
9307  {
9308  int* nconss;
9309  int c;
9310  int h;
9311 
9312  SCIP_CALL( SCIPallocClearMemoryArray(scip, &nconss, scip->set->nconshdlrs) );
9313 
9314  /* loop over all constraints and constraint-handlers to count for each type the amount of original
9315  * constraints
9316  */
9317  for( c = scip->origprob->nconss - 1; c >= 0; --c )
9318  {
9319  for( h = scip->set->nconshdlrs - 1; h >= 0; --h )
9320  {
9321  if( scip->origprob->conss[c]->conshdlr == scip->set->conshdlrs[h] )
9322  {
9323  ++(nconss[h]);
9324  break;
9325  }
9326  }
9327  /* constraint handler should be found */
9328  assert(h >= 0);
9329  }
9330 
9331  /* loop over all constraints handlers for printing the number of original constraints */
9332  for( h = 0; h < scip->set->nconshdlrs; ++h )
9333  {
9334  if( nconss[h] > 0 )
9335  {
9337  "%7d constraints of type <%s>\n", nconss[h], SCIPconshdlrGetName(scip->set->conshdlrs[h]));
9338  }
9339  }
9340 
9341  SCIPfreeMemoryArray(scip, &nconss);
9342  }
9343 
9344  /* in case the permutation seed is different to -1, permute the original problem */
9345  if( scip->set->misc_permutationseed > -1 )
9346  {
9347  SCIP_Bool permuteconss;
9348  SCIP_Bool permutevars;
9349  int permutationseed;
9350 
9351  permuteconss = scip->set->misc_permuteconss;
9352  permutevars = scip->set->misc_permutevars;
9353  permutationseed = scip->set->misc_permutationseed;
9354 
9355  SCIP_CALL( SCIPpermuteProb(scip, (unsigned int)permutationseed, permuteconss, permutevars, permutevars, permutevars, permutevars) );
9356  }
9357 
9358  /* get reading time */
9359  readingtime = SCIPgetReadingTime(scip);
9360 
9361  /* display timing statistics */
9363  "Reading Time: %.2f\n", readingtime);
9364  }
9365  retcode = SCIP_OKAY;
9366  break;
9367  default:
9368  assert(i < scip->set->nreaders);
9369  SCIPerrorMessage("invalid result code <%d> from reader <%s> reading file <%s>\n",
9370  result, SCIPreaderGetName(scip->set->readers[i]), filename);
9371  retcode = SCIP_READERROR;
9372  } /*lint !e788*/
9373 
9374  TERMINATE:
9375  /* free buffer array */
9376  SCIPfreeBufferArray(scip, &tmpfilename);
9377 
9378  /* check if reading time should belong to solving time */
9379  if( scip->set->time_reading )
9380  {
9381  SCIP_Real readingtime;
9382 
9383  /* get reading time */
9384  readingtime = SCIPgetReadingTime(scip);
9385 
9386  /* add reading time to solving time */
9387  SCIPclockSetTime(scip->stat->solvingtime, readingtime);
9388  }
9389 
9390  return retcode;
9391 }
9392 
9393 /* write original or transformed problem */
9394 static
9396  SCIP* scip, /**< SCIP data structure */
9397  const char* filename, /**< output file (or NULL for standard output) */
9398  const char* extension, /**< extension of the desired file reader,
9399  * or NULL if file extension should be used */
9400  SCIP_Bool transformed, /**< output the transformed problem? */
9401  SCIP_Bool genericnames /**< using generic variable and constraint names? */
9402  )
9403 {
9404  SCIP_RETCODE retcode;
9405  char* tmpfilename;
9406  char* fileextension;
9407  char* compression;
9408  FILE* file;
9409 
9410  assert(scip != NULL );
9411 
9412  fileextension = NULL;
9413  compression = NULL;
9414  file = NULL;
9415  tmpfilename = NULL;
9416  retcode = SCIP_OKAY;
9417 
9418  if( filename != NULL && filename[0] != '\0' )
9419  {
9420  int success;
9421 
9422  file = fopen(filename, "w");
9423  if( file == NULL )
9424  {
9425  SCIPerrorMessage("cannot create file <%s> for writing\n", filename);
9426  SCIPprintSysError(filename);
9427  return SCIP_FILECREATEERROR;
9428  }
9429 
9430  /* get extension from filename,
9431  * if an error occurred, close the file before returning */
9432  if( BMSduplicateMemoryArray(&tmpfilename, filename, strlen(filename)+1) == NULL )
9433  {
9434  (void) fclose(file);
9435  SCIPerrorMessage("Error <%d> in function call\n", SCIP_NOMEMORY);
9436  return SCIP_NOMEMORY;
9437  }
9438 
9439  SCIPsplitFilename(tmpfilename, NULL, NULL, &fileextension, &compression);
9440 
9441  if( compression != NULL )
9442  {
9443  SCIPmessagePrintWarning(scip->messagehdlr, "currently it is not possible to write files with any compression\n");
9444  BMSfreeMemoryArray(&tmpfilename);
9445  (void) fclose(file);
9446  return SCIP_FILECREATEERROR;
9447  }
9448 
9449  if( extension == NULL && fileextension == NULL )
9450  {
9451  SCIPmessagePrintWarning(scip->messagehdlr, "filename <%s> has no file extension, select default <cip> format for writing\n", filename);
9452  }
9453 
9454  if( transformed )
9455  retcode = SCIPprintTransProblem(scip, file, extension != NULL ? extension : fileextension, genericnames);
9456  else
9457  retcode = SCIPprintOrigProblem(scip, file, extension != NULL ? extension : fileextension, genericnames);
9458 
9459  BMSfreeMemoryArray(&tmpfilename);
9460 
9461  success = fclose(file);
9462  if( success != 0 )
9463  {
9464  SCIPerrorMessage("An error occurred while closing file <%s>\n", filename);
9465  return SCIP_FILECREATEERROR;
9466  }
9467  }
9468  else
9469  {
9470  /* print to stdout */
9471  if( transformed )
9472  retcode = SCIPprintTransProblem(scip, NULL, extension, genericnames);
9473  else
9474  retcode = SCIPprintOrigProblem(scip, NULL, extension, genericnames);
9475  }
9476 
9477  /* check for write errors */
9478  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
9479  return retcode;
9480  else
9481  {
9482  SCIP_CALL( retcode );
9483  }
9484 
9485  return SCIP_OKAY;
9486 }
9487 
9488 /** writes original problem to file
9489  *
9490  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9491  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9492  *
9493  * @pre This method can be called if @p scip is in one of the following stages:
9494  * - \ref SCIP_STAGE_PROBLEM
9495  * - \ref SCIP_STAGE_TRANSFORMING
9496  * - \ref SCIP_STAGE_TRANSFORMED
9497  * - \ref SCIP_STAGE_INITPRESOLVE
9498  * - \ref SCIP_STAGE_PRESOLVING
9499  * - \ref SCIP_STAGE_EXITPRESOLVE
9500  * - \ref SCIP_STAGE_PRESOLVED
9501  * - \ref SCIP_STAGE_INITSOLVE
9502  * - \ref SCIP_STAGE_SOLVING
9503  * - \ref SCIP_STAGE_SOLVED
9504  * - \ref SCIP_STAGE_EXITSOLVE
9505  * - \ref SCIP_STAGE_FREETRANS
9506  */
9508  SCIP* scip, /**< SCIP data structure */
9509  const char* filename, /**< output file (or NULL for standard output) */
9510  const char* extension, /**< extension of the desired file reader,
9511  * or NULL if file extension should be used */
9512  SCIP_Bool genericnames /**< using generic variable and constraint names? */
9513  )
9514 {
9515  SCIP_RETCODE retcode;
9516 
9517  SCIP_CALL( checkStage(scip, "SCIPwriteOrigProblem", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
9518 
9519  assert( scip != NULL );
9520  assert( scip->origprob != NULL );
9521 
9522  retcode = writeProblem(scip, filename, extension, FALSE, genericnames);
9523 
9524  /* check for write errors */
9525  if( retcode == SCIP_FILECREATEERROR || retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
9526  return retcode;
9527  else
9528  {
9529  SCIP_CALL( retcode );
9530  }
9531 
9532  return SCIP_OKAY;
9533 }
9534 
9535 /** writes transformed problem which are valid in the current node to file
9536  *
9537  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9538  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9539  *
9540  * @pre This method can be called if @p scip is in one of the following stages:
9541  * - \ref SCIP_STAGE_TRANSFORMED
9542  * - \ref SCIP_STAGE_INITPRESOLVE
9543  * - \ref SCIP_STAGE_PRESOLVING
9544  * - \ref SCIP_STAGE_EXITPRESOLVE
9545  * - \ref SCIP_STAGE_PRESOLVED
9546  * - \ref SCIP_STAGE_INITSOLVE
9547  * - \ref SCIP_STAGE_SOLVING
9548  * - \ref SCIP_STAGE_SOLVED
9549  * - \ref SCIP_STAGE_EXITSOLVE
9550  *
9551  * @note If you want the write all constraints (including the once which are redundant for example), you need to set
9552  * the parameter <write/allconss> to TRUE
9553  */
9555  SCIP* scip, /**< SCIP data structure */
9556  const char* filename, /**< output file (or NULL for standard output) */
9557  const char* extension, /**< extension of the desired file reader,
9558  * or NULL if file extension should be used */
9559  SCIP_Bool genericnames /**< using generic variable and constraint names? */
9560  )
9561 {
9562  SCIP_RETCODE retcode;
9563 
9564  SCIP_CALL( checkStage(scip, "SCIPwriteTransProblem", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
9565 
9566  assert( scip != NULL );
9567  assert( scip->transprob != NULL );
9568 
9569  retcode = writeProblem(scip, filename, extension, TRUE, genericnames);
9570 
9571  /* check for write errors */
9572  if( retcode == SCIP_FILECREATEERROR || retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
9573  return retcode;
9574  else
9575  {
9576  SCIP_CALL( retcode );
9577  }
9578 
9579  return SCIP_OKAY;
9580 }
9581 
9582 /** frees problem and solution process data
9583  *
9584  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9585  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9586  *
9587  * @pre This method can be called if @p scip is in one of the following stages:
9588  * - \ref SCIP_STAGE_INIT
9589  * - \ref SCIP_STAGE_PROBLEM
9590  * - \ref SCIP_STAGE_TRANSFORMED
9591  * - \ref SCIP_STAGE_PRESOLVING
9592  * - \ref SCIP_STAGE_PRESOLVED
9593  * - \ref SCIP_STAGE_SOLVING
9594  * - \ref SCIP_STAGE_SOLVED
9595  * - \ref SCIP_STAGE_FREE
9596  *
9597  * @post After this method was called, SCIP is in the following stage:
9598  * - \ref SCIP_STAGE_INIT
9599  */
9601  SCIP* scip /**< SCIP data structure */
9602  )
9603 {
9604  SCIP_Bool transsolorig;
9605 
9606  SCIP_CALL( checkStage(scip, "SCIPfreeProb", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
9607 
9608  /* if we free the problem, we do not have to transfer transformed solutions to the original space, so temporarily disable it */
9609  transsolorig = scip->set->misc_transsolsorig;
9610  scip->set->misc_transsolsorig = FALSE;
9611 
9612  SCIP_CALL( SCIPfreeTransform(scip) );
9613  assert(scip->set->stage == SCIP_STAGE_INIT || scip->set->stage == SCIP_STAGE_PROBLEM);
9614  scip->set->misc_transsolsorig = transsolorig;
9615 
9616  if( scip->set->stage == SCIP_STAGE_PROBLEM )
9617  {
9618  int i;
9619 
9620  /* deactivate all pricers */
9621  for( i = scip->set->nactivepricers-1; i >= 0; --i )
9622  {
9623  SCIP_CALL( SCIPpricerDeactivate(scip->set->pricers[i], scip->set) );
9624  }
9625  assert(scip->set->nactivepricers == 0);
9626 
9627  /* free original primal solution candidate pool, original problem and problem statistics data structures */
9628  if( scip->set->reopt_enable || scip->reopt != NULL)
9629  {
9630  SCIP_CALL( SCIPreoptFree(&scip->reopt, scip->set, scip->origprimal, scip->mem->probmem) );
9631  }
9632  SCIP_CALL( SCIPprimalFree(&scip->origprimal, scip->mem->probmem) );
9633  SCIP_CALL( SCIPprobFree(&scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
9634  SCIP_CALL( SCIPstatFree(&scip->stat, scip->mem->probmem) );
9635 
9636  /* readers */
9637  for( i = 0; i < scip->set->nreaders; ++i )
9638  {
9640  }
9641 
9642  /* switch stage to INIT */
9643  scip->set->stage = SCIP_STAGE_INIT;
9644  }
9645  assert(scip->set->stage == SCIP_STAGE_INIT);
9646 
9647  return SCIP_OKAY;
9648 }
9649 
9650 
9651 /** permutes parts of the problem data structure
9652  *
9653  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9654  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9655  *
9656  * @pre This method can be called if @p scip is in one of the following stages:
9657  * - \ref SCIP_STAGE_PROBLEM
9658  * - \ref SCIP_STAGE_TRANSFORMED
9659  */
9661  SCIP* scip, /**< SCIP data structure */
9662  unsigned int randseed, /**< seed value for random generator */
9663  SCIP_Bool permuteconss, /**< should the list of constraints in each constraint handler be permuted? */
9664  SCIP_Bool permutebinvars, /**< should the list of binary variables be permuted? */
9665  SCIP_Bool permuteintvars, /**< should the list of integer variables be permuted? */
9666  SCIP_Bool permuteimplvars, /**< should the list of implicit integer variables be permuted? */
9667  SCIP_Bool permutecontvars /**< should the list of continuous integer variables be permuted? */
9668  )
9669 {
9670  SCIP_VAR** vars;
9671  SCIP_CONSHDLR** conshdlrs;
9672  SCIP_Bool permuted;
9673  unsigned int oldrandseed;
9674  int nconshdlrs;
9675  int nbinvars;
9676  int nintvars;
9677  int nimplvars;
9678  int nvars;
9679  int j;
9680 
9681  assert(scip != NULL);
9682  SCIP_CALL( checkStage(scip, "SCIPpermuteProb", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9683 
9684  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, &nbinvars, &nintvars, &nimplvars, NULL) );
9685 
9686  assert(nvars == 0 || vars != NULL);
9687  assert(nvars == nbinvars+nintvars+nimplvars+SCIPgetNContVars(scip));
9688 
9689  conshdlrs = SCIPgetConshdlrs(scip);
9690  nconshdlrs = SCIPgetNConshdlrs(scip);
9691  assert(nconshdlrs == 0 || conshdlrs != NULL);
9692 
9693  /* The constraint handler should not be permuted since they are called w.r.t. to certain properties; besides
9694  * that the "conshdlrs" array should stay in the order as it is since this array is used to copy the plugins for
9695  * sub-SCIPs and contains the dependencies between the constraint handlers; for example the linear constraint
9696  * handler stays in front of all constraint handler which can upgrade a linear constraint (such as logicor,
9697  * setppc, and knapsack).
9698  */
9699 
9700  permuted = FALSE;
9701  oldrandseed = randseed;
9702 
9703  /* for each constraint handler, permute its constraints */
9704  if( permuteconss )
9705  {
9706  int i;
9707 
9708  /* we must only permute active constraints */
9709  if( SCIPisTransformed(scip) && !SCIPprobIsPermuted(scip->transprob) )
9710  {
9711  /* loop over all constraint handlers */
9712  for( i = 0; i < nconshdlrs; ++i )
9713  {
9714  SCIP_CONS** conss;
9715  int nconss;
9716 
9717  conss = SCIPconshdlrGetConss(conshdlrs[i]);
9718  nconss = SCIPconshdlrGetNActiveConss(conshdlrs[i]);
9719 
9720  assert(nconss == 0 || conss != NULL);
9721 
9722  SCIPpermuteArray((void**)conss, 0, nconss, &randseed);
9723 
9724  /* readjust the mapping of constraints to array positions */
9725  for( j = 0; j < nconss; ++j )
9726  conss[j]->consspos = j;
9727 
9728  permuted = TRUE;
9729  }
9730  }
9731  else if( !SCIPisTransformed(scip) && !SCIPprobIsPermuted(scip->origprob) )
9732  {
9733  SCIP_CONS** conss = scip->origprob->conss;
9734  int nconss = scip->origprob->nconss;
9735 
9736  SCIPpermuteArray((void**)conss, 0, nconss, &randseed);
9737 
9738  for( j = 0; j < nconss; ++j )
9739  {
9740  assert(conss[j]->consspos == -1);
9741  conss[j]->addarraypos = j;
9742  }
9743 
9744  permuted = TRUE;
9745  }
9746  }
9747 
9748  /* permute binary variables */
9749  if( permutebinvars && !SCIPprobIsPermuted(scip->origprob) )
9750  {
9751  SCIPpermuteArray((void**)vars, 0, nbinvars, &randseed);
9752 
9753  /* readjust the mapping of variables to array positions */
9754  for( j = 0; j < nbinvars; ++j )
9755  vars[j]->probindex = j;
9756 
9757  permuted = TRUE;
9758  }
9759 
9760  /* permute general integer variables */
9761  if( permuteintvars && !SCIPprobIsPermuted(scip->origprob) )
9762  {
9763  SCIPpermuteArray((void**)vars, nbinvars, nbinvars+nintvars, &randseed);
9764 
9765  /* readjust the mapping of variables to array positions */
9766  for( j = nbinvars; j < nbinvars+nintvars; ++j )
9767  vars[j]->probindex = j;
9768 
9769  permuted = TRUE;
9770  }
9771 
9772  /* permute general integer variables */
9773  if( permuteimplvars && !SCIPprobIsPermuted(scip->origprob) )
9774  {
9775  SCIPpermuteArray((void**)vars, nbinvars+nintvars, nbinvars+nintvars+nimplvars, &randseed);
9776 
9777  /* readjust the mapping of variables to array positions */
9778  for( j = nbinvars+nintvars; j < nbinvars+nintvars+nimplvars; ++j )
9779  vars[j]->probindex = j;
9780 
9781  permuted = TRUE;
9782  }
9783 
9784  /* permute general integer variables */
9785  if( permutecontvars && !SCIPprobIsPermuted(scip->origprob) )
9786  {
9787  SCIPpermuteArray((void**)vars, nbinvars+nintvars+nimplvars, nvars, &randseed);
9788 
9789  /* readjust the mapping of variables to array positions */
9790  for( j = nbinvars+nintvars+nimplvars; j < nvars; ++j )
9791  vars[j]->probindex = j;
9792 
9793  permuted = TRUE;
9794  }
9795 
9796  if( permuted && SCIPisTransformed(scip) )
9797  {
9798  assert(!SCIPprobIsPermuted(scip->transprob));
9799 
9800  /* mark tranformed problem as permuted */
9802 
9804  "permute transformed problem using random seed %u\n", oldrandseed);
9805  }
9806  else if( permuted && !SCIPisTransformed(scip) )
9807  {
9808  assert(!SCIPprobIsPermuted(scip->origprob));
9809 
9810  /* mark original problem as permuted */
9812 
9814  "permute original problem using random seed %u\n", oldrandseed);
9815  }
9816 
9817  return SCIP_OKAY;
9818 }
9819 
9820 /** gets user problem data
9821  *
9822  * @return a SCIP_PROBDATA pointer, or NULL if no problem data was allocated
9823  *
9824  * @pre This method can be called if @p scip is in one of the following stages:
9825  * - \ref SCIP_STAGE_PROBLEM
9826  * - \ref SCIP_STAGE_TRANSFORMING
9827  * - \ref SCIP_STAGE_TRANSFORMED
9828  * - \ref SCIP_STAGE_INITPRESOLVE
9829  * - \ref SCIP_STAGE_PRESOLVING
9830  * - \ref SCIP_STAGE_EXITPRESOLVE
9831  * - \ref SCIP_STAGE_PRESOLVED
9832  * - \ref SCIP_STAGE_INITSOLVE
9833  * - \ref SCIP_STAGE_SOLVING
9834  * - \ref SCIP_STAGE_SOLVED
9835  * - \ref SCIP_STAGE_EXITSOLVE
9836  * - \ref SCIP_STAGE_FREETRANS
9837  */
9839  SCIP* scip /**< SCIP data structure */
9840  )
9841 {
9842  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
9843 
9844  switch( scip->set->stage )
9845  {
9846  case SCIP_STAGE_PROBLEM:
9847  return SCIPprobGetData(scip->origprob);
9848 
9852  case SCIP_STAGE_PRESOLVING:
9854  case SCIP_STAGE_PRESOLVED:
9855  case SCIP_STAGE_INITSOLVE:
9856  case SCIP_STAGE_SOLVING:
9857  case SCIP_STAGE_SOLVED:
9858  case SCIP_STAGE_EXITSOLVE:
9859  case SCIP_STAGE_FREETRANS:
9860  return SCIPprobGetData(scip->transprob);
9861 
9862  default:
9863  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
9864  SCIPABORT();
9865  return NULL; /*lint !e527*/
9866  } /*lint !e788*/
9867 }
9868 
9869 /** sets user problem data
9870  *
9871  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9872  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9873  *
9874  * @pre This method can be called if @p scip is in one of the following stages:
9875  * - \ref SCIP_STAGE_PROBLEM
9876  * - \ref SCIP_STAGE_TRANSFORMING
9877  * - \ref SCIP_STAGE_TRANSFORMED
9878  * - \ref SCIP_STAGE_INITPRESOLVE
9879  * - \ref SCIP_STAGE_PRESOLVING
9880  * - \ref SCIP_STAGE_EXITPRESOLVE
9881  * - \ref SCIP_STAGE_PRESOLVED
9882  * - \ref SCIP_STAGE_INITSOLVE
9883  * - \ref SCIP_STAGE_SOLVING
9884  * - \ref SCIP_STAGE_SOLVED
9885  * - \ref SCIP_STAGE_EXITSOLVE
9886  * - \ref SCIP_STAGE_FREETRANS
9887  */
9889  SCIP* scip, /**< SCIP data structure */
9890  SCIP_PROBDATA* probdata /**< user problem data to use */
9891  )
9892 {
9893  SCIP_CALL( checkStage(scip, "SCIPsetProbData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
9894 
9895  switch( scip->set->stage )
9896  {
9897  case SCIP_STAGE_PROBLEM:
9898  SCIPprobSetData(scip->origprob, probdata);
9899  return SCIP_OKAY;
9900 
9904  case SCIP_STAGE_PRESOLVING:
9906  case SCIP_STAGE_PRESOLVED:
9907  case SCIP_STAGE_INITSOLVE:
9908  case SCIP_STAGE_SOLVING:
9909  case SCIP_STAGE_SOLVED:
9910  case SCIP_STAGE_EXITSOLVE:
9911  case SCIP_STAGE_FREETRANS:
9912  SCIPprobSetData(scip->transprob, probdata);
9913  return SCIP_OKAY;
9914 
9915  case SCIP_STAGE_INIT:
9916  case SCIP_STAGE_FREE:
9917  default:
9918  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
9919  return SCIP_INVALIDCALL;
9920  }
9921 }
9922 
9923 /** returns name of the current problem instance
9924  *
9925  * @return name of the current problem instance
9926  *
9927  * @pre This method can be called if @p scip is in one of the following stages:
9928  * - \ref SCIP_STAGE_PROBLEM
9929  * - \ref SCIP_STAGE_TRANSFORMING
9930  * - \ref SCIP_STAGE_TRANSFORMED
9931  * - \ref SCIP_STAGE_INITPRESOLVE
9932  * - \ref SCIP_STAGE_PRESOLVING
9933  * - \ref SCIP_STAGE_EXITPRESOLVE
9934  * - \ref SCIP_STAGE_PRESOLVED
9935  * - \ref SCIP_STAGE_INITSOLVE
9936  * - \ref SCIP_STAGE_SOLVING
9937  * - \ref SCIP_STAGE_SOLVED
9938  * - \ref SCIP_STAGE_EXITSOLVE
9939  * - \ref SCIP_STAGE_FREETRANS
9940  */
9941 const char* SCIPgetProbName(
9942  SCIP* scip /**< SCIP data structure */
9943  )
9944 {
9945  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
9946 
9947  return SCIPprobGetName(scip->origprob);
9948 }
9949 
9950 /** sets name of the current problem instance
9951  *
9952  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9953  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9954  *
9955  * @pre This method can be called if @p scip is in one of the following stages:
9956  * - \ref SCIP_STAGE_PROBLEM
9957  * - \ref SCIP_STAGE_TRANSFORMING
9958  * - \ref SCIP_STAGE_TRANSFORMED
9959  * - \ref SCIP_STAGE_INITPRESOLVE
9960  * - \ref SCIP_STAGE_PRESOLVING
9961  * - \ref SCIP_STAGE_EXITPRESOLVE
9962  * - \ref SCIP_STAGE_PRESOLVED
9963  * - \ref SCIP_STAGE_INITSOLVE
9964  * - \ref SCIP_STAGE_SOLVING
9965  * - \ref SCIP_STAGE_SOLVED
9966  * - \ref SCIP_STAGE_EXITSOLVE
9967  * - \ref SCIP_STAGE_FREETRANS
9968  */
9970  SCIP* scip, /**< SCIP data structure */
9971  const char* name /**< name to be set */
9972  )
9973 {
9974  SCIP_CALL( checkStage(scip, "SCIPsetProbName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
9975 
9976  return SCIPprobSetName(scip->origprob, name);
9977 }
9978 
9979 /** returns objective sense of original problem
9980  *
9981  * @return objective sense of original problem
9982  *
9983  * @pre This method can be called if @p scip is in one of the following stages:
9984  * - \ref SCIP_STAGE_PROBLEM
9985  * - \ref SCIP_STAGE_TRANSFORMING
9986  * - \ref SCIP_STAGE_TRANSFORMED
9987  * - \ref SCIP_STAGE_INITPRESOLVE
9988  * - \ref SCIP_STAGE_PRESOLVING
9989  * - \ref SCIP_STAGE_EXITPRESOLVE
9990  * - \ref SCIP_STAGE_PRESOLVED
9991  * - \ref SCIP_STAGE_INITSOLVE
9992  * - \ref SCIP_STAGE_SOLVING
9993  * - \ref SCIP_STAGE_SOLVED
9994  * - \ref SCIP_STAGE_EXITSOLVE
9995  * - \ref SCIP_STAGE_FREETRANS
9996  */
9998  SCIP* scip /**< SCIP data structure */
9999  )
10000 {
10001  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjsense", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10002 
10003  return scip->origprob->objsense;
10004 }
10005 
10006 /** sets objective sense of problem
10007  *
10008  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10009  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10010  *
10011  * @pre This method can be called if @p scip is in one of the following stages:
10012  * - \ref SCIP_STAGE_PROBLEM
10013  */
10015  SCIP* scip, /**< SCIP data structure */
10016  SCIP_OBJSENSE objsense /**< new objective sense */
10017  )
10018 {
10019  SCIP_CALL( checkStage(scip, "SCIPsetObjsense", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10020 
10021  if( objsense != SCIP_OBJSENSE_MAXIMIZE && objsense != SCIP_OBJSENSE_MINIMIZE )
10022  {
10023  SCIPerrorMessage("invalid objective sense\n");
10024  return SCIP_INVALIDDATA;
10025  }
10026 
10027  SCIPprobSetObjsense(scip->origprob, objsense);
10028 
10029  return SCIP_OKAY;
10030 }
10031 
10032 /** adds offset of objective function
10033  *
10034  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10035  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10036  *
10037  * @pre This method can be called if @p scip is in one of the following stages:
10038  * - \ref SCIP_STAGE_PRESOLVING
10039  */
10041  SCIP* scip, /**< SCIP data structure */
10042  SCIP_Real addval /**< value to add to objective offset */
10043  )
10044 {
10045  SCIP_CALL( checkStage(scip, "SCIPaddObjoffset", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10046 
10047  SCIPprobAddObjoffset(scip->transprob, addval);
10048  SCIP_CALL( SCIPprimalUpdateObjoffset(scip->primal, SCIPblkmem(scip), scip->set, scip->stat,
10049  scip->eventqueue, scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
10050 
10051  return SCIP_OKAY;
10052 }
10053 
10054 /** adds offset of objective function to original problem and to all existing solution in original space
10055  *
10056  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10057  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10058  *
10059  * @pre This method can be called if @p scip is in one of the following stages:
10060  * - \ref SCIP_STAGE_PROBLEM
10061  */
10063  SCIP* scip, /**< SCIP data structure */
10064  SCIP_Real addval /**< value to add to objective offset */
10065  )
10066 {
10067  SCIP_CALL( checkStage(scip, "SCIPaddOrigObjoffset", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10068 
10069  scip->origprob->objoffset += addval;
10070  SCIPprimalAddOrigObjoffset(scip->origprimal, scip->set, addval);
10071 
10072  return SCIP_OKAY;
10073 }
10074 
10075 /** returns the objective offset of the original problem
10076  *
10077  * @return the objective offset of the original problem
10078  *
10079  * @pre This method can be called if @p scip is in one of the following stages:
10080  * - \ref SCIP_STAGE_PROBLEM
10081  * - \ref SCIP_STAGE_TRANSFORMING
10082  * - \ref SCIP_STAGE_TRANSFORMED
10083  * - \ref SCIP_STAGE_INITPRESOLVE
10084  * - \ref SCIP_STAGE_PRESOLVING
10085  * - \ref SCIP_STAGE_EXITPRESOLVE
10086  * - \ref SCIP_STAGE_PRESOLVED
10087  * - \ref SCIP_STAGE_INITSOLVE
10088  * - \ref SCIP_STAGE_SOLVING
10089  * - \ref SCIP_STAGE_SOLVED
10090  */
10092  SCIP* scip /**< SCIP data structure */
10093  )
10094 {
10095  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigObjoffset", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
10096 
10097  return scip->origprob->objoffset;
10098 }
10099 
10100 /** returns the objective scale of the original problem
10101  *
10102  * @return the objective scale of the original problem
10103  *
10104  * @pre This method can be called if @p scip is in one of the following stages:
10105  * - \ref SCIP_STAGE_PROBLEM
10106  * - \ref SCIP_STAGE_TRANSFORMING
10107  * - \ref SCIP_STAGE_TRANSFORMED
10108  * - \ref SCIP_STAGE_INITPRESOLVE
10109  * - \ref SCIP_STAGE_PRESOLVING
10110  * - \ref SCIP_STAGE_EXITPRESOLVE
10111  * - \ref SCIP_STAGE_PRESOLVED
10112  * - \ref SCIP_STAGE_INITSOLVE
10113  * - \ref SCIP_STAGE_SOLVING
10114  * - \ref SCIP_STAGE_SOLVED
10115  */
10117  SCIP* scip /**< SCIP data structure */
10118  )
10119 {
10120  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigObjscale", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
10121 
10122  return scip->origprob->objscale;
10123 }
10124 
10125 /** returns the objective offset of the transformed problem
10126  *
10127  * @return the objective offset of the transformed problem
10128  *
10129  * @pre This method can be called if @p scip is in one of the following stages:
10130  * - \ref SCIP_STAGE_TRANSFORMED
10131  * - \ref SCIP_STAGE_INITPRESOLVE
10132  * - \ref SCIP_STAGE_PRESOLVING
10133  * - \ref SCIP_STAGE_EXITPRESOLVE
10134  * - \ref SCIP_STAGE_PRESOLVED
10135  * - \ref SCIP_STAGE_INITSOLVE
10136  * - \ref SCIP_STAGE_SOLVING
10137  * - \ref SCIP_STAGE_SOLVED
10138  */
10140  SCIP* scip /**< SCIP data structure */
10141  )
10142 {
10143  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransObjoffset", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
10144 
10145  return scip->transprob->objoffset;
10146 }
10147 
10148 /** returns the objective scale of the transformed problem
10149  *
10150  * @return the objective scale of the transformed problem
10151  *
10152  * @pre This method can be called if @p scip is in one of the following stages:
10153  * - \ref SCIP_STAGE_TRANSFORMED
10154  * - \ref SCIP_STAGE_INITPRESOLVE
10155  * - \ref SCIP_STAGE_PRESOLVING
10156  * - \ref SCIP_STAGE_EXITPRESOLVE
10157  * - \ref SCIP_STAGE_PRESOLVED
10158  * - \ref SCIP_STAGE_INITSOLVE
10159  * - \ref SCIP_STAGE_SOLVING
10160  * - \ref SCIP_STAGE_SOLVED
10161  */
10163  SCIP* scip /**< SCIP data structure */
10164  )
10165 {
10166  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransObjscale", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
10167 
10168  return scip->transprob->objscale;
10169 }
10170 
10171 /** sets limit on objective function, such that only solutions better than this limit are accepted
10172  *
10173  * @note SCIP will only look for solutions with a strictly better objective value, thus, e.g., prune
10174  * all branch-and-bound nodes with dual bound equal or worse to the objective limit.
10175  * However, SCIP will also collect solutions with objective value worse than the objective limit and
10176  * use them to run improvement heuristics on them.
10177  * @note If SCIP can prove that there exists no solution with a strictly better objective value, the solving status
10178  * will normally be infeasible (the objective limit is interpreted as part of the problem).
10179  * The only exception is that by chance, SCIP found a solution with the same objective value and thus
10180  * proved the optimality of this solution, resulting in solution status optimal.
10181  *
10182  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10183  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10184  *
10185  * @pre This method can be called if @p scip is in one of the following stages:
10186  * - \ref SCIP_STAGE_PROBLEM
10187  * - \ref SCIP_STAGE_TRANSFORMED
10188  * - \ref SCIP_STAGE_INITPRESOLVE
10189  * - \ref SCIP_STAGE_PRESOLVING
10190  * - \ref SCIP_STAGE_EXITPRESOLVE
10191  * - \ref SCIP_STAGE_PRESOLVED
10192  * - \ref SCIP_STAGE_SOLVING
10193  */
10195  SCIP* scip, /**< SCIP data structure */
10196  SCIP_Real objlimit /**< new primal objective limit */
10197  )
10198 {
10199  SCIP_Real oldobjlimit;
10200 
10201  SCIP_CALL( checkStage(scip, "SCIPsetObjlimit", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
10202 
10203  switch( scip->set->stage )
10204  {
10205  case SCIP_STAGE_PROBLEM:
10206  SCIPprobSetObjlim(scip->origprob, objlimit);
10207  break;
10210  case SCIP_STAGE_PRESOLVING:
10212  case SCIP_STAGE_PRESOLVED:
10213  case SCIP_STAGE_SOLVING:
10214  oldobjlimit = SCIPprobGetObjlim(scip->origprob, scip->set);
10215  assert(oldobjlimit == SCIPprobGetObjlim(scip->transprob, scip->set)); /*lint !e777*/
10216  if( SCIPtransformObj(scip, objlimit) > SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, oldobjlimit) )
10217  {
10218  SCIPerrorMessage("cannot relax objective limit from %.15g to %.15g after problem was transformed\n", oldobjlimit, objlimit);
10219  return SCIP_INVALIDDATA;
10220  }
10221  SCIPprobSetObjlim(scip->origprob, objlimit);
10222  SCIPprobSetObjlim(scip->transprob, objlimit);
10223  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
10224  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
10225  break;
10226 
10227  default:
10228  SCIPerrorMessage("method is not callable in SCIP stage <%d>\n", scip->set->stage);
10229  return SCIP_INVALIDCALL;
10230  } /*lint !e788*/
10231 
10232  return SCIP_OKAY;
10233 }
10234 
10235 /** returns current limit on objective function
10236  *
10237  * @return the current objective limit of the original problem
10238  *
10239  * @pre This method can be called if @p scip is in one of the following stages:
10240  * - \ref SCIP_STAGE_PROBLEM
10241  * - \ref SCIP_STAGE_TRANSFORMING
10242  * - \ref SCIP_STAGE_TRANSFORMED
10243  * - \ref SCIP_STAGE_INITPRESOLVE
10244  * - \ref SCIP_STAGE_PRESOLVING
10245  * - \ref SCIP_STAGE_EXITPRESOLVE
10246  * - \ref SCIP_STAGE_PRESOLVED
10247  * - \ref SCIP_STAGE_INITSOLVE
10248  * - \ref SCIP_STAGE_SOLVING
10249  * - \ref SCIP_STAGE_SOLVED
10250  */
10252  SCIP* scip /**< SCIP data structure */
10253  )
10254 {
10255  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjlimit", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
10256 
10257  return SCIPprobGetObjlim(scip->origprob, scip->set);
10258 }
10259 
10260 /** informs SCIP, that the objective value is always integral in every feasible solution
10261  *
10262  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10263  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10264  *
10265  * @pre This method can be called if @p scip is in one of the following stages:
10266  * - \ref SCIP_STAGE_PROBLEM
10267  * - \ref SCIP_STAGE_TRANSFORMING
10268  * - \ref SCIP_STAGE_INITPRESOLVE
10269  * - \ref SCIP_STAGE_EXITPRESOLVE
10270  * - \ref SCIP_STAGE_SOLVING
10271  */
10273  SCIP* scip /**< SCIP data structure */
10274  )
10275 {
10276  SCIP_CALL( checkStage(scip, "SCIPsetObjIntegral", FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
10277 
10278  switch( scip->set->stage )
10279  {
10280  case SCIP_STAGE_PROBLEM:
10282  return SCIP_OKAY;
10283 
10285  case SCIP_STAGE_PRESOLVING:
10286  case SCIP_STAGE_PRESOLVED:
10287  case SCIP_STAGE_SOLVING:
10289  return SCIP_OKAY;
10290 
10291  default:
10292  SCIPerrorMessage("method is not callable in SCIP stage <%d>\n", scip->set->stage);
10293  return SCIP_INVALIDCALL;
10294  } /*lint !e788*/
10295 }
10296 
10297 /** returns whether the objective value is known to be integral in every feasible solution
10298  *
10299  * @return TRUE, if objective value is known to be always integral, otherwise FALSE
10300  *
10301  * @pre This method can be called if @p scip is in one of the following stages:
10302  * - \ref SCIP_STAGE_PROBLEM
10303  * - \ref SCIP_STAGE_TRANSFORMING
10304  * - \ref SCIP_STAGE_INITPRESOLVE
10305  * - \ref SCIP_STAGE_PRESOLVING
10306  * - \ref SCIP_STAGE_EXITPRESOLVE
10307  * - \ref SCIP_STAGE_PRESOLVED
10308  * - \ref SCIP_STAGE_SOLVING
10309  */
10311  SCIP* scip /**< SCIP data structure */
10312  )
10313 {
10314  SCIP_CALL_ABORT( checkStage(scip, "SCIPisObjIntegral", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
10315 
10316  switch( scip->set->stage )
10317  {
10318  case SCIP_STAGE_PROBLEM:
10319  return SCIPprobIsObjIntegral(scip->origprob);
10320 
10323  case SCIP_STAGE_PRESOLVING:
10325  case SCIP_STAGE_PRESOLVED:
10326  case SCIP_STAGE_SOLVING:
10327  return SCIPprobIsObjIntegral(scip->transprob);
10328 
10329  default:
10330  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10331  SCIPABORT();
10332  return FALSE; /*lint !e527*/
10333  } /*lint !e788*/
10334 }
10335 
10336 /** returns the Euclidean norm of the objective function vector (available only for transformed problem)
10337  *
10338  * @return the Euclidean norm of the transformed objective function vector
10339  *
10340  * @pre This method can be called if @p scip is in one of the following stages:
10341  * - \ref SCIP_STAGE_TRANSFORMED
10342  * - \ref SCIP_STAGE_INITPRESOLVE
10343  * - \ref SCIP_STAGE_PRESOLVING
10344  * - \ref SCIP_STAGE_EXITPRESOLVE
10345  * - \ref SCIP_STAGE_PRESOLVED
10346  * - \ref SCIP_STAGE_INITSOLVE
10347  * - \ref SCIP_STAGE_SOLVING
10348  * - \ref SCIP_STAGE_SOLVED
10349  * - \ref SCIP_STAGE_EXITSOLVE
10350  */
10352  SCIP* scip /**< SCIP data structure */
10353  )
10354 {
10355  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjNorm", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
10356 
10357  if( scip->lp->objsqrnormunreliable )
10358  SCIPlpRecalculateObjSqrNorm(scip->set, scip->lp);
10359  assert(!scip->lp->objsqrnormunreliable);
10360 
10361  return SCIPlpGetObjNorm(scip->lp);
10362 }
10363 
10364 /** adds variable to the problem
10365  *
10366  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
10367  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10368  *
10369  * @pre This method can be called if @p scip is in one of the following stages:
10370  * - \ref SCIP_STAGE_PROBLEM
10371  * - \ref SCIP_STAGE_TRANSFORMING
10372  * - \ref SCIP_STAGE_INITPRESOLVE
10373  * - \ref SCIP_STAGE_PRESOLVING
10374  * - \ref SCIP_STAGE_EXITPRESOLVE
10375  * - \ref SCIP_STAGE_PRESOLVED
10376  * - \ref SCIP_STAGE_SOLVING
10377  */
10379  SCIP* scip, /**< SCIP data structure */
10380  SCIP_VAR* var /**< variable to add */
10381  )
10382 {
10383  SCIP_CALL( checkStage(scip, "SCIPaddVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
10384 
10385  /* avoid inserting the same variable twice */
10386  if( SCIPvarGetProbindex(var) != -1 )
10387  return SCIP_OKAY;
10388 
10389  /* insert the negation variable x instead of the negated variable x' in x' = offset - x */
10391  {
10392  assert(SCIPvarGetNegationVar(var) != NULL);
10394  return SCIP_OKAY;
10395  }
10396 
10397  switch( scip->set->stage )
10398  {
10399  case SCIP_STAGE_PROBLEM:
10401  {
10402  SCIPerrorMessage("cannot add transformed variables to original problem\n");
10403  return SCIP_INVALIDDATA;
10404  }
10405  SCIP_CALL( SCIPprobAddVar(scip->origprob, scip->mem->probmem, scip->set, scip->lp, scip->branchcand,
10406  scip->eventfilter, scip->eventqueue, var) );
10407  return SCIP_OKAY;
10408 
10411  case SCIP_STAGE_PRESOLVING:
10413  case SCIP_STAGE_PRESOLVED:
10414  case SCIP_STAGE_SOLVING:
10415  /* check variable's status */
10417  {
10418  SCIPerrorMessage("cannot add original variables to transformed problem\n");
10419  return SCIP_INVALIDDATA;
10420  }
10422  {
10423  SCIPerrorMessage("cannot add fixed or aggregated variables to transformed problem\n");
10424  return SCIP_INVALIDDATA;
10425  }
10426  SCIP_CALL( SCIPprobAddVar(scip->transprob, scip->mem->probmem, scip->set, scip->lp,
10427  scip->branchcand, scip->eventfilter, scip->eventqueue, var) );
10428  return SCIP_OKAY;
10429 
10430  default:
10431  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10432  return SCIP_INVALIDCALL;
10433  } /*lint !e788*/
10434 }
10435 
10436 /** adds variable to the problem and uses it as pricing candidate to enter the LP
10437  *
10438  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
10439  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10440  *
10441  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
10442  */
10444  SCIP* scip, /**< SCIP data structure */
10445  SCIP_VAR* var, /**< variable to add */
10446  SCIP_Real score /**< pricing score of variable (the larger, the better the variable) */
10447  )
10448 {
10449  SCIP_CALL( checkStage(scip, "SCIPaddPricedVar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
10450 
10451  /* insert the negation variable x instead of the negated variable x' in x' = offset - x */
10453  {
10454  assert(SCIPvarGetNegationVar(var) != NULL);
10455  SCIP_CALL( SCIPaddPricedVar(scip, SCIPvarGetNegationVar(var), score) );
10456  return SCIP_OKAY;
10457  }
10458 
10459  /* add variable to problem if not yet inserted */
10460  if( SCIPvarGetProbindex(var) == -1 )
10461  {
10462  /* check variable's status */
10464  {
10465  SCIPerrorMessage("cannot add original variables to transformed problem\n");
10466  return SCIP_INVALIDDATA;
10467  }
10469  {
10470  SCIPerrorMessage("cannot add fixed or aggregated variables to transformed problem\n");
10471  return SCIP_INVALIDDATA;
10472  }
10473  SCIP_CALL( SCIPprobAddVar(scip->transprob, scip->mem->probmem, scip->set, scip->lp,
10474  scip->branchcand, scip->eventfilter, scip->eventqueue, var) );
10475  }
10476 
10477  /* add variable to pricing storage */
10478  SCIP_CALL( SCIPpricestoreAddVar(scip->pricestore, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, var, score,
10479  (SCIPtreeGetCurrentDepth(scip->tree) == 0)) );
10480 
10481  return SCIP_OKAY;
10482 }
10483 
10484 /** removes variable from the problem
10485  *
10486  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
10487  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10488  *
10489  * @pre This method can be called if @p scip is in one of the following stages:
10490  * - \ref SCIP_STAGE_PROBLEM
10491  * - \ref SCIP_STAGE_TRANSFORMING
10492  * - \ref SCIP_STAGE_TRANSFORMED
10493  * - \ref SCIP_STAGE_PRESOLVING
10494  * - \ref SCIP_STAGE_FREETRANS
10495  */
10497  SCIP* scip, /**< SCIP data structure */
10498  SCIP_VAR* var, /**< variable to delete */
10499  SCIP_Bool* deleted /**< pointer to store whether marking variable to be deleted was successful */
10500  )
10501 {
10502  assert(scip != NULL);
10503  assert(var != NULL);
10504  assert(deleted != NULL);
10505 
10506  SCIP_CALL( checkStage(scip, "SCIPdelVar", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE) );
10507 
10508  switch( scip->set->stage )
10509  {
10510  case SCIP_STAGE_PROBLEM:
10512  {
10513  SCIPerrorMessage("cannot remove transformed variables from original problem\n");
10514  return SCIP_INVALIDDATA;
10515  }
10516  SCIP_CALL( SCIPprobDelVar(scip->origprob, scip->mem->probmem, scip->set, scip->eventqueue, var, deleted) );
10517 
10518  /* delete the variables from the problems that were marked to be deleted */
10519  SCIP_CALL( SCIPprobPerformVarDeletions(scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp, scip->branchcand) );
10520 
10521  return SCIP_OKAY;
10522 
10525  case SCIP_STAGE_PRESOLVING:
10526  /* check variable's status */
10528  {
10529  SCIPerrorMessage("cannot remove original variables from transformed problem\n");
10530  return SCIP_INVALIDDATA;
10531  }
10533  {
10534  SCIPerrorMessage("cannot remove fixed or aggregated variables from transformed problem\n");
10535  return SCIP_INVALIDDATA;
10536  }
10537 
10538  SCIP_CALL( SCIPprobDelVar(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, var, deleted) );
10539 
10540  return SCIP_OKAY;
10541  case SCIP_STAGE_FREETRANS:
10542  /* in FREETRANS stage, we don't need to remove the variable, because the transformed problem is freed anyways */
10543  *deleted = FALSE;
10544 
10545  return SCIP_OKAY;
10546  default:
10547  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10548  return SCIP_INVALIDCALL;
10549  } /*lint !e788*/
10550 }
10551 
10552 /** gets variables of the problem along with the numbers of different variable types; data may become invalid after
10553  * calls to SCIPchgVarType(), SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
10554  *
10555  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
10556  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10557  *
10558  * @pre This method can be called if @p scip is in one of the following stages:
10559  * - \ref SCIP_STAGE_PROBLEM
10560  * - \ref SCIP_STAGE_TRANSFORMED
10561  * - \ref SCIP_STAGE_INITPRESOLVE
10562  * - \ref SCIP_STAGE_PRESOLVING
10563  * - \ref SCIP_STAGE_EXITPRESOLVE
10564  * - \ref SCIP_STAGE_PRESOLVED
10565  * - \ref SCIP_STAGE_INITSOLVE
10566  * - \ref SCIP_STAGE_SOLVING
10567  * - \ref SCIP_STAGE_SOLVED
10568  * - \ref SCIP_STAGE_EXITSOLVE
10569  *
10570  * @note Variables in the vars array are ordered: binaries first, then integers, implicit integers and continuous last.
10571  */
10573  SCIP* scip, /**< SCIP data structure */
10574  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
10575  int* nvars, /**< pointer to store number of variables or NULL if not needed */
10576  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
10577  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
10578  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
10579  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
10580  )
10581 {
10582  SCIP_CALL( checkStage(scip, "SCIPgetVarsData", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
10583 
10584  switch( scip->set->stage )
10585  {
10586  case SCIP_STAGE_PROBLEM:
10587  if( vars != NULL )
10588  *vars = scip->origprob->vars;
10589  if( nvars != NULL )
10590  *nvars = scip->origprob->nvars;
10591  if( nbinvars != NULL )
10592  *nbinvars = scip->origprob->nbinvars;
10593  if( nintvars != NULL )
10594  *nintvars = scip->origprob->nintvars;
10595  if( nimplvars != NULL )
10596  *nimplvars = scip->origprob->nimplvars;
10597  if( ncontvars != NULL )
10598  *ncontvars = scip->origprob->ncontvars;
10599  return SCIP_OKAY;
10600 
10603  case SCIP_STAGE_PRESOLVING:
10605  case SCIP_STAGE_PRESOLVED:
10606  case SCIP_STAGE_INITSOLVE:
10607  case SCIP_STAGE_SOLVING:
10608  case SCIP_STAGE_SOLVED:
10609  case SCIP_STAGE_EXITSOLVE:
10610  if( vars != NULL )
10611  *vars = scip->transprob->vars;
10612  if( nvars != NULL )
10613  *nvars = scip->transprob->nvars;
10614  if( nbinvars != NULL )
10615  *nbinvars = scip->transprob->nbinvars;
10616  if( nintvars != NULL )
10617  *nintvars = scip->transprob->nintvars;
10618  if( nimplvars != NULL )
10619  *nimplvars = scip->transprob->nimplvars;
10620  if( ncontvars != NULL )
10621  *ncontvars = scip->transprob->ncontvars;
10622  return SCIP_OKAY;
10623 
10624  default:
10625  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10626  return SCIP_INVALIDCALL;
10627  } /*lint !e788*/
10628 }
10629 
10630 /** gets array with active problem variables
10631  *
10632  * @return array with active problem variables
10633  *
10634  * @pre This method can be called if @p scip is in one of the following stages:
10635  * - \ref SCIP_STAGE_PROBLEM
10636  * - \ref SCIP_STAGE_TRANSFORMED
10637  * - \ref SCIP_STAGE_INITPRESOLVE
10638  * - \ref SCIP_STAGE_PRESOLVING
10639  * - \ref SCIP_STAGE_EXITPRESOLVE
10640  * - \ref SCIP_STAGE_PRESOLVED
10641  * - \ref SCIP_STAGE_INITSOLVE
10642  * - \ref SCIP_STAGE_SOLVING
10643  * - \ref SCIP_STAGE_SOLVED
10644  * - \ref SCIP_STAGE_EXITSOLVE
10645  *
10646  * @note Variables in the array are ordered: binaries first, then integers, implicit integers and continuous last.
10647  *
10648  * @warning If your are using the methods which add or change bound of variables (e.g., SCIPchgVarType(), SCIPfixVar(),
10649  * SCIPaggregateVars(), and SCIPmultiaggregateVar()), it can happen that the internal variable array (which is
10650  * accessed via this method) gets resized and/or resorted. This can invalid the data pointer which is returned
10651  * by this method.
10652  */
10654  SCIP* scip /**< SCIP data structure */
10655  )
10656 {
10657  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
10658 
10659  switch( scip->set->stage )
10660  {
10661  case SCIP_STAGE_PROBLEM:
10662  return scip->origprob->vars;
10663 
10666  case SCIP_STAGE_PRESOLVING:
10668  case SCIP_STAGE_PRESOLVED:
10669  case SCIP_STAGE_INITSOLVE:
10670  case SCIP_STAGE_SOLVING:
10671  case SCIP_STAGE_SOLVED:
10672  case SCIP_STAGE_EXITSOLVE:
10673  return scip->transprob->vars;
10674 
10675  default:
10676  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10677  SCIPABORT();
10678  return NULL; /*lint !e527*/
10679  } /*lint !e788*/
10680 }
10681 
10682 /** gets number of active problem variables
10683  *
10684  * @return the number of active problem variables
10685  *
10686  * @pre This method can be called if @p scip is in one of the following stages:
10687  * - \ref SCIP_STAGE_PROBLEM
10688  * - \ref SCIP_STAGE_TRANSFORMED
10689  * - \ref SCIP_STAGE_INITPRESOLVE
10690  * - \ref SCIP_STAGE_PRESOLVING
10691  * - \ref SCIP_STAGE_EXITPRESOLVE
10692  * - \ref SCIP_STAGE_PRESOLVED
10693  * - \ref SCIP_STAGE_INITSOLVE
10694  * - \ref SCIP_STAGE_SOLVING
10695  * - \ref SCIP_STAGE_SOLVED
10696  * - \ref SCIP_STAGE_EXITSOLVE
10697  */
10699  SCIP* scip /**< SCIP data structure */
10700  )
10701 {
10702  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
10703 
10704  switch( scip->set->stage )
10705  {
10706  case SCIP_STAGE_PROBLEM:
10707  return scip->origprob->nvars;
10708 
10711  case SCIP_STAGE_PRESOLVING:
10713  case SCIP_STAGE_PRESOLVED:
10714  case SCIP_STAGE_INITSOLVE:
10715  case SCIP_STAGE_SOLVING:
10716  case SCIP_STAGE_SOLVED:
10717  case SCIP_STAGE_EXITSOLVE:
10718  return scip->transprob->nvars;
10719 
10720  default:
10721  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10722  SCIPABORT();
10723  return 0; /*lint !e527*/
10724  } /*lint !e788*/
10725 }
10726 
10727 /** gets number of binary active problem variables
10728  *
10729  * @return the number of binary active problem variables
10730  *
10731  * @pre This method can be called if @p scip is in one of the following stages:
10732  * - \ref SCIP_STAGE_PROBLEM
10733  * - \ref SCIP_STAGE_TRANSFORMED
10734  * - \ref SCIP_STAGE_INITPRESOLVE
10735  * - \ref SCIP_STAGE_PRESOLVING
10736  * - \ref SCIP_STAGE_EXITPRESOLVE
10737  * - \ref SCIP_STAGE_PRESOLVED
10738  * - \ref SCIP_STAGE_INITSOLVE
10739  * - \ref SCIP_STAGE_SOLVING
10740  * - \ref SCIP_STAGE_SOLVED
10741  * - \ref SCIP_STAGE_EXITSOLVE
10742  */
10744  SCIP* scip /**< SCIP data structure */
10745  )
10746 {
10747  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBinVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
10748 
10749  switch( scip->set->stage )
10750  {
10751  case SCIP_STAGE_PROBLEM:
10752  return scip->origprob->nbinvars;
10753 
10756  case SCIP_STAGE_PRESOLVING:
10758  case SCIP_STAGE_PRESOLVED:
10759  case SCIP_STAGE_INITSOLVE:
10760  case SCIP_STAGE_SOLVING:
10761  case SCIP_STAGE_SOLVED:
10762  case SCIP_STAGE_EXITSOLVE:
10763  return scip->transprob->nbinvars;
10764 
10765  default:
10766  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10767  SCIPABORT();
10768  return 0; /*lint !e527*/
10769  } /*lint !e788*/
10770 }
10771 
10772 /** gets number of integer active problem variables
10773  *
10774  * @return the number of integer active problem variables
10775  *
10776  * @pre This method can be called if @p scip is in one of the following stages:
10777  * - \ref SCIP_STAGE_PROBLEM
10778  * - \ref SCIP_STAGE_TRANSFORMED
10779  * - \ref SCIP_STAGE_INITPRESOLVE
10780  * - \ref SCIP_STAGE_PRESOLVING
10781  * - \ref SCIP_STAGE_EXITPRESOLVE
10782  * - \ref SCIP_STAGE_PRESOLVED
10783  * - \ref SCIP_STAGE_INITSOLVE
10784  * - \ref SCIP_STAGE_SOLVING
10785  * - \ref SCIP_STAGE_SOLVED
10786  * - \ref SCIP_STAGE_EXITSOLVE
10787  */
10789  SCIP* scip /**< SCIP data structure */
10790  )
10791 {
10792  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNIntVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
10793 
10794  switch( scip->set->stage )
10795  {
10796  case SCIP_STAGE_PROBLEM:
10797  return scip->origprob->nintvars;
10798 
10801  case SCIP_STAGE_PRESOLVING:
10803  case SCIP_STAGE_PRESOLVED:
10804  case SCIP_STAGE_INITSOLVE:
10805  case SCIP_STAGE_SOLVING:
10806  case SCIP_STAGE_SOLVED:
10807  case SCIP_STAGE_EXITSOLVE:
10808  return scip->transprob->nintvars;
10809 
10810  default:
10811  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10812  SCIPABORT();
10813  return 0; /*lint !e527*/
10814  } /*lint !e788*/
10815 }
10816 
10817 /** gets number of implicit integer active problem variables
10818  *
10819  * @return the number of implicit integer active problem variables
10820  *
10821  * @pre This method can be called if @p scip is in one of the following stages:
10822  * - \ref SCIP_STAGE_PROBLEM
10823  * - \ref SCIP_STAGE_TRANSFORMED
10824  * - \ref SCIP_STAGE_INITPRESOLVE
10825  * - \ref SCIP_STAGE_PRESOLVING
10826  * - \ref SCIP_STAGE_EXITPRESOLVE
10827  * - \ref SCIP_STAGE_PRESOLVED
10828  * - \ref SCIP_STAGE_INITSOLVE
10829  * - \ref SCIP_STAGE_SOLVING
10830  * - \ref SCIP_STAGE_SOLVED
10831  * - \ref SCIP_STAGE_EXITSOLVE
10832  */
10834  SCIP* scip /**< SCIP data structure */
10835  )
10836 {
10837  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNImplVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
10838 
10839  switch( scip->set->stage )
10840  {
10841  case SCIP_STAGE_PROBLEM:
10842  return scip->origprob->nimplvars;
10843 
10846  case SCIP_STAGE_PRESOLVING:
10848  case SCIP_STAGE_PRESOLVED:
10849  case SCIP_STAGE_INITSOLVE:
10850  case SCIP_STAGE_SOLVING:
10851  case SCIP_STAGE_SOLVED:
10852  case SCIP_STAGE_EXITSOLVE:
10853  return scip->transprob->nimplvars;
10854 
10855  default:
10856  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10857  SCIPABORT();
10858  return 0; /*lint !e527*/
10859  } /*lint !e788*/
10860 }
10861 
10862 /** gets number of continuous active problem variables
10863  *
10864  * @return the number of continuous active problem variables
10865  *
10866  * @pre This method can be called if @p scip is in one of the following stages:
10867  * - \ref SCIP_STAGE_PROBLEM
10868  * - \ref SCIP_STAGE_TRANSFORMED
10869  * - \ref SCIP_STAGE_INITPRESOLVE
10870  * - \ref SCIP_STAGE_PRESOLVING
10871  * - \ref SCIP_STAGE_EXITPRESOLVE
10872  * - \ref SCIP_STAGE_PRESOLVED
10873  * - \ref SCIP_STAGE_INITSOLVE
10874  * - \ref SCIP_STAGE_SOLVING
10875  * - \ref SCIP_STAGE_SOLVED
10876  * - \ref SCIP_STAGE_EXITSOLVE
10877  */
10879  SCIP* scip /**< SCIP data structure */
10880  )
10881 {
10882  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNContVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
10883 
10884  switch( scip->set->stage )
10885  {
10886  case SCIP_STAGE_PROBLEM:
10887  return scip->origprob->ncontvars;
10888 
10891  case SCIP_STAGE_PRESOLVING:
10893  case SCIP_STAGE_PRESOLVED:
10894  case SCIP_STAGE_INITSOLVE:
10895  case SCIP_STAGE_SOLVING:
10896  case SCIP_STAGE_SOLVED:
10897  case SCIP_STAGE_EXITSOLVE:
10898  return scip->transprob->ncontvars;
10899 
10900  default:
10901  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10902  SCIPABORT();
10903  return 0; /*lint !e527*/
10904  } /*lint !e788*/
10905 }
10906 
10907 
10908 /** gets number of active problem variables with a non-zero objective coefficient
10909  *
10910  * @note In case of the original problem the number of variables is counted. In case of the transformed problem the
10911  * number of variables is just returned since it is stored internally
10912  *
10913  * @return the number of active problem variables with a non-zero objective coefficient
10914  *
10915  * @pre This method can be called if @p scip is in one of the following stages:
10916  * - \ref SCIP_STAGE_PROBLEM
10917  * - \ref SCIP_STAGE_TRANSFORMED
10918  * - \ref SCIP_STAGE_INITPRESOLVE
10919  * - \ref SCIP_STAGE_PRESOLVING
10920  * - \ref SCIP_STAGE_EXITPRESOLVE
10921  * - \ref SCIP_STAGE_PRESOLVED
10922  * - \ref SCIP_STAGE_INITSOLVE
10923  * - \ref SCIP_STAGE_SOLVING
10924  * - \ref SCIP_STAGE_SOLVED
10925  */
10927  SCIP* scip /**< SCIP data structure */
10928  )
10929 {
10930  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNObjVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
10931 
10932  switch( scip->set->stage )
10933  {
10934  case SCIP_STAGE_PROBLEM:
10935  return SCIPprobGetNObjVars(scip->origprob, scip->set);
10936 
10939  case SCIP_STAGE_PRESOLVING:
10941  case SCIP_STAGE_PRESOLVED:
10942  case SCIP_STAGE_INITSOLVE:
10943  case SCIP_STAGE_SOLVING:
10944  case SCIP_STAGE_SOLVED:
10945  return SCIPprobGetNObjVars(scip->transprob, scip->set);
10946 
10947  default:
10948  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10949  SCIPABORT();
10950  return 0; /*lint !e527*/
10951  } /*lint !e788*/
10952 }
10953 
10954 
10955 /** gets array with fixed and aggregated problem variables; data may become invalid after
10956  * calls to SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
10957  *
10958  * @return an array with fixed and aggregated problem variables; data may become invalid after
10959  * calls to SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
10960  *
10961  * @pre This method can be called if @p scip is in one of the following stages:
10962  * - \ref SCIP_STAGE_PROBLEM
10963  * - \ref SCIP_STAGE_TRANSFORMED
10964  * - \ref SCIP_STAGE_INITPRESOLVE
10965  * - \ref SCIP_STAGE_PRESOLVING
10966  * - \ref SCIP_STAGE_EXITPRESOLVE
10967  * - \ref SCIP_STAGE_PRESOLVED
10968  * - \ref SCIP_STAGE_INITSOLVE
10969  * - \ref SCIP_STAGE_SOLVING
10970  * - \ref SCIP_STAGE_SOLVED
10971  */
10973  SCIP* scip /**< SCIP data structure */
10974  )
10975 {
10976  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFixedVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
10977 
10978  switch( scip->set->stage )
10979  {
10980  case SCIP_STAGE_PROBLEM:
10981  return NULL;
10982 
10985  case SCIP_STAGE_PRESOLVING:
10987  case SCIP_STAGE_PRESOLVED:
10988  case SCIP_STAGE_INITSOLVE:
10989  case SCIP_STAGE_SOLVING:
10990  case SCIP_STAGE_SOLVED:
10991  return scip->transprob->fixedvars;
10992 
10993  default:
10994  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10995  SCIPABORT();
10996  return NULL; /*lint !e527*/
10997  } /*lint !e788*/
10998 }
10999 
11000 /** gets number of fixed or aggregated problem variables
11001  *
11002  * @return the number of fixed or aggregated problem variables
11003  *
11004  * @pre This method can be called if @p scip is in one of the following stages:
11005  * - \ref SCIP_STAGE_PROBLEM
11006  * - \ref SCIP_STAGE_TRANSFORMED
11007  * - \ref SCIP_STAGE_INITPRESOLVE
11008  * - \ref SCIP_STAGE_PRESOLVING
11009  * - \ref SCIP_STAGE_EXITPRESOLVE
11010  * - \ref SCIP_STAGE_PRESOLVED
11011  * - \ref SCIP_STAGE_INITSOLVE
11012  * - \ref SCIP_STAGE_SOLVING
11013  * - \ref SCIP_STAGE_SOLVED
11014  */
11016  SCIP* scip /**< SCIP data structure */
11017  )
11018 {
11019  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNFixedVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11020 
11021  switch( scip->set->stage )
11022  {
11023  case SCIP_STAGE_PROBLEM:
11024  return 0;
11025 
11028  case SCIP_STAGE_PRESOLVING:
11030  case SCIP_STAGE_PRESOLVED:
11031  case SCIP_STAGE_INITSOLVE:
11032  case SCIP_STAGE_SOLVING:
11033  case SCIP_STAGE_SOLVED:
11034  return scip->transprob->nfixedvars;
11035 
11036  default:
11037  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11038  SCIPABORT();
11039  return 0; /*lint !e527*/
11040  } /*lint !e788*/
11041 }
11042 
11043 /** gets variables of the original problem along with the numbers of different variable types; data may become invalid
11044  * after a call to SCIPchgVarType()
11045  *
11046  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11047  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11048  *
11049  * @pre This method can be called if @p scip is in one of the following stages:
11050  * - \ref SCIP_STAGE_PROBLEM
11051  * - \ref SCIP_STAGE_TRANSFORMING
11052  * - \ref SCIP_STAGE_TRANSFORMED
11053  * - \ref SCIP_STAGE_INITPRESOLVE
11054  * - \ref SCIP_STAGE_PRESOLVING
11055  * - \ref SCIP_STAGE_EXITPRESOLVE
11056  * - \ref SCIP_STAGE_PRESOLVED
11057  * - \ref SCIP_STAGE_INITSOLVE
11058  * - \ref SCIP_STAGE_SOLVING
11059  * - \ref SCIP_STAGE_SOLVED
11060  * - \ref SCIP_STAGE_EXITSOLVE
11061  * - \ref SCIP_STAGE_FREETRANS
11062  */
11064  SCIP* scip, /**< SCIP data structure */
11065  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
11066  int* nvars, /**< pointer to store number of variables or NULL if not needed */
11067  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
11068  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
11069  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
11070  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
11071  )
11072 {
11073  SCIP_CALL( checkStage(scip, "SCIPgetOrigVarsData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11074 
11075  if( vars != NULL )
11076  *vars = scip->origprob->vars;
11077  if( nvars != NULL )
11078  *nvars = scip->origprob->nvars;
11079  if( nbinvars != NULL )
11080  *nbinvars = scip->origprob->nbinvars;
11081  if( nintvars != NULL )
11082  *nintvars = scip->origprob->nintvars;
11083  if( nimplvars != NULL )
11084  *nimplvars = scip->origprob->nimplvars;
11085  if( ncontvars != NULL )
11086  *ncontvars = scip->origprob->ncontvars;
11087 
11088  return SCIP_OKAY;
11089 }
11090 
11091 /** gets array with original problem variables; data may become invalid after
11092  * a call to SCIPchgVarType()
11093  *
11094  * @return an array with original problem variables; data may become invalid after
11095  * a call to SCIPchgVarType()
11096  *
11097  * @pre This method can be called if @p scip is in one of the following stages:
11098  * - \ref SCIP_STAGE_PROBLEM
11099  * - \ref SCIP_STAGE_TRANSFORMING
11100  * - \ref SCIP_STAGE_TRANSFORMED
11101  * - \ref SCIP_STAGE_INITPRESOLVE
11102  * - \ref SCIP_STAGE_PRESOLVING
11103  * - \ref SCIP_STAGE_EXITPRESOLVE
11104  * - \ref SCIP_STAGE_PRESOLVED
11105  * - \ref SCIP_STAGE_INITSOLVE
11106  * - \ref SCIP_STAGE_SOLVING
11107  * - \ref SCIP_STAGE_SOLVED
11108  * - \ref SCIP_STAGE_EXITSOLVE
11109  * - \ref SCIP_STAGE_FREETRANS
11110  */
11112  SCIP* scip /**< SCIP data structure */
11113  )
11114 {
11115  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11116 
11117  return scip->origprob->vars;
11118 }
11119 
11120 /** gets number of original problem variables
11121  *
11122  * @return the number of original problem variables
11123  *
11124  * @pre This method can be called if @p scip is in one of the following stages:
11125  * - \ref SCIP_STAGE_PROBLEM
11126  * - \ref SCIP_STAGE_TRANSFORMING
11127  * - \ref SCIP_STAGE_TRANSFORMED
11128  * - \ref SCIP_STAGE_INITPRESOLVE
11129  * - \ref SCIP_STAGE_PRESOLVING
11130  * - \ref SCIP_STAGE_EXITPRESOLVE
11131  * - \ref SCIP_STAGE_PRESOLVED
11132  * - \ref SCIP_STAGE_INITSOLVE
11133  * - \ref SCIP_STAGE_SOLVING
11134  * - \ref SCIP_STAGE_SOLVED
11135  * - \ref SCIP_STAGE_EXITSOLVE
11136  * - \ref SCIP_STAGE_FREETRANS
11137  */
11139  SCIP* scip /**< SCIP data structure */
11140  )
11141 {
11142  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11143 
11144  return scip->origprob->nvars;
11145 }
11146 
11147 /** gets number of binary variables in the original problem
11148  *
11149  * @return the number of binary variables in the original problem
11150  *
11151  * @pre This method can be called if @p scip is in one of the following stages:
11152  * - \ref SCIP_STAGE_PROBLEM
11153  * - \ref SCIP_STAGE_TRANSFORMING
11154  * - \ref SCIP_STAGE_TRANSFORMED
11155  * - \ref SCIP_STAGE_INITPRESOLVE
11156  * - \ref SCIP_STAGE_PRESOLVING
11157  * - \ref SCIP_STAGE_EXITPRESOLVE
11158  * - \ref SCIP_STAGE_PRESOLVED
11159  * - \ref SCIP_STAGE_INITSOLVE
11160  * - \ref SCIP_STAGE_SOLVING
11161  * - \ref SCIP_STAGE_SOLVED
11162  * - \ref SCIP_STAGE_EXITSOLVE
11163  * - \ref SCIP_STAGE_FREETRANS
11164  */
11166  SCIP* scip /**< SCIP data structure */
11167  )
11168 {
11169  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigBinVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11170 
11171  return scip->origprob->nbinvars;
11172 }
11173 
11174 /** gets the number of integer variables in the original problem
11175  *
11176  * @return the number of integer variables in the original problem
11177  *
11178  * @pre This method can be called if @p scip is in one of the following stages:
11179  * - \ref SCIP_STAGE_PROBLEM
11180  * - \ref SCIP_STAGE_TRANSFORMING
11181  * - \ref SCIP_STAGE_TRANSFORMED
11182  * - \ref SCIP_STAGE_INITPRESOLVE
11183  * - \ref SCIP_STAGE_PRESOLVING
11184  * - \ref SCIP_STAGE_EXITPRESOLVE
11185  * - \ref SCIP_STAGE_PRESOLVED
11186  * - \ref SCIP_STAGE_INITSOLVE
11187  * - \ref SCIP_STAGE_SOLVING
11188  * - \ref SCIP_STAGE_SOLVED
11189  * - \ref SCIP_STAGE_EXITSOLVE
11190  * - \ref SCIP_STAGE_FREETRANS
11191  */
11193  SCIP* scip /**< SCIP data structure */
11194  )
11195 {
11196  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigIntVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11197 
11198  return scip->origprob->nintvars;
11199 }
11200 
11201 /** gets number of implicit integer variables in the original problem
11202  *
11203  * @return the number of implicit integer variables in the original problem
11204  *
11205  * @pre This method can be called if @p scip is in one of the following stages:
11206  * - \ref SCIP_STAGE_PROBLEM
11207  * - \ref SCIP_STAGE_TRANSFORMING
11208  * - \ref SCIP_STAGE_TRANSFORMED
11209  * - \ref SCIP_STAGE_INITPRESOLVE
11210  * - \ref SCIP_STAGE_PRESOLVING
11211  * - \ref SCIP_STAGE_EXITPRESOLVE
11212  * - \ref SCIP_STAGE_PRESOLVED
11213  * - \ref SCIP_STAGE_INITSOLVE
11214  * - \ref SCIP_STAGE_SOLVING
11215  * - \ref SCIP_STAGE_SOLVED
11216  * - \ref SCIP_STAGE_EXITSOLVE
11217  * - \ref SCIP_STAGE_FREETRANS
11218  */
11220  SCIP* scip /**< SCIP data structure */
11221  )
11222 {
11223  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigImplVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11224 
11225  return scip->origprob->nimplvars;
11226 }
11227 
11228 /** gets number of continuous variables in the original problem
11229  *
11230  * @return the number of continuous variables in the original problem
11231  *
11232  * @pre This method can be called if @p scip is in one of the following stages:
11233  * - \ref SCIP_STAGE_PROBLEM
11234  * - \ref SCIP_STAGE_TRANSFORMING
11235  * - \ref SCIP_STAGE_TRANSFORMED
11236  * - \ref SCIP_STAGE_INITPRESOLVE
11237  * - \ref SCIP_STAGE_PRESOLVING
11238  * - \ref SCIP_STAGE_EXITPRESOLVE
11239  * - \ref SCIP_STAGE_PRESOLVED
11240  * - \ref SCIP_STAGE_INITSOLVE
11241  * - \ref SCIP_STAGE_SOLVING
11242  * - \ref SCIP_STAGE_SOLVED
11243  * - \ref SCIP_STAGE_EXITSOLVE
11244  * - \ref SCIP_STAGE_FREETRANS
11245  */
11247  SCIP* scip /**< SCIP data structure */
11248  )
11249 {
11250  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigContVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11251 
11252  return scip->origprob->ncontvars;
11253 }
11254 
11255 /** gets number of all problem variables created during creation and solving of problem;
11256  * this includes also variables that were deleted in the meantime
11257  *
11258  * @return the number of all problem variables created during creation and solving of problem;
11259  * this includes also variables that were deleted in the meantime
11260  *
11261  * @pre This method can be called if @p scip is in one of the following stages:
11262  * - \ref SCIP_STAGE_PROBLEM
11263  * - \ref SCIP_STAGE_TRANSFORMING
11264  * - \ref SCIP_STAGE_TRANSFORMED
11265  * - \ref SCIP_STAGE_INITPRESOLVE
11266  * - \ref SCIP_STAGE_PRESOLVING
11267  * - \ref SCIP_STAGE_EXITPRESOLVE
11268  * - \ref SCIP_STAGE_PRESOLVED
11269  * - \ref SCIP_STAGE_INITSOLVE
11270  * - \ref SCIP_STAGE_SOLVING
11271  * - \ref SCIP_STAGE_SOLVED
11272  * - \ref SCIP_STAGE_EXITSOLVE
11273  * - \ref SCIP_STAGE_FREETRANS
11274  */
11276  SCIP* scip /**< SCIP data structure */
11277  )
11278 {
11279  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNTotalVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11280 
11281  assert(scip->stat != NULL);
11282 
11283  switch( scip->set->stage )
11284  {
11285  case SCIP_STAGE_PROBLEM:
11289  case SCIP_STAGE_PRESOLVING:
11291  case SCIP_STAGE_PRESOLVED:
11292  case SCIP_STAGE_INITSOLVE:
11293  case SCIP_STAGE_SOLVING:
11294  case SCIP_STAGE_SOLVED:
11295  case SCIP_STAGE_EXITSOLVE:
11296  case SCIP_STAGE_FREETRANS:
11297  return scip->stat->nvaridx;
11298 
11299  default:
11300  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11301  SCIPABORT();
11302  return 0; /*lint !e527*/
11303  } /*lint !e788*/
11304 
11305 }
11306 
11307 
11308 /** gets variables of the original or transformed problem along with the numbers of different variable types;
11309  * the returned problem space (original or transformed) corresponds to the given solution;
11310  * data may become invalid after calls to SCIPchgVarType(), SCIPfixVar(), SCIPaggregateVars(), and
11311  * SCIPmultiaggregateVar()
11312  *
11313  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11314  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11315  *
11316  * @pre This method can be called if @p scip is in one of the following stages:
11317  * - \ref SCIP_STAGE_PROBLEM
11318  * - \ref SCIP_STAGE_TRANSFORMED
11319  * - \ref SCIP_STAGE_INITPRESOLVE
11320  * - \ref SCIP_STAGE_PRESOLVING
11321  * - \ref SCIP_STAGE_EXITPRESOLVE
11322  * - \ref SCIP_STAGE_PRESOLVED
11323  * - \ref SCIP_STAGE_INITSOLVE
11324  * - \ref SCIP_STAGE_SOLVING
11325  * - \ref SCIP_STAGE_SOLVED
11326  */
11328  SCIP* scip, /**< SCIP data structure */
11329  SCIP_SOL* sol, /**< primal solution that selects the problem space, NULL for current solution */
11330  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
11331  int* nvars, /**< pointer to store number of variables or NULL if not needed */
11332  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
11333  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
11334  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
11335  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
11336  )
11337 {
11338  SCIP_CALL( checkStage(scip, "SCIPgetSolVarsData", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11339 
11340  if( scip->set->stage == SCIP_STAGE_PROBLEM || (sol != NULL && SCIPsolIsOriginal(sol)) )
11341  {
11342  if( vars != NULL )
11343  *vars = scip->origprob->vars;
11344  if( nvars != NULL )
11345  *nvars = scip->origprob->nvars;
11346  if( nbinvars != NULL )
11347  *nbinvars = scip->origprob->nbinvars;
11348  if( nintvars != NULL )
11349  *nintvars = scip->origprob->nintvars;
11350  if( nimplvars != NULL )
11351  *nimplvars = scip->origprob->nimplvars;
11352  if( ncontvars != NULL )
11353  *ncontvars = scip->origprob->ncontvars;
11354  }
11355  else
11356  {
11357  if( vars != NULL )
11358  *vars = scip->transprob->vars;
11359  if( nvars != NULL )
11360  *nvars = scip->transprob->nvars;
11361  if( nbinvars != NULL )
11362  *nbinvars = scip->transprob->nbinvars;
11363  if( nintvars != NULL )
11364  *nintvars = scip->transprob->nintvars;
11365  if( nimplvars != NULL )
11366  *nimplvars = scip->transprob->nimplvars;
11367  if( ncontvars != NULL )
11368  *ncontvars = scip->transprob->ncontvars;
11369  }
11370 
11371  return SCIP_OKAY;
11372 }
11373 
11374 /** returns variable of given name in the problem, or NULL if not existing
11375  *
11376  * @return variable of given name in the problem, or NULL if not existing
11377  *
11378  * @pre This method can be called if @p scip is in one of the following stages:
11379  * - \ref SCIP_STAGE_PROBLEM
11380  * - \ref SCIP_STAGE_TRANSFORMING
11381  * - \ref SCIP_STAGE_TRANSFORMED
11382  * - \ref SCIP_STAGE_INITPRESOLVE
11383  * - \ref SCIP_STAGE_PRESOLVING
11384  * - \ref SCIP_STAGE_EXITPRESOLVE
11385  * - \ref SCIP_STAGE_PRESOLVED
11386  * - \ref SCIP_STAGE_INITSOLVE
11387  * - \ref SCIP_STAGE_SOLVING
11388  * - \ref SCIP_STAGE_SOLVED
11389  * - \ref SCIP_STAGE_EXITSOLVE
11390  * - \ref SCIP_STAGE_FREETRANS
11391  */
11393  SCIP* scip, /**< SCIP data structure */
11394  const char* name /**< name of variable to find */
11395  )
11396 {
11397  SCIP_VAR* var;
11398 
11399  assert(name != NULL);
11400 
11401  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11402 
11403  switch( scip->set->stage )
11404  {
11405  case SCIP_STAGE_PROBLEM:
11406  return SCIPprobFindVar(scip->origprob, name);
11407 
11411  case SCIP_STAGE_PRESOLVING:
11413  case SCIP_STAGE_PRESOLVED:
11414  case SCIP_STAGE_INITSOLVE:
11415  case SCIP_STAGE_SOLVING:
11416  case SCIP_STAGE_SOLVED:
11417  case SCIP_STAGE_EXITSOLVE:
11418  case SCIP_STAGE_FREETRANS:
11419  var = SCIPprobFindVar(scip->transprob, name);
11420  if( var == NULL )
11421  return SCIPprobFindVar(scip->origprob, name);
11422  else
11423  return var;
11424 
11425  default:
11426  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11427  SCIPABORT();
11428  return NULL; /*lint !e527*/
11429  } /*lint !e788*/
11430 }
11431 
11432 /** returns TRUE iff all potential variables exist in the problem, and FALSE, if there may be additional variables,
11433  * that will be added in pricing and improve the objective value
11434  *
11435  * @return TRUE, if all potential variables exist in the problem; FALSE, otherwise
11436  *
11437  * @pre This method can be called if @p scip is in one of the following stages:
11438  * - \ref SCIP_STAGE_TRANSFORMING
11439  * - \ref SCIP_STAGE_TRANSFORMED
11440  * - \ref SCIP_STAGE_INITPRESOLVE
11441  * - \ref SCIP_STAGE_PRESOLVING
11442  * - \ref SCIP_STAGE_EXITPRESOLVE
11443  * - \ref SCIP_STAGE_PRESOLVED
11444  * - \ref SCIP_STAGE_INITSOLVE
11445  * - \ref SCIP_STAGE_SOLVING
11446  * - \ref SCIP_STAGE_SOLVED
11447  * - \ref SCIP_STAGE_EXITSOLVE
11448  * - \ref SCIP_STAGE_FREETRANS
11449  */
11451  SCIP* scip /**< SCIP data structure */
11452  )
11453 {
11454  SCIP_CALL_ABORT( checkStage(scip, "SCIPallVarsInProb", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11455 
11456  return (scip->set->nactivepricers == 0);
11457 }
11458 
11459 /** adds constraint to the problem; if constraint is only valid locally, it is added to the local subproblem of the
11460  * current node (and all of its subnodes); otherwise it is added to the global problem;
11461  * if a local constraint is added at the root node, it is automatically upgraded into a global constraint
11462  *
11463  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11464  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11465  *
11466  * @pre This method can be called if @p scip is in one of the following stages:
11467  * - \ref SCIP_STAGE_PROBLEM
11468  * - \ref SCIP_STAGE_TRANSFORMED
11469  * - \ref SCIP_STAGE_INITPRESOLVE
11470  * - \ref SCIP_STAGE_PRESOLVING
11471  * - \ref SCIP_STAGE_EXITPRESOLVE
11472  * - \ref SCIP_STAGE_PRESOLVED
11473  * - \ref SCIP_STAGE_INITSOLVE
11474  * - \ref SCIP_STAGE_SOLVING
11475  * - \ref SCIP_STAGE_EXITSOLVE
11476  */
11478  SCIP* scip, /**< SCIP data structure */
11479  SCIP_CONS* cons /**< constraint to add */
11480  )
11481 {
11482  assert(cons != NULL);
11483 
11484  SCIP_CALL( checkStage(scip, "SCIPaddCons", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
11485 
11486  switch( scip->set->stage )
11487  {
11488  case SCIP_STAGE_PROBLEM:
11489  SCIP_CALL( SCIPprobAddCons(scip->origprob, scip->set, scip->stat, cons) );
11490  return SCIP_OKAY;
11491 
11493  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
11494  return SCIP_OKAY;
11495 
11497  case SCIP_STAGE_PRESOLVING:
11499  case SCIP_STAGE_PRESOLVED:
11500  case SCIP_STAGE_SOLVING:
11501  assert( SCIPtreeGetCurrentDepth(scip->tree) >= 0 || scip->set->stage == SCIP_STAGE_PRESOLVED );
11503  SCIPconsSetLocal(cons, FALSE);
11504  if( SCIPconsIsGlobal(cons) )
11505  {
11506  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
11507  }
11508  else
11509  {
11511  SCIP_CALL( SCIPnodeAddCons(SCIPtreeGetCurrentNode(scip->tree), scip->mem->probmem, scip->set, scip->stat,
11512  scip->tree, cons) );
11513  }
11514  return SCIP_OKAY;
11515 
11516  case SCIP_STAGE_EXITSOLVE:
11517  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
11518  return SCIP_OKAY;
11519 
11520  default:
11521  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11522  return SCIP_INVALIDCALL;
11523  } /*lint !e788*/
11524 }
11525 
11526 /** globally removes constraint from all subproblems; removes constraint from the constraint set change data of the
11527  * node, where it was added, or from the problem, if it was a problem constraint
11528  *
11529  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11530  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11531  *
11532  * @pre This method can be called if @p scip is in one of the following stages:
11533  * - \ref SCIP_STAGE_PROBLEM
11534  * - \ref SCIP_STAGE_INITPRESOLVE
11535  * - \ref SCIP_STAGE_PRESOLVING
11536  * - \ref SCIP_STAGE_EXITPRESOLVE
11537  * - \ref SCIP_STAGE_INITSOLVE
11538  * - \ref SCIP_STAGE_SOLVING
11539  */
11541  SCIP* scip, /**< SCIP data structure */
11542  SCIP_CONS* cons /**< constraint to delete */
11543  )
11544 {
11545  assert(cons != NULL);
11546 
11547  SCIP_CALL( checkStage(scip, "SCIPdelCons", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11548 
11549  switch( scip->set->stage )
11550  {
11551  case SCIP_STAGE_PROBLEM:
11552  assert(cons->addconssetchg == NULL);
11553  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->origprob) );
11554  return SCIP_OKAY;
11555 
11556  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
11557  * might be wrong
11558  */
11561  assert(SCIPconsIsAdded(cons));
11562  /*lint -fallthrough*/
11563 
11564  case SCIP_STAGE_PRESOLVING:
11565  case SCIP_STAGE_SOLVING:
11566  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob) );
11567  return SCIP_OKAY;
11568 
11569  default:
11570  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11571  return SCIP_INVALIDCALL;
11572  } /*lint !e788*/
11573 }
11574 
11575 /** returns original constraint of given name in the problem, or NULL if not existing
11576  *
11577  * @return original constraint of given name in the problem, or NULL if not existing
11578  *
11579  * @pre This method can be called if @p scip is in one of the following stages:
11580  * - \ref SCIP_STAGE_PROBLEM
11581  * - \ref SCIP_STAGE_TRANSFORMING
11582  * - \ref SCIP_STAGE_TRANSFORMED
11583  * - \ref SCIP_STAGE_INITPRESOLVE
11584  * - \ref SCIP_STAGE_PRESOLVING
11585  * - \ref SCIP_STAGE_EXITPRESOLVE
11586  * - \ref SCIP_STAGE_PRESOLVED
11587  * - \ref SCIP_STAGE_INITSOLVE
11588  * - \ref SCIP_STAGE_SOLVING
11589  * - \ref SCIP_STAGE_SOLVED
11590  * - \ref SCIP_STAGE_EXITSOLVE
11591  * - \ref SCIP_STAGE_FREETRANS
11592  */
11594  SCIP* scip, /**< SCIP data structure */
11595  const char* name /**< name of constraint to find */
11596  )
11597 {
11598  assert(name != NULL);
11599 
11600  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindOrigCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11601 
11602  switch( scip->set->stage )
11603  {
11604  case SCIP_STAGE_PROBLEM:
11607  case SCIP_STAGE_PRESOLVING:
11609  case SCIP_STAGE_PRESOLVED:
11610  case SCIP_STAGE_SOLVING:
11611  case SCIP_STAGE_SOLVED:
11612  case SCIP_STAGE_EXITSOLVE:
11613  case SCIP_STAGE_FREETRANS:
11614  return SCIPprobFindCons(scip->origprob, name);
11615 
11616  default:
11617  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11618  SCIPABORT();
11619  return NULL; /*lint !e527*/
11620  } /*lint !e788*/
11621 }
11622 
11623 /** returns constraint of given name in the problem, or NULL if not existing
11624  *
11625  * @return constraint of given name in the problem, or NULL if not existing
11626  *
11627  * @pre This method can be called if @p scip is in one of the following stages:
11628  * - \ref SCIP_STAGE_PROBLEM
11629  * - \ref SCIP_STAGE_TRANSFORMING
11630  * - \ref SCIP_STAGE_TRANSFORMED
11631  * - \ref SCIP_STAGE_INITPRESOLVE
11632  * - \ref SCIP_STAGE_PRESOLVING
11633  * - \ref SCIP_STAGE_EXITPRESOLVE
11634  * - \ref SCIP_STAGE_PRESOLVED
11635  * - \ref SCIP_STAGE_INITSOLVE
11636  * - \ref SCIP_STAGE_SOLVING
11637  * - \ref SCIP_STAGE_SOLVED
11638  * - \ref SCIP_STAGE_EXITSOLVE
11639  * - \ref SCIP_STAGE_FREETRANS
11640  */
11642  SCIP* scip, /**< SCIP data structure */
11643  const char* name /**< name of constraint to find */
11644  )
11645 {
11646  SCIP_CONS* cons;
11647 
11648  assert(name != NULL);
11649 
11650  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11651 
11652  switch( scip->set->stage )
11653  {
11654  case SCIP_STAGE_PROBLEM:
11655  return SCIPprobFindCons(scip->origprob, name);
11656 
11660  case SCIP_STAGE_PRESOLVING:
11662  case SCIP_STAGE_PRESOLVED:
11663  case SCIP_STAGE_SOLVING:
11664  case SCIP_STAGE_SOLVED:
11665  case SCIP_STAGE_EXITSOLVE:
11666  case SCIP_STAGE_FREETRANS:
11667  cons = SCIPprobFindCons(scip->transprob, name);
11668  if( cons == NULL )
11669  return SCIPprobFindCons(scip->origprob, name);
11670  else
11671  return cons;
11672 
11673  default:
11674  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11675  SCIPABORT();
11676  return NULL; /*lint !e527*/
11677  } /*lint !e788*/
11678 }
11679 
11680 /** gets number of upgraded constraints
11681  *
11682  * @return number of upgraded constraints
11683  *
11684  * @pre This method can be called if @p scip is in one of the following stages:
11685  * - \ref SCIP_STAGE_PROBLEM
11686  * - \ref SCIP_STAGE_TRANSFORMED
11687  * - \ref SCIP_STAGE_INITPRESOLVE
11688  * - \ref SCIP_STAGE_PRESOLVING
11689  * - \ref SCIP_STAGE_PRESOLVED
11690  * - \ref SCIP_STAGE_EXITPRESOLVE
11691  * - \ref SCIP_STAGE_SOLVING
11692  * - \ref SCIP_STAGE_SOLVED
11693  */
11695  SCIP* scip /**< SCIP data structure */
11696  )
11697 {
11698  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNUpgrConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11699 
11700  switch( scip->set->stage )
11701  {
11702  case SCIP_STAGE_PROBLEM:
11703  return 0;
11704 
11707  case SCIP_STAGE_PRESOLVING:
11709  case SCIP_STAGE_PRESOLVED:
11710  case SCIP_STAGE_SOLVING:
11711  case SCIP_STAGE_SOLVED:
11712  return scip->stat->npresolupgdconss;
11713 
11714  default:
11715  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11716  SCIPABORT();
11717  return 0; /*lint !e527*/
11718  } /*lint !e788*/
11719 }
11720 
11721 /** gets total number of globally valid constraints currently in the problem
11722  *
11723  * @return total number of globally valid constraints currently in the problem
11724  *
11725  * @pre This method can be called if @p scip is in one of the following stages:
11726  * - \ref SCIP_STAGE_PROBLEM
11727  * - \ref SCIP_STAGE_TRANSFORMED
11728  * - \ref SCIP_STAGE_INITPRESOLVE
11729  * - \ref SCIP_STAGE_PRESOLVING
11730  * - \ref SCIP_STAGE_EXITPRESOLVE
11731  * - \ref SCIP_STAGE_PRESOLVED
11732  * - \ref SCIP_STAGE_INITSOLVE
11733  * - \ref SCIP_STAGE_SOLVING
11734  * - \ref SCIP_STAGE_SOLVED
11735  */
11737  SCIP* scip /**< SCIP data structure */
11738  )
11739 {
11740  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11741 
11742  switch( scip->set->stage )
11743  {
11744  case SCIP_STAGE_PROBLEM:
11745  return scip->origprob->nconss;
11746 
11749  case SCIP_STAGE_PRESOLVING:
11751  case SCIP_STAGE_PRESOLVED:
11752  case SCIP_STAGE_INITSOLVE:
11753  case SCIP_STAGE_SOLVING:
11754  case SCIP_STAGE_SOLVED:
11755  return scip->transprob->nconss;
11756 
11757  default:
11758  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11759  SCIPABORT();
11760  return 0; /*lint !e527*/
11761  } /*lint !e788*/
11762 }
11763 
11764 /** gets array of globally valid constraints currently in the problem
11765  *
11766  * @return array of globally valid constraints currently in the problem
11767  *
11768  * @pre This method can be called if @p scip is in one of the following stages:
11769  * - \ref SCIP_STAGE_PROBLEM
11770  * - \ref SCIP_STAGE_TRANSFORMED
11771  * - \ref SCIP_STAGE_INITPRESOLVE
11772  * - \ref SCIP_STAGE_PRESOLVING
11773  * - \ref SCIP_STAGE_EXITPRESOLVE
11774  * - \ref SCIP_STAGE_PRESOLVED
11775  * - \ref SCIP_STAGE_INITSOLVE
11776  * - \ref SCIP_STAGE_SOLVING
11777  * - \ref SCIP_STAGE_SOLVED
11778  *
11779  * @warning If your are using the method SCIPaddCons(), it can happen that the internal constraint array (which is
11780  * accessed via this method) gets resized. This can invalid the pointer which is returned by this method.
11781  */
11783  SCIP* scip /**< SCIP data structure */
11784  )
11785 {
11786  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11787 
11788  switch( scip->set->stage )
11789  {
11790  case SCIP_STAGE_PROBLEM:
11791  return scip->origprob->conss;
11792 
11795  case SCIP_STAGE_PRESOLVING:
11797  case SCIP_STAGE_PRESOLVED:
11798  case SCIP_STAGE_INITSOLVE:
11799  case SCIP_STAGE_SOLVING:
11800  case SCIP_STAGE_SOLVED:
11801  return scip->transprob->conss;
11802 
11803  default:
11804  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11805  SCIPABORT();
11806  return NULL; /*lint !e527*/
11807  } /*lint !e788*/
11808 }
11809 
11810 /** gets total number of constraints in the original problem
11811  *
11812  * @return total number of constraints in the original problem
11813  *
11814  * @pre This method can be called if @p scip is in one of the following stages:
11815  * - \ref SCIP_STAGE_PROBLEM
11816  * - \ref SCIP_STAGE_TRANSFORMING
11817  * - \ref SCIP_STAGE_TRANSFORMED
11818  * - \ref SCIP_STAGE_INITPRESOLVE
11819  * - \ref SCIP_STAGE_PRESOLVING
11820  * - \ref SCIP_STAGE_EXITPRESOLVE
11821  * - \ref SCIP_STAGE_PRESOLVED
11822  * - \ref SCIP_STAGE_INITSOLVE
11823  * - \ref SCIP_STAGE_SOLVING
11824  * - \ref SCIP_STAGE_SOLVED
11825  * - \ref SCIP_STAGE_EXITSOLVE
11826  * - \ref SCIP_STAGE_FREETRANS
11827  */
11829  SCIP* scip /**< SCIP data structure */
11830  )
11831 {
11832  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigConss", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11833 
11834  return scip->origprob->nconss;
11835 }
11836 
11837 /** gets array of constraints in the original problem
11838  *
11839  * @return array of constraints in the original problem
11840  *
11841  * @pre This method can be called if @p scip is in one of the following stages:
11842  * - \ref SCIP_STAGE_PROBLEM
11843  * - \ref SCIP_STAGE_TRANSFORMING
11844  * - \ref SCIP_STAGE_TRANSFORMED
11845  * - \ref SCIP_STAGE_INITPRESOLVE
11846  * - \ref SCIP_STAGE_PRESOLVING
11847  * - \ref SCIP_STAGE_EXITPRESOLVE
11848  * - \ref SCIP_STAGE_PRESOLVED
11849  * - \ref SCIP_STAGE_INITSOLVE
11850  * - \ref SCIP_STAGE_SOLVING
11851  * - \ref SCIP_STAGE_SOLVED
11852  * - \ref SCIP_STAGE_EXITSOLVE
11853  * - \ref SCIP_STAGE_FREETRANS
11854  */
11856  SCIP* scip /**< SCIP data structure */
11857  )
11858 {
11859  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigConss", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11860 
11861  return scip->origprob->conss;
11862 }
11863 
11864 /** computes the number of check constraint in the current node (loop over all constraint handler and cumulates the
11865  * number of check constraints)
11866  *
11867  * @return returns the number of check constraints
11868  *
11869  * @pre This method can be called if @p scip is in one of the following stages:
11870  * - \ref SCIP_STAGE_TRANSFORMED
11871  * - \ref SCIP_STAGE_INITPRESOLVE
11872  * - \ref SCIP_STAGE_PRESOLVING
11873  * - \ref SCIP_STAGE_EXITPRESOLVE
11874  * - \ref SCIP_STAGE_PRESOLVED
11875  * - \ref SCIP_STAGE_INITSOLVE
11876  * - \ref SCIP_STAGE_SOLVING
11877  */
11879  SCIP* scip /**< SCIP data structure */
11880  )
11881 {
11882  SCIP_CONSHDLR** conshdlrs;
11883  int nconshdlrs;
11884  int ncheckconss;
11885  int c;
11886 
11887  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCheckConss", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11888 
11889  nconshdlrs = SCIPgetNConshdlrs(scip);
11890  conshdlrs = SCIPgetConshdlrs(scip);
11891  assert(conshdlrs != NULL);
11892 
11893  ncheckconss = 0;
11894 
11895  /* loop over all constraint handler and collect the number of constraints which need to be checked */
11896  for( c = 0; c < nconshdlrs; ++c )
11897  {
11898  assert(conshdlrs[c] != NULL);
11899  ncheckconss += SCIPconshdlrGetNCheckConss(conshdlrs[c]);
11900  }
11901 
11902  return ncheckconss;
11903 
11904 }
11905 
11906 /*
11907  * local subproblem methods
11908  */
11909 
11910 /** adds constraint to the given node (and all of its subnodes), even if it is a global constraint;
11911  * It is sometimes desirable to add the constraint to a more local node (i.e., a node of larger depth) even if
11912  * the constraint is also valid higher in the tree, for example, if one wants to produce a constraint which is
11913  * only active in a small part of the tree although it is valid in a larger part.
11914  * In this case, one should pass the more global node where the constraint is valid as "validnode".
11915  * Note that the same constraint cannot be added twice to the branching tree with different "validnode" parameters.
11916  * If the constraint is valid at the same node as it is inserted (the usual case), one should pass NULL as "validnode".
11917  * If the "validnode" is the root node, it is automatically upgraded into a global constraint, but still only added to
11918  * the given node. If a local constraint is added to the root node, it is added to the global problem instead.
11919  *
11920  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11921  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11922  *
11923  * @pre this method can be called in one of the following stages of the SCIP solving process:
11924  * - \ref SCIP_STAGE_INITPRESOLVE
11925  * - \ref SCIP_STAGE_PRESOLVING
11926  * - \ref SCIP_STAGE_EXITPRESOLVE
11927  * - \ref SCIP_STAGE_SOLVING
11928  */
11930  SCIP* scip, /**< SCIP data structure */
11931  SCIP_NODE* node, /**< node to add constraint to */
11932  SCIP_CONS* cons, /**< constraint to add */
11933  SCIP_NODE* validnode /**< node at which the constraint is valid, or NULL */
11934  )
11935 {
11936  assert(cons != NULL);
11937  assert(node != NULL);
11938 
11939  SCIP_CALL( checkStage(scip, "SCIPaddConsNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11940 
11941  if( validnode != NULL )
11942  {
11943  int validdepth;
11944 
11945  validdepth = SCIPnodeGetDepth(validnode);
11946  if( validdepth > SCIPnodeGetDepth(node) )
11947  {
11948  SCIPerrorMessage("cannot add constraint <%s> valid in depth %d to a node of depth %d\n",
11949  SCIPconsGetName(cons), validdepth, SCIPnodeGetDepth(node));
11950  return SCIP_INVALIDDATA;
11951  }
11952  if( cons->validdepth != -1 && cons->validdepth != validdepth )
11953  {
11954  SCIPerrorMessage("constraint <%s> is already marked to be valid in depth %d - cannot mark it to be valid in depth %d\n",
11955  SCIPconsGetName(cons), cons->validdepth, validdepth);
11956  return SCIP_INVALIDDATA;
11957  }
11958  if( validdepth <= SCIPtreeGetEffectiveRootDepth(scip->tree) )
11959  SCIPconsSetLocal(cons, FALSE);
11960  else
11961  cons->validdepth = validdepth;
11962  }
11963 
11965  {
11966  SCIPconsSetLocal(cons, FALSE);
11967  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
11968  }
11969  else
11970  {
11971  SCIP_CALL( SCIPnodeAddCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
11972  }
11973 
11974  return SCIP_OKAY;
11975 }
11976 
11977 /** adds constraint locally to the current node (and all of its subnodes), even if it is a global constraint;
11978  * It is sometimes desirable to add the constraint to a more local node (i.e., a node of larger depth) even if
11979  * the constraint is also valid higher in the tree, for example, if one wants to produce a constraint which is
11980  * only active in a small part of the tree although it is valid in a larger part.
11981  *
11982  * If the constraint is valid at the same node as it is inserted (the usual case), one should pass NULL as "validnode".
11983  * If the "validnode" is the root node, it is automatically upgraded into a global constraint, but still only added to
11984  * the given node. If a local constraint is added to the root node, it is added to the global problem instead.
11985  *
11986  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11987  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11988  *
11989  * @pre this method can be called in one of the following stages of the SCIP solving process:
11990  * - \ref SCIP_STAGE_INITPRESOLVE
11991  * - \ref SCIP_STAGE_PRESOLVING
11992  * - \ref SCIP_STAGE_EXITPRESOLVE
11993  * - \ref SCIP_STAGE_SOLVING
11994  *
11995  * @note The same constraint cannot be added twice to the branching tree with different "validnode" parameters. This is
11996  * the case due to internal data structures and performance issues. In such a case you should try to realize your
11997  * issue using the method SCIPdisableCons() and SCIPenableCons() and control these via the event system of SCIP.
11998  */
12000  SCIP* scip, /**< SCIP data structure */
12001  SCIP_CONS* cons, /**< constraint to add */
12002  SCIP_NODE* validnode /**< node at which the constraint is valid, or NULL */
12003  )
12004 {
12005  assert(cons != NULL);
12006 
12007  SCIP_CALL( checkStage(scip, "SCIPaddConsLocal", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12008 
12009  SCIP_CALL( SCIPaddConsNode(scip, SCIPtreeGetCurrentNode(scip->tree), cons, validnode) );
12010 
12011  return SCIP_OKAY;
12012 }
12013 
12014 /** disables constraint's separation, enforcing, and propagation capabilities at the given node (and all subnodes);
12015  * if the method is called at the root node, the constraint is globally deleted from the problem;
12016  * the constraint deletion is being remembered at the given node, s.t. after leaving the node's subtree, the constraint
12017  * is automatically enabled again, and after entering the node's subtree, it is automatically disabled;
12018  * this may improve performance because redundant checks on this constraint are avoided, but it consumes memory;
12019  * alternatively, use SCIPdisableCons()
12020  *
12021  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12022  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12023  *
12024  * @pre this method can be called in one of the following stages of the SCIP solving process:
12025  * - \ref SCIP_STAGE_INITPRESOLVE
12026  * - \ref SCIP_STAGE_PRESOLVING
12027  * - \ref SCIP_STAGE_EXITPRESOLVE
12028  * - \ref SCIP_STAGE_SOLVING
12029  */
12031  SCIP* scip, /**< SCIP data structure */
12032  SCIP_NODE* node, /**< node to disable constraint in */
12033  SCIP_CONS* cons /**< constraint to locally delete */
12034  )
12035 {
12036  assert(cons != NULL);
12037 
12038  SCIP_CALL( checkStage(scip, "SCIPdelConsNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12039 
12040  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
12041  * might be wrong
12042  */
12043  if( scip->set->stage == SCIP_STAGE_INITPRESOLVE || scip->set->stage == SCIP_STAGE_EXITPRESOLVE )
12044  assert(SCIPconsIsAdded(cons));
12045 
12047  {
12048  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob) );
12049  }
12050  else
12051  {
12052  SCIP_CALL( SCIPnodeDelCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
12053  }
12054 
12055  return SCIP_OKAY;
12056 }
12057 
12058 /** disables constraint's separation, enforcing, and propagation capabilities at the current node (and all subnodes);
12059  * if the method is called during problem modification or at the root node, the constraint is globally deleted from
12060  * the problem;
12061  * the constraint deletion is being remembered at the current node, s.t. after leaving the current subtree, the
12062  * constraint is automatically enabled again, and after reentering the current node's subtree, it is automatically
12063  * disabled again;
12064  * this may improve performance because redundant checks on this constraint are avoided, but it consumes memory;
12065  * alternatively, use SCIPdisableCons()
12066  *
12067  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12068  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12069  *
12070  * @pre this method can be called in one of the following stages of the SCIP solving process:
12071  * - \ref SCIP_STAGE_PROBLEM
12072  * - \ref SCIP_STAGE_INITPRESOLVE
12073  * - \ref SCIP_STAGE_PRESOLVING
12074  * - \ref SCIP_STAGE_EXITPRESOLVE
12075  * - \ref SCIP_STAGE_SOLVING
12076  *
12077  * @note SCIP stage does not get changed
12078  *
12079  */
12081  SCIP* scip, /**< SCIP data structure */
12082  SCIP_CONS* cons /**< constraint to locally delete */
12083  )
12084 {
12085  SCIP_NODE* node;
12086 
12087  assert(cons != NULL);
12088 
12089  SCIP_CALL( checkStage(scip, "SCIPdelConsLocal", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12090 
12091  switch( scip->set->stage )
12092  {
12093  case SCIP_STAGE_PROBLEM:
12094  assert(cons->addconssetchg == NULL);
12095  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->origprob) );
12096  return SCIP_OKAY;
12097 
12098  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
12099  * might be wrong
12100  */
12103  assert(SCIPconsIsAdded(cons));
12104  /*lint -fallthrough*/
12105 
12106  case SCIP_STAGE_PRESOLVING:
12107  case SCIP_STAGE_SOLVING:
12108  node = SCIPtreeGetCurrentNode(scip->tree);
12109 
12111  {
12112  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob) );
12113  }
12114  else
12115  {
12116  SCIP_CALL( SCIPnodeDelCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
12117  }
12118  return SCIP_OKAY;
12119 
12120  default:
12121  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12122  return SCIP_INVALIDCALL;
12123  } /*lint !e788*/
12124 }
12125 
12126 /** gets estimate of best primal solution w.r.t. original problem contained in current subtree
12127  *
12128  * @return estimate of best primal solution w.r.t. original problem contained in current subtree
12129  *
12130  * @pre this method can be called in one of the following stages of the SCIP solving process:
12131  * - \ref SCIP_STAGE_SOLVING
12132  */
12134  SCIP* scip /**< SCIP data structure */
12135  )
12136 {
12137  SCIP_NODE* node;
12138 
12139  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalOrigEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12140 
12141  node = SCIPtreeGetCurrentNode(scip->tree);
12142  return node != NULL ? SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetEstimate(node)) : SCIP_INVALID;
12143 }
12144 
12145 /** gets estimate of best primal solution w.r.t. transformed problem contained in current subtree
12146  *
12147  * @return estimate of best primal solution w.r.t. transformed problem contained in current subtree
12148  *
12149  * @pre this method can be called in one of the following stages of the SCIP solving process:
12150  * - \ref SCIP_STAGE_SOLVING
12151  */
12153  SCIP* scip /**< SCIP data structure */
12154  )
12155 {
12156  SCIP_NODE* node;
12157 
12158  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalTransEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12159 
12160  node = SCIPtreeGetCurrentNode(scip->tree);
12161 
12162  return node != NULL ? SCIPnodeGetEstimate(node) : SCIP_INVALID;
12163 }
12164 
12165 /** gets dual bound of current node
12166  *
12167  * @return dual bound of current node
12168  *
12169  * @pre this method can be called in one of the following stages of the SCIP solving process:
12170  * - \ref SCIP_STAGE_SOLVING
12171  */
12173  SCIP* scip /**< SCIP data structure */
12174  )
12175 {
12176  SCIP_NODE* node;
12177 
12178  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12179 
12180  node = SCIPtreeGetCurrentNode(scip->tree);
12181  return node != NULL ? SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetLowerbound(node)) : SCIP_INVALID;
12182 }
12183 
12184 /** gets lower bound of current node in transformed problem
12185  *
12186  * @return lower bound of current node in transformed problem
12187  *
12188  * @pre this method can be called in one of the following stages of the SCIP solving process:
12189  * - \ref SCIP_STAGE_SOLVING
12190  */
12192  SCIP* scip /**< SCIP data structure */
12193  )
12194 {
12195  SCIP_NODE* node;
12196 
12197  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12198 
12199  node = SCIPtreeGetCurrentNode(scip->tree);
12200 
12201  return node != NULL ? SCIPnodeGetLowerbound(node) : SCIP_INVALID;
12202 }
12203 
12204 /** gets dual bound of given node
12205  *
12206  * @return dual bound of a given node
12207  *
12208  * @pre this method can be called in one of the following stages of the SCIP solving process:
12209  * - \ref SCIP_STAGE_SOLVING
12210  */
12212  SCIP* scip, /**< SCIP data structure */
12213  SCIP_NODE* node /**< node to get dual bound for */
12214  )
12215 {
12216  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNodeDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12217 
12218  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetLowerbound(node));
12219 }
12220 
12221 /** gets lower bound of given node in transformed problem
12222  *
12223  * @return lower bound of given node in transformed problem
12224  *
12225  * @pre this method can be called in one of the following stages of the SCIP solving process:
12226  * - \ref SCIP_STAGE_SOLVING
12227  */
12229  SCIP* scip, /**< SCIP data structure */
12230  SCIP_NODE* node /**< node to get dual bound for */
12231  )
12232 {
12233  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNodeLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12234 
12235  return SCIPnodeGetLowerbound(node);
12236 }
12237 
12238 /** if given value is tighter (larger for minimization, smaller for maximization) than the current node's dual bound (in
12239  * original problem space), sets the current node's dual bound to the new value
12240  *
12241  * @note the given new bound has to be a dual bound, i.e., it has to be valid for the original problem.
12242  *
12243  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12244  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12245  *
12246  * @pre this method can be called in one of the following stages of the SCIP solving process:
12247  * - \ref SCIP_STAGE_PROBLEM
12248  * - \ref SCIP_STAGE_PRESOLVING
12249  * - \ref SCIP_STAGE_PRESOLVED
12250  * - \ref SCIP_STAGE_SOLVING
12251  */
12253  SCIP* scip, /**< SCIP data structure */
12254  SCIP_Real newbound /**< new dual bound for the node (if it's tighter than the old one) */
12255  )
12256 {
12257  SCIP_CALL( checkStage(scip, "SCIPupdateLocalDualbound", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12258 
12259  switch( scip->set->stage )
12260  {
12261  case SCIP_STAGE_PROBLEM:
12262  /* since no root node, for which we could update the dual bound, has been create yet, update the dual bound stored in
12263  * the problem data
12264  */
12265  SCIPprobUpdateDualbound(scip->origprob, newbound);
12266  break;
12267 
12268  case SCIP_STAGE_PRESOLVING:
12269  case SCIP_STAGE_PRESOLVED:
12270  /* since no root node, for which we could update the dual bound, has been create yet, update the dual bound stored in
12271  * the problem data
12272  */
12273  SCIPprobUpdateDualbound(scip->transprob, SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, newbound));
12274  break;
12275 
12276  case SCIP_STAGE_SOLVING:
12278  break;
12279 
12280  default:
12281  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12282  SCIPABORT();
12283  return SCIP_INVALIDCALL; /*lint !e527*/
12284  } /*lint !e788*/
12285 
12286  return SCIP_OKAY;
12287 }
12288 
12289 /** if given value is larger than the current node's lower bound (in transformed problem), sets the current node's
12290  * lower bound to the new value
12291  *
12292  * @note the given new bound has to be a lower bound, i.e., it has to be valid for the transformed problem.
12293  *
12294  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12295  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12296  *
12297  * @pre this method can be called in one of the following stages of the SCIP solving process:
12298  * - \ref SCIP_STAGE_PRESOLVING
12299  * - \ref SCIP_STAGE_PRESOLVED
12300  * - \ref SCIP_STAGE_SOLVING
12301  */
12303  SCIP* scip, /**< SCIP data structure */
12304  SCIP_Real newbound /**< new lower bound for the node (if it's larger than the old one) */
12305  )
12306 {
12307  SCIP_CALL( checkStage(scip, "SCIPupdateLocalLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12308 
12309  switch( scip->set->stage )
12310  {
12311  case SCIP_STAGE_PRESOLVING:
12312  case SCIP_STAGE_PRESOLVED:
12313  /* since no root node, for which we could update the lower bound, has been created yet, update the dual bound stored
12314  * in the problem data
12315  */
12316  SCIPprobUpdateDualbound(scip->transprob, SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, newbound));
12317  break;
12318 
12319  case SCIP_STAGE_SOLVING:
12321  break;
12322 
12323  default:
12324  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12325  SCIPABORT();
12326  return SCIP_INVALIDCALL; /*lint !e527*/
12327  } /*lint !e788*/
12328 
12329  return SCIP_OKAY;
12330 }
12331 
12332 /** if given value is tighter (larger for minimization, smaller for maximization) than the node's dual bound,
12333  * sets the node's dual bound to the new value
12334  *
12335  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12336  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12337  *
12338  * @pre this method can be called in one of the following stages of the SCIP solving process:
12339  * - \ref SCIP_STAGE_SOLVING
12340  */
12342  SCIP* scip, /**< SCIP data structure */
12343  SCIP_NODE* node, /**< node to update dual bound for */
12344  SCIP_Real newbound /**< new dual bound for the node (if it's tighter than the old one) */
12345  )
12346 {
12347  SCIP_CALL( checkStage(scip, "SCIPupdateNodeDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12348 
12349  SCIP_CALL( SCIPupdateNodeLowerbound(scip, node, SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, newbound)) );
12350 
12351  return SCIP_OKAY;
12352 }
12353 
12354 /** if given value is larger than the node's lower bound (in transformed problem), sets the node's lower bound
12355  * to the new value
12356  *
12357  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12358  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12359  *
12360  * @pre this method can be called in one of the following stages of the SCIP solving process:
12361  * - \ref SCIP_STAGE_SOLVING
12362  */
12364  SCIP* scip, /**< SCIP data structure */
12365  SCIP_NODE* node, /**< node to update lower bound for */
12366  SCIP_Real newbound /**< new lower bound for the node (if it's larger than the old one) */
12367  )
12368 {
12369  SCIP_CALL( checkStage(scip, "SCIPupdateNodeLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12370 
12371  SCIPnodeUpdateLowerbound(node, scip->stat, scip->set, scip->tree, scip->transprob, scip->origprob, newbound);
12372 
12373  /* if lowerbound exceeds the cutoffbound the node will be marked to be cutoff
12374  *
12375  * If the node is an inner node (,not a child node,) we need to cutoff the node manually if we exceed the
12376  * cutoffbound. This is only relevant if a user updates the lower bound; in the main solving process of SCIP the
12377  * lowerbound is only changed before branching and the given node is always a child node. Therefore, we only check
12378  * for a cutoff here in the user function instead of in SCIPnodeUpdateLowerbound().
12379  */
12380  if( SCIPisGE(scip, newbound, scip->primal->cutoffbound) )
12381  {
12382  SCIP_CALL( SCIPnodeCutoff(node, scip->set, scip->stat, scip->tree, scip->reopt, scip->lp, scip->mem->probmem) );
12383  }
12384 
12385  return SCIP_OKAY;
12386 }
12387 
12388 /** change the node selection priority of the given child
12389  *
12390  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12391  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12392  *
12393  * @pre this method can be called in one of the following stages of the SCIP solving process:
12394  * - \ref SCIP_STAGE_SOLVING
12395  */
12397  SCIP* scip, /**< SCIP data structure */
12398  SCIP_NODE* child, /**< child to update the node selection priority */
12399  SCIP_Real priority /**< node selection priority value */
12400  )
12401 {
12402  SCIP_CALL( checkStage(scip, "SCIPchgChildPrio", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12403 
12404  if( SCIPnodeGetType(child) != SCIP_NODETYPE_CHILD )
12405  return SCIP_INVALIDDATA;
12406 
12407  SCIPchildChgNodeselPrio(scip->tree, child, priority);
12408 
12409  return SCIP_OKAY;
12410 }
12411 
12412 
12413 
12414 /*
12415  * solve methods
12416  */
12417 
12418 /** checks solution for feasibility in original problem without adding it to the solution store */
12419 static
12421  SCIP* scip, /**< SCIP data structure */
12422  SCIP_SOL* sol, /**< primal CIP solution */
12423  SCIP_Bool* feasible, /**< stores whether given solution is feasible */
12424  SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
12425  SCIP_Bool completely, /**< Should all violations be checked? */
12426  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
12427  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
12428  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
12429  SCIP_Bool checkmodifiable /**< have modifiable constraint to be checked? */
12430  )
12431 {
12432  SCIP_RESULT result;
12433  int v;
12434  int c;
12435  int h;
12436 
12437  assert(scip != NULL);
12438  assert(sol != NULL);
12439  assert(feasible != NULL);
12440 
12441  SCIP_CALL( checkStage(scip, "checkSolOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12442 
12443  *feasible = TRUE;
12444 
12445  /* check bounds */
12446  if( checkbounds )
12447  {
12448  for( v = 0; v < scip->origprob->nvars && (*feasible || printreason); ++v )
12449  {
12450  SCIP_VAR* var;
12451  SCIP_Real solval;
12452  SCIP_Real lb;
12453  SCIP_Real ub;
12454 
12455  var = scip->origprob->vars[v];
12456  solval = SCIPsolGetVal(sol, scip->set, scip->stat, var);
12457  lb = SCIPvarGetLbOriginal(var);
12458  ub = SCIPvarGetUbOriginal(var);
12459  if( SCIPsetIsFeasLT(scip->set, solval, lb) || SCIPsetIsFeasGT(scip->set, solval, ub) )
12460  {
12461  *feasible = FALSE;
12462 
12463  if( printreason )
12464  {
12465  SCIPmessagePrintInfo(scip->messagehdlr, "solution violates original bounds of variable <%s> [%g,%g] solution value <%g>\n",
12466  SCIPvarGetName(var), lb, ub, solval);
12467  }
12468 
12469  if( !completely )
12470  return SCIP_OKAY;
12471  }
12472  }
12473  }
12474 
12475  /* check original constraints
12476  *
12477  * in general modifiable constraints can not be checked, because the variables to fulfill them might be missing in
12478  * the original problem; however, if the solution comes from a heuristic during presolving modifiable constraints
12479  * have to be checked;
12480  */
12481  for( c = 0; c < scip->origprob->nconss; ++c )
12482  {
12483  if( SCIPconsIsChecked(scip->origprob->conss[c]) && (checkmodifiable || !SCIPconsIsModifiable(scip->origprob->conss[c])) )
12484  {
12485  /* check solution */
12486  SCIP_CALL( SCIPconsCheck(scip->origprob->conss[c], scip->set, sol,
12487  checkintegrality, checklprows, printreason, &result) );
12488 
12489  if( result != SCIP_FEASIBLE )
12490  {
12491  *feasible = FALSE;
12492  if( !completely )
12493  return SCIP_OKAY;
12494  }
12495  }
12496  }
12497 
12498  /* call constraint handlers that don't need constraints */
12499  for( h = 0; h < scip->set->nconshdlrs; ++h )
12500  {
12501  if( !SCIPconshdlrNeedsCons(scip->set->conshdlrs[h]) )
12502  {
12503  SCIP_CALL( SCIPconshdlrCheck(scip->set->conshdlrs[h], scip->mem->probmem, scip->set, scip->stat, sol,
12504  checkintegrality, checklprows, printreason, &result) );
12505  if( result != SCIP_FEASIBLE )
12506  {
12507  *feasible = FALSE;
12508  if( !completely)
12509  return SCIP_OKAY;
12510  }
12511  }
12512  }
12513 
12514  return SCIP_OKAY;
12515 }
12516 
12517 /** calculates number of nonzeros in problem */
12518 static
12520  SCIP* scip, /**< SCIP data structure */
12521  SCIP_Longint* nchecknonzeros, /**< pointer to store number of non-zeros in all check constraints */
12522  SCIP_Longint* nactivenonzeros, /**< pointer to store number of non-zeros in all active constraints */
12523  SCIP_Bool* approxchecknonzeros,/**< pointer to store if the number of non-zeros in all check constraints
12524  * is only a lowerbound
12525  */
12526  SCIP_Bool* approxactivenonzeros/**< pointer to store if the number of non-zeros in all active constraints
12527  * is only a lowerbound
12528  */
12529  )
12530 {
12531  SCIP_CONS** conss;
12532  SCIP_Bool success;
12533  SCIP_Bool ischeck;
12534  int nconss;
12535  int nvars;
12536  int c;
12537  int h;
12538 
12539  *nchecknonzeros = 0LL;
12540  *nactivenonzeros = 0LL;
12541  *approxchecknonzeros = FALSE;
12542  *approxactivenonzeros = FALSE;
12543 
12544  /* computes number of non-zeros over all active constraints */
12545  for( h = scip->set->nconshdlrs - 1; h >= 0; --h )
12546  {
12547  nconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
12548 
12549  if( nconss > 0 )
12550  {
12551  conss = SCIPconshdlrGetConss(scip->set->conshdlrs[h]);
12552 
12553  /* calculate all active constraints */
12554  for( c = nconss - 1; c >= 0; --c )
12555  {
12556  SCIP_CALL( SCIPconsGetNVars(conss[c], scip->set, &nvars, &success) );
12557  ischeck = SCIPconsIsChecked(conss[c]);
12558 
12559  if( !success )
12560  {
12561  *approxactivenonzeros = TRUE;
12562  if( ischeck )
12563  *approxchecknonzeros = TRUE;
12564  }
12565  else
12566  {
12567  *nactivenonzeros += nvars;
12568  if( ischeck )
12569  *nchecknonzeros += nvars;
12570  }
12571  }
12572  }
12573 
12574  /* add nonzeros on inactive check constraints */
12575  nconss = SCIPconshdlrGetNCheckConss(scip->set->conshdlrs[h]);
12576  if( nconss > 0 )
12577  {
12578  conss = SCIPconshdlrGetCheckConss(scip->set->conshdlrs[h]);
12579 
12580  for( c = nconss - 1; c >= 0; --c )
12581  {
12582  if( !SCIPconsIsActive(conss[c]) )
12583  {
12584  SCIP_CALL( SCIPconsGetNVars(conss[c], scip->set, &nvars, &success) );
12585 
12586  if( !success )
12587  *approxchecknonzeros = TRUE;
12588  else
12589  *nchecknonzeros += nvars;
12590  }
12591  }
12592  }
12593  }
12594 
12595  return SCIP_OKAY;
12596 }
12597 
12598 
12599 /** initializes solving data structures and transforms problem
12600  *
12601  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12602  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12603  *
12604  * @pre This method can be called if @p scip is in one of the following stages:
12605  * - \ref SCIP_STAGE_PROBLEM
12606  * - \ref SCIP_STAGE_TRANSFORMED
12607  * - \ref SCIP_STAGE_INITPRESOLVE
12608  * - \ref SCIP_STAGE_PRESOLVING
12609  * - \ref SCIP_STAGE_EXITPRESOLVE
12610  * - \ref SCIP_STAGE_PRESOLVED
12611  * - \ref SCIP_STAGE_INITSOLVE
12612  * - \ref SCIP_STAGE_SOLVING
12613  * - \ref SCIP_STAGE_SOLVED
12614  * - \ref SCIP_STAGE_EXITSOLVE
12615  * - \ref SCIP_STAGE_FREETRANS
12616  * - \ref SCIP_STAGE_FREE
12617  *
12618  * @post When calling this method in the \ref SCIP_STAGE_PROBLEM stage, the \SCIP stage is changed to \ref
12619  * SCIP_STAGE_TRANSFORMED; otherwise, the stage is not changed
12620  *
12621  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
12622  */
12624  SCIP* scip /**< SCIP data structure */
12625  )
12626 {
12627  SCIP_Longint oldnsolsfound;
12628  int nfeassols;
12629  int ncandsols;
12630  int h;
12631  int s;
12632 
12633  SCIP_CALL( checkStage(scip, "SCIPtransformProb", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
12634 
12635  /* check, if the problem was already transformed */
12636  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
12637  return SCIP_OKAY;
12638 
12639  assert(scip->stat->status == SCIP_STATUS_UNKNOWN);
12640 
12641  /* check, if a node selector exists */
12642  if( SCIPsetGetNodesel(scip->set, scip->stat) == NULL )
12643  {
12644  SCIPerrorMessage("no node selector available\n");
12645  return SCIP_PLUGINNOTFOUND;
12646  }
12647 
12648  /* call garbage collector on original problem and parameter settings memory spaces */
12651 
12652  /* remember number of constraints */
12654 
12655  /* switch stage to TRANSFORMING */
12657 
12658  /* mark statistics before solving */
12659  SCIPstatMark(scip->stat);
12660 
12661  /* init solve data structures */
12665  SCIP_CALL( SCIPlpCreate(&scip->lp, scip->set, scip->messagehdlr, scip->stat, SCIPprobGetName(scip->origprob)) );
12667  SCIP_CALL( SCIPprimalCreate(&scip->primal) );
12668  SCIP_CALL( SCIPtreeCreate(&scip->tree, scip->mem->probmem, scip->set, SCIPsetGetNodesel(scip->set, scip->stat)) );
12669  SCIP_CALL( SCIPconflictCreate(&scip->conflict, scip->mem->probmem, scip->set) );
12670  SCIP_CALL( SCIPcliquetableCreate(&scip->cliquetable, scip->set, scip->mem->probmem) );
12671 
12672  /* copy problem in solve memory */
12673  SCIP_CALL( SCIPprobTransform(scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree,
12674  scip->reopt, scip->lp, scip->branchcand, scip->eventfilter, scip->eventqueue, &scip->transprob) );
12675 
12676  /* switch stage to TRANSFORMED */
12677  scip->set->stage = SCIP_STAGE_TRANSFORMED;
12678 
12679  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
12680  * cutoff bound if primal solution is already known
12681  */
12682  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
12683  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
12684 
12685  /* if possible, scale objective function such that it becomes integral with gcd 1 */
12686  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
12687  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
12688 
12689  /* check solution of solution candidate storage */
12690  nfeassols = 0;
12691  ncandsols = scip->origprimal->nsols;
12692  oldnsolsfound = 0;
12693 
12694  /* set varlocks to ensure that no dual reduction can be performed */
12695  if( scip->set->reopt_enable || !scip->set->misc_allowdualreds )
12696  {
12697  int v;
12698 
12699  for( v = 0; v < scip->origprob->nvars; v++ )
12700  {
12701  SCIP_VAR* transvar;
12702  transvar = SCIPvarGetTransVar(scip->origprob->vars[v]);
12703  SCIP_CALL( SCIPcaptureVar(scip, transvar) );
12704  SCIP_CALL( SCIPaddVarLocks(scip, transvar, 1, 1) );
12705  }
12706  }
12707 
12708  if( !scip->set->reopt_enable )
12709  {
12710  oldnsolsfound = scip->primal->nsolsfound;
12711  for( s = scip->origprimal->nsols - 1; s >= 0; --s )
12712  {
12713  SCIP_Bool feasible;
12714  SCIP_SOL* sol;
12715 
12716  sol = scip->origprimal->sols[s];
12717 
12718  /* recompute objective function, since the objective might have changed in the meantime */
12719  SCIPsolRecomputeObj(sol, scip->set, scip->stat, scip->origprob);
12720 
12721  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
12722  * including modifiable constraints
12723  */
12724  SCIP_CALL( checkSolOrig(scip, sol, &feasible,
12726  FALSE, TRUE, TRUE, TRUE, TRUE) );
12727 
12728  if( feasible )
12729  {
12730  SCIP_Real abssolobj;
12731 
12732  abssolobj = REALABS(SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
12733 
12734  /* we do not want to add solutions with objective value +infinity */
12735  if( !SCIPisInfinity(scip, abssolobj) )
12736  {
12737  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
12738  SCIP_Bool stored;
12739 
12740  /* add primal solution to solution storage by copying it */
12741  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob,
12742  scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol, &stored) );
12743 
12744  if( stored )
12745  {
12746  nfeassols++;
12747 
12748  if( bestsol != SCIPgetBestSol(scip) )
12749  SCIPstoreSolutionGap(scip);
12750  }
12751  }
12752  }
12753 
12754  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->origprimal) );
12755  scip->origprimal->nsols--;
12756  }
12757  }
12758 
12759  assert(scip->origprimal->nsols == 0);
12760 
12761  scip->stat->nexternalsolsfound += scip->primal->nsolsfound - oldnsolsfound;
12762 
12763  if( nfeassols > 0 )
12764  {
12766  "%d/%d feasible solution%s given by solution candidate storage, new primal bound %.6e\n\n",
12767  nfeassols, ncandsols, (nfeassols > 1 ? "s" : ""), SCIPgetSolOrigObj(scip, SCIPgetBestSol(scip)));
12768  }
12769  else if( ncandsols > 0 && !scip->set->reopt_enable )
12770  {
12772  "all %d solutions given by solution candidate storage are infeasible\n\n", ncandsols);
12773  }
12774 
12775  /* update upper bound and cutoff bound due to objective limit in primal data */
12776  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
12777  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
12778 
12779  /* print transformed problem statistics */
12781  "transformed problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
12782  scip->transprob->nvars, scip->transprob->nbinvars, scip->transprob->nintvars, scip->transprob->nimplvars,
12783  scip->transprob->ncontvars, scip->transprob->nconss);
12784 
12785  for( h = 0; h < scip->set->nconshdlrs; ++h )
12786  {
12787  int nactiveconss;
12788 
12789  nactiveconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
12790  if( nactiveconss > 0 )
12791  {
12793  "%7d constraints of type <%s>\n", nactiveconss, SCIPconshdlrGetName(scip->set->conshdlrs[h]));
12794  }
12795  }
12797 
12798  if( scip->set->disp_verblevel == SCIP_VERBLEVEL_FULL )
12799  {
12800  SCIP_Real maxnonzeros = ((SCIP_Real)SCIPgetNConss(scip)) * SCIPgetNVars(scip);
12801  SCIP_Longint nchecknonzeros;
12802  SCIP_Longint nactivenonzeros;
12803  SCIP_Bool approxchecknonzeros;
12804  SCIP_Bool approxactivenonzeros;
12805 
12806  /* determine number of non-zeros */
12807  SCIP_CALL( calcNonZeros(scip, &nchecknonzeros, &nactivenonzeros, &approxchecknonzeros, &approxactivenonzeros) );
12808 
12810  "original problem has %s%" SCIP_LONGINT_FORMAT " active (%g%%) nonzeros and %s%" SCIP_LONGINT_FORMAT " (%g%%) check nonzeros\n",
12811  approxactivenonzeros ? "more than " : "", nactivenonzeros, nactivenonzeros/maxnonzeros * 100,
12812  approxchecknonzeros ? "more than " : "", nchecknonzeros, nchecknonzeros/maxnonzeros * 100);
12814  }
12815 
12816  /* call initialization methods of plugins */
12817  SCIP_CALL( SCIPsetInitPlugins(scip->set, scip->mem->probmem, scip->stat) );
12818 
12819  /* in case the permutation seed is different to -1, permute the transformed problem */
12820  if( scip->set->misc_permutationseed > -1 )
12821  {
12822  SCIP_Bool permuteconss;
12823  SCIP_Bool permutevars;
12824  int permutationseed;
12825 
12826  permuteconss = scip->set->misc_permuteconss;
12827  permutevars = scip->set->misc_permutevars;
12828  permutationseed = scip->set->misc_permutationseed;
12829 
12830  SCIP_CALL( SCIPpermuteProb(scip, (unsigned int)permutationseed, permuteconss, permutevars, permutevars, permutevars, permutevars) );
12831  }
12832 
12833  if( scip->set->misc_estimexternmem )
12834  {
12835  if ( ! SCIPisInfinity(scip, scip->set->limit_memory) )
12836  {
12837  SCIP_Longint memused = SCIPgetMemUsed(scip);
12838 
12839  /* if the memory limit is set, we take 1% as the minimum external memory storage */
12840  scip->set->mem_externestim = MAX(memused, (SCIP_Longint) (0.01 * scip->set->limit_memory * 1048576.0));
12841  }
12842  else
12843  scip->set->mem_externestim = SCIPgetMemUsed(scip);
12844  SCIPdebugMessage("external memory usage estimated to %" SCIP_LONGINT_FORMAT " byte\n", scip->set->mem_externestim);
12845  }
12846 
12847  return SCIP_OKAY;
12848 }
12849 
12850 /** initializes presolving */
12851 static
12853  SCIP* scip /**< SCIP data structure */
12854  )
12855 {
12856  assert(scip != NULL);
12857  assert(scip->mem != NULL);
12858  assert(scip->set != NULL);
12859  assert(scip->stat != NULL);
12860  assert(scip->transprob != NULL);
12861  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
12862 
12863  /* retransform all existing solutions to original problem space, because the transformed problem space may
12864  * get modified in presolving and the solutions may become invalid for the transformed problem
12865  */
12866  SCIP_CALL( SCIPprimalRetransformSolutions(scip->primal, scip->set, scip->stat, scip->origprob, scip->transprob) );
12867 
12868  /* reset statistics for presolving and current branch and bound run */
12870 
12871  /* increase number of branch and bound runs */
12872  scip->stat->nruns++;
12873 
12874  /* remember problem size of previous run */
12875  scip->stat->prevrunnvars = scip->transprob->nvars;
12876 
12877  /* switch stage to INITPRESOLVE */
12879 
12880  /* create temporary presolving root node */
12881  SCIP_CALL( SCIPtreeCreatePresolvingRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr,
12882  scip->stat, scip->transprob, scip->origprob, scip->primal, scip->lp, scip->branchcand, scip->conflict,
12883  scip->eventfilter, scip->eventqueue, scip->cliquetable) );
12884 
12885  /* inform plugins that the presolving is abound to begin */
12886  SCIP_CALL( SCIPsetInitprePlugins(scip->set, scip->mem->probmem, scip->stat) );
12887  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
12888  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
12889 
12890  /* delete the variables from the problems that were marked to be deleted */
12891  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp, scip->branchcand) );
12892 
12893  /* switch stage to PRESOLVING */
12894  scip->set->stage = SCIP_STAGE_PRESOLVING;
12895 
12896  return SCIP_OKAY;
12897 }
12898 
12899 /** deinitializes presolving */
12900 static
12902  SCIP* scip, /**< SCIP data structure */
12903  SCIP_Bool solved, /**< is problem already solved? */
12904  SCIP_Bool* infeasible /**< pointer to store if the clique clean up detects an infeasibility */
12905  )
12906 {
12907  SCIP_VAR** vars;
12908  int nvars;
12909  int v;
12910 #ifndef NDEBUG
12911  size_t nusedbuffers;
12912  size_t nusedcleanbuffers;
12913 #endif
12914 
12915  assert(scip != NULL);
12916  assert(scip->mem != NULL);
12917  assert(scip->set != NULL);
12918  assert(scip->stat != NULL);
12919  assert(scip->transprob != NULL);
12920  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
12921  assert(infeasible != NULL);
12922 
12923  /* switch stage to EXITPRESOLVE */
12925 
12926  if( !solved )
12927  {
12928  /* flatten all variables */
12929  vars = SCIPgetFixedVars(scip);
12930  nvars = SCIPgetNFixedVars(scip);
12931  assert(nvars == 0 || vars != NULL);
12932 
12933  for( v = nvars - 1; v >= 0; --v )
12934  {
12935  SCIP_VAR* var;
12936 #ifndef NDEBUG
12937  SCIP_VAR** multvars;
12938  int i;
12939 #endif
12940  var = vars[v]; /*lint !e613*/
12941  assert(var != NULL);
12942 
12944  {
12945  /* flattens aggregation graph of multi-aggregated variable in order to avoid exponential recursion later-on */
12946  SCIP_CALL( SCIPvarFlattenAggregationGraph(var, scip->mem->probmem, scip->set) );
12947 
12948 #ifndef NDEBUG
12949  multvars = SCIPvarGetMultaggrVars(var);
12950  for( i = SCIPvarGetMultaggrNVars(var) - 1; i >= 0; --i)
12951  assert(SCIPvarGetStatus(multvars[i]) != SCIP_VARSTATUS_MULTAGGR);
12952 #endif
12953  }
12954  }
12955  }
12956 
12957  /* exitPresolve() might be called during the reading process of a file reader;
12958  * hence the number of used buffers does not need to be zero, however, it should not
12959  * change by calling SCIPsetExitprePlugins() or SCIPprobExitPresolve()
12960  */
12961 #ifndef NDEBUG
12962  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
12963  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
12964 #endif
12965 
12966  /* inform plugins that the presolving is finished, and perform final modifications */
12967  SCIP_CALL( SCIPsetExitprePlugins(scip->set, scip->mem->probmem, scip->stat) );
12968  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
12969  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
12970 
12971  /* remove empty and single variable cliques from the clique table, and convert all two variable cliques
12972  * into implications
12973  * delete the variables from the problems that were marked to be deleted
12974  */
12975  if( !solved )
12976  {
12977  int nlocalbdchgs = 0;
12978 
12979  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
12980  scip->cliquetable, scip->lp, scip->branchcand) );
12981 
12982  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
12983  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
12984  infeasible) );
12985 
12987  "clique table cleanup detected %d bound changes%s\n", nlocalbdchgs, *infeasible ? " and infeasibility" : "");
12988  }
12989 
12990  /* exit presolving */
12991  SCIP_CALL( SCIPprobExitPresolve(scip->transprob, scip->set) );
12992  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
12993  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
12994 
12995  if( !solved )
12996  {
12997  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
12998  * cutoff bound if primal solution is already known
12999  */
13000  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
13001  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
13002 
13003  /* if possible, scale objective function such that it becomes integral with gcd 1 */
13004  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
13005  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
13006 
13007  scip->stat->lastlowerbound = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
13008 
13009  /* we need to update the primal dual integral here to update the last{upper/dual}bound values after a restart */
13010  if( scip->set->misc_calcintegral )
13011  {
13013  }
13014  }
13015 
13016  /* free temporary presolving root node */
13017  SCIP_CALL( SCIPtreeFreePresolvingRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr,
13018  scip->stat, scip->transprob, scip->origprob, scip->primal, scip->lp, scip->branchcand, scip->conflict,
13019  scip->eventfilter, scip->eventqueue, scip->cliquetable) );
13020 
13021  /* switch stage to PRESOLVED */
13022  scip->set->stage = SCIP_STAGE_PRESOLVED;
13023 
13024  return SCIP_OKAY;
13025 }
13026 
13027 /** applies one round of presolving with the given presolving timing
13028  *
13029  * This method will always be called with presoltiming fast first. It iterates over all presolvers, propagators, and
13030  * constraint handlers and calls their presolving callbacks with timing fast. If enough reductions are found, it
13031  * returns and the next presolving round will be started (again with timing fast). If the fast presolving does not
13032  * find enough reductions, this methods calls itself recursively with presoltiming medium. Again, it calls the
13033  * presolving callbacks of all presolvers, propagators, and constraint handlers with timing medium. If enough
13034  * reductions are found, it returns and the next presolving round will be started (with timing fast). Otherwise, it is
13035  * called recursively with presoltiming exhaustive. In exhaustive presolving, presolvers, propagators, and constraint
13036  * handlers are called w.r.t. their priority, but this time, we stop as soon as enough reductions were found and do not
13037  * necessarily call all presolving methods. If we stop, we return and another presolving round is started with timing
13038  * fast.
13039  *
13040  * @todo check if we want to do the following (currently disabled):
13041  * In order to avoid calling the same expensive presolving methods again and again (which is possibly ineffective
13042  * for the current instance), we continue the loop for exhaustive presolving where we stopped it the last time. The
13043  * {presol/prop/cons}start pointers are used to this end: they provide the plugins to start the loop with in the
13044  * current presolving round (if we reach exhaustive presolving), and are updated in this case to the next ones to be
13045  * called in the next round. In case we reach the end of the loop in exhaustive presolving, we call the method again
13046  * with exhaustive timing, now starting with the first presolving steps in the loop until we reach the ones we started
13047  * the last call with. This way, we won't stop until all exhaustive presolvers were called without finding enough
13048  * reductions (in sum).
13049  */
13050 static
13052  SCIP* scip, /**< SCIP data structure */
13053  SCIP_PRESOLTIMING* timing, /**< pointer to current presolving timing */
13054  SCIP_Bool* unbounded, /**< pointer to store whether presolving detected unboundedness */
13055  SCIP_Bool* infeasible, /**< pointer to store whether presolving detected infeasibility */
13056  SCIP_Bool lastround, /**< is this the last presolving round due to a presolving round limit? */
13057  int* presolstart, /**< pointer to get the presolver to start exhaustive presolving with in
13058  * the current round and store the one to start with in the next round */
13059  int presolend, /**< last presolver to treat in exhaustive presolving */
13060  int* propstart, /**< pointer to get the propagator to start exhaustive presolving with in
13061  * the current round and store the one to start with in the next round */
13062  int propend, /**< last propagator to treat in exhaustive presolving */
13063  int* consstart, /**< pointer to get the constraint handler to start exhaustive presolving with in
13064  * the current round and store the one to start with in the next round */
13065  int consend /**< last constraint handler to treat in exhaustive presolving */
13066  )
13067 {
13068  SCIP_RESULT result;
13069  SCIP_EVENT event;
13070  SCIP_Bool aborted;
13071  SCIP_Bool lastranpresol;
13072 #if 0
13073  int oldpresolstart = 0;
13074  int oldpropstart = 0;
13075  int oldconsstart = 0;
13076 #endif
13077  int priopresol;
13078  int prioprop;
13079  int i;
13080  int j;
13081  int k;
13082 
13083  assert(scip != NULL);
13084  assert(scip->set != NULL);
13085  assert(unbounded != NULL);
13086  assert(infeasible != NULL);
13087  assert(presolstart != NULL);
13088  assert(propstart != NULL);
13089  assert(consstart != NULL);
13090 
13091  assert((presolend == scip->set->npresols && propend == scip->set->nprops && consend == scip->set->nconshdlrs)
13092  || (*presolstart == 0 && *propstart == 0 && *consstart == 0));
13093 
13094  *unbounded = FALSE;
13095  *infeasible = FALSE;
13096  aborted = FALSE;
13097  lastranpresol = FALSE;
13098 
13099  if( *timing == SCIP_PRESOLTIMING_EXHAUSTIVE )
13100  {
13101  /* In exhaustive presolving, we continue the loop where we stopped last time to avoid calling the same
13102  * (possibly ineffective) presolving step again and again. If we reach the end of the arrays of presolvers,
13103  * propagators, and constraint handlers without having made enough reductions, we start again from the beginning
13104  */
13105  i = *presolstart;
13106  j = *propstart;
13107  k = *consstart;
13108 #if 0
13109  oldpresolstart = i;
13110  oldpropstart = j;
13111  oldconsstart = k;
13112 #endif
13113  if( i >= presolend && j >= propend && k >= consend )
13114  return SCIP_OKAY;
13115 
13116  if( i == 0 && j == 0 && k == 0 )
13117  ++(scip->stat->npresolroundsext);
13118  }
13119  else
13120  {
13121  /* in fast and medium presolving, we always iterate over all presolvers, propagators, and constraint handlers */
13122  assert(presolend == scip->set->npresols);
13123  assert(propend == scip->set->nprops);
13124  assert(consend == scip->set->nconshdlrs);
13125 
13126  i = 0;
13127  j = 0;
13128  k = 0;
13129 
13130  if( *timing == SCIP_PRESOLTIMING_FAST )
13131  ++(scip->stat->npresolroundsfast);
13132  else
13133  ++(scip->stat->npresolroundsmed);
13134  }
13135 
13136  SCIPdebugMessage("starting presolving round %d (%d/%d/%d), timing = %u\n",
13138  scip->stat->npresolroundsext, *timing);
13139 
13140  /* call included presolvers with nonnegative priority */
13141  while( !(*unbounded) && !(*infeasible) && !aborted && (i < presolend || j < propend) )
13142  {
13143  if( i < presolend )
13144  priopresol = SCIPpresolGetPriority(scip->set->presols[i]);
13145  else
13146  priopresol = -1;
13147 
13148  if( j < propend )
13149  prioprop = SCIPpropGetPresolPriority(scip->set->props[j]);
13150  else
13151  prioprop = -1;
13152 
13153  /* call next propagator */
13154  if( prioprop >= priopresol )
13155  {
13156  /* only presolving methods which have non-negative priority will be called before constraint handlers */
13157  if( prioprop < 0 )
13158  break;
13159 
13160  SCIPdebugMessage("executing presolving of propagator <%s>\n", SCIPpropGetName(scip->set->props[j]));
13161  SCIP_CALL( SCIPpropPresol(scip->set->props[j], scip->set, *timing, scip->stat->npresolrounds,
13163  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
13164  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
13165  &scip->stat->npresolchgsides, &result) );
13166  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
13167  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
13168 
13169  lastranpresol = FALSE;
13170  ++j;
13171  }
13172  /* call next presolver */
13173  else
13174  {
13175  /* only presolving methods which have non-negative priority will be called before constraint handlers */
13176  if( priopresol < 0 )
13177  break;
13178 
13179  SCIPdebugMessage("executing presolver <%s>\n", SCIPpresolGetName(scip->set->presols[i]));
13180  SCIP_CALL( SCIPpresolExec(scip->set->presols[i], scip->set, *timing, scip->stat->npresolrounds,
13182  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
13183  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
13184  &scip->stat->npresolchgsides, &result) );
13185  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
13186  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
13187 
13188  lastranpresol = TRUE;
13189  ++i;
13190  }
13191 
13192  if( result == SCIP_CUTOFF )
13193  {
13194  *infeasible = TRUE;
13195 
13196  if( lastranpresol )
13198  "presolver <%s> detected infeasibility\n", SCIPpresolGetName(scip->set->presols[i-1]));
13199  else
13201  "propagator <%s> detected infeasibility\n", SCIPpropGetName(scip->set->props[j-1]));
13202  }
13203  else if( result == SCIP_UNBOUNDED )
13204  {
13205  *unbounded = TRUE;
13206 
13207  if( lastranpresol )
13209  "presolver <%s> detected unboundedness (or infeasibility)\n", SCIPpresolGetName(scip->set->presols[i-1]));
13210  else
13212  "propagator <%s> detected unboundedness (or infeasibility)\n", SCIPpropGetName(scip->set->props[j-1]));
13213  }
13214 
13215  /* delete the variables from the problems that were marked to be deleted */
13216  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
13217  scip->branchcand) );
13218 
13219  SCIPdebugMessage("presolving callback returned result <%d>\n", result);
13220 
13221  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
13222  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
13223  {
13224  assert(*consstart == 0);
13225 
13226  if( lastranpresol )
13227  {
13228  *presolstart = i + 1;
13229  *propstart = j;
13230  }
13231  else
13232  {
13233  *presolstart = i;
13234  *propstart = j + 1;
13235  }
13236  aborted = TRUE;
13237 
13238  break;
13239  }
13240  }
13241 
13242  /* call presolve methods of constraint handlers */
13243  while( k < consend && !(*unbounded) && !(*infeasible) && !aborted )
13244  {
13245  SCIPdebugMessage("executing presolve method of constraint handler <%s>\n",
13246  SCIPconshdlrGetName(scip->set->conshdlrs[k]));
13247  SCIP_CALL( SCIPconshdlrPresolve(scip->set->conshdlrs[k], scip->mem->probmem, scip->set, scip->stat,
13248  *timing, scip->stat->npresolrounds,
13250  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
13251  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
13252  &scip->stat->npresolchgsides, &result) );
13253  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
13254  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
13255 
13256  ++k;
13257 
13258  if( result == SCIP_CUTOFF )
13259  {
13260  *infeasible = TRUE;
13262  "constraint handler <%s> detected infeasibility\n", SCIPconshdlrGetName(scip->set->conshdlrs[k-1]));
13263  }
13264  else if( result == SCIP_UNBOUNDED )
13265  {
13266  *unbounded = TRUE;
13268  "constraint handler <%s> detected unboundedness (or infeasibility)\n",
13269  SCIPconshdlrGetName(scip->set->conshdlrs[k-1]));
13270  }
13271 
13272  /* delete the variables from the problems that were marked to be deleted */
13273  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
13274  scip->branchcand) );
13275 
13276  SCIPdebugMessage("presolving callback returned with result <%d>\n", result);
13277 
13278  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
13279  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
13280  {
13281  *presolstart = i;
13282  *propstart = j;
13283  *consstart = k + 1;
13284  aborted = TRUE;
13285 
13286  break;
13287  }
13288  }
13289 
13290  /* call included presolvers with negative priority */
13291  while( !(*unbounded) && !(*infeasible) && !aborted && (i < presolend || j < propend) )
13292  {
13293  if( i < scip->set->npresols )
13294  priopresol = SCIPpresolGetPriority(scip->set->presols[i]);
13295  else
13296  priopresol = -INT_MAX;
13297 
13298  if( j < scip->set->nprops )
13299  prioprop = SCIPpropGetPresolPriority(scip->set->props[j]);
13300  else
13301  prioprop = -INT_MAX;
13302 
13303  /* choose presolving */
13304  if( prioprop >= priopresol )
13305  {
13306  assert(prioprop <= 0);
13307 
13308  SCIPdebugMessage("executing presolving of propagator <%s>\n", SCIPpropGetName(scip->set->props[j]));
13309  SCIP_CALL( SCIPpropPresol(scip->set->props[j], scip->set, *timing, scip->stat->npresolrounds,
13311  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
13312  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
13313  &scip->stat->npresolchgsides, &result) );
13314  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
13315  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
13316 
13317  lastranpresol = FALSE;
13318  ++j;
13319  }
13320  else
13321  {
13322  assert(priopresol < 0);
13323 
13324  SCIPdebugMessage("executing presolver <%s>\n", SCIPpresolGetName(scip->set->presols[i]));
13325  SCIP_CALL( SCIPpresolExec(scip->set->presols[i], scip->set, *timing, scip->stat->npresolrounds,
13327  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
13328  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
13329  &scip->stat->npresolchgsides, &result) );
13330  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
13331  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
13332 
13333  lastranpresol = TRUE;
13334  ++i;
13335  }
13336 
13337  if( result == SCIP_CUTOFF )
13338  {
13339  *infeasible = TRUE;
13340 
13341  if( lastranpresol )
13343  "presolver <%s> detected infeasibility\n", SCIPpresolGetName(scip->set->presols[i-1]));
13344  else
13346  "propagator <%s> detected infeasibility\n", SCIPpropGetName(scip->set->props[j-1]));
13347  }
13348  else if( result == SCIP_UNBOUNDED )
13349  {
13350  *unbounded = TRUE;
13351 
13352  if( lastranpresol )
13354  "presolver <%s> detected unboundedness (or infeasibility)\n", SCIPpresolGetName(scip->set->presols[i-1]));
13355  else
13357  "propagator <%s> detected unboundedness (or infeasibility)\n", SCIPpropGetName(scip->set->props[j-1]));
13358  }
13359 
13360  /* delete the variables from the problems that were marked to be deleted */
13361  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
13362  scip->branchcand) );
13363 
13364  SCIPdebugMessage("presolving callback return with result <%d>\n", result);
13365 
13366  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
13367  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
13368  {
13369  assert(k == consend);
13370 
13371  if( lastranpresol )
13372  {
13373  *presolstart = i + 1;
13374  *propstart = j;
13375  }
13376  else
13377  {
13378  *presolstart = i;
13379  *propstart = j + 1;
13380  }
13381  *consstart = k;
13382 
13383  break;
13384  }
13385  }
13386 
13387  /* remove empty and single variable cliques from the clique table */
13388  if( !(*unbounded) && !(*infeasible) )
13389  {
13390  int nlocalbdchgs = 0;
13391 
13392  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
13393  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
13394  infeasible) );
13395 
13396  if( nlocalbdchgs > 0 || *infeasible )
13398  "clique table cleanup detected %d bound changes%s\n", nlocalbdchgs, *infeasible ? " and infeasibility" : "");
13399 
13400  scip->stat->npresolfixedvars += nlocalbdchgs;
13401 
13402  if( !*infeasible && scip->set->nheurs > 0 )
13403  {
13404  /* call primal heuristics that are applicable during presolving */
13405  SCIP_Bool foundsol;
13406 
13407  SCIPdebugMessage("calling primal heuristics during presolving\n");
13408 
13409  /* call primal heuristics */
13410  SCIP_CALL( SCIPprimalHeuristics(scip->set, scip->stat, scip->transprob, scip->primal, NULL, NULL, NULL,
13411  SCIP_HEURTIMING_DURINGPRESOLLOOP, FALSE, &foundsol) );
13412 
13413  /* output a message, if a solution was found */
13414  if( foundsol )
13415  {
13416  SCIP_SOL* sol;
13417 
13418  assert(SCIPgetNSols(scip) > 0);
13419  sol = SCIPgetBestSol(scip);
13420  assert(sol != NULL);
13421  assert(SCIPgetSolOrigObj(scip,sol) != SCIP_INVALID); /*lint !e777*/
13422 
13424  "feasible solution found by %s heuristic after %.1f seconds, objective value %.6e\n",
13426  }
13427  }
13428  }
13429 
13430  if( !(*unbounded) && !(*infeasible) )
13431  {
13432  /* call more expensive presolvers */
13433  if( (SCIPisPresolveFinished(scip) || lastround) )
13434  {
13435  if( *timing != SCIP_PRESOLTIMING_EXHAUSTIVE )
13436  {
13437  assert((*timing == SCIP_PRESOLTIMING_FAST) || (*timing == SCIP_PRESOLTIMING_MEDIUM));
13438 
13439  SCIPdebugMessage("not enough reductions in %s presolving, running %s presolving now...\n",
13440  *timing == SCIP_PRESOLTIMING_FAST ? "fast" : "medium",
13441  *timing == SCIP_PRESOLTIMING_FAST ? "medium" : "exhaustive");
13442 
13443  /* increase timing */
13445 
13446  /* computational experiments showed that always starting the loop of exhaustive presolvers from the beginning
13447  * performs better than continuing from the last processed presolver. Therefore, we start from 0, but keep
13448  * the mechanisms to possibly change this back later.
13449  * @todo try starting from the last processed exhaustive presolver
13450  */
13451  *presolstart = 0;
13452  *propstart = 0;
13453  *consstart = 0;
13454 
13455  SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, presolstart, presolend,
13456  propstart, propend, consstart, consend) );
13457  }
13458 #if 0
13459  /* run remaining exhaustive presolvers (if we did not start from the beginning anyway) */
13460  else if( (oldpresolstart > 0 || oldpropstart > 0 || oldconsstart > 0) && presolend == scip->set->npresols
13461  && propend == scip->set->nprops && consend == scip->set->nconshdlrs )
13462  {
13463  int newpresolstart = 0;
13464  int newpropstart = 0;
13465  int newconsstart = 0;
13466 
13467  SCIPdebugMessage("reached end of exhaustive presolving loop, starting from the beginning...\n");
13468 
13469  SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, &newpresolstart,
13470  oldpresolstart, &newpropstart, oldpropstart, &newconsstart, oldconsstart) );
13471 
13472  *presolstart = newpresolstart;
13473  *propstart = newpropstart;
13474  *consstart = newconsstart;
13475  }
13476 #endif
13477  }
13478  }
13479 
13480  /* issue PRESOLVEROUND event */
13482  SCIP_CALL( SCIPeventProcess(&event, scip->set, NULL, NULL, NULL, scip->eventfilter) );
13483 
13484  return SCIP_OKAY;
13485 }
13486 
13487 
13488 /** loops through the included presolvers and constraint's presolve methods, until changes are too few */
13489 static
13491  SCIP* scip, /**< SCIP data structure */
13492  SCIP_Bool* unbounded, /**< pointer to store whether presolving detected unboundedness */
13493  SCIP_Bool* infeasible /**< pointer to store whether presolving detected infeasibility */
13494  )
13495 {
13496  SCIP_PRESOLTIMING presoltiming;
13497  SCIP_Bool finished;
13498  SCIP_Bool stopped;
13499  SCIP_Bool lastround;
13500  int presolstart = 0;
13501  int propstart = 0;
13502  int consstart = 0;
13503 
13504  assert(scip != NULL);
13505  assert(scip->mem != NULL);
13506  assert(scip->primal != NULL);
13507  assert(scip->set != NULL);
13508  assert(scip->stat != NULL);
13509  assert(scip->transprob != NULL);
13510  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED || scip->set->stage == SCIP_STAGE_PRESOLVING);
13511  assert(unbounded != NULL);
13512  assert(infeasible != NULL);
13513 
13514  /* switch status to unknown */
13515  scip->stat->status = SCIP_STATUS_UNKNOWN;
13516 
13517  /* update upper bound and cutoff bound due to objective limit in primal data */
13518  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
13519  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
13520 
13521  /* start presolving timer */
13522  SCIPclockStart(scip->stat->presolvingtime, scip->set);
13524 
13525  /* initialize presolving */
13526  if( scip->set->stage == SCIP_STAGE_TRANSFORMED )
13527  {
13528  SCIP_CALL( initPresolve(scip) );
13529  }
13530  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
13531 
13532  /* call primal heuristics that are applicable before presolving */
13533  if( scip->set->nheurs > 0 )
13534  {
13535  SCIP_Bool foundsol;
13536 
13537  SCIPdebugMessage("calling primal heuristics before presolving\n");
13538 
13539  /* call primal heuristics */
13540  SCIP_CALL( SCIPprimalHeuristics(scip->set, scip->stat, scip->transprob, scip->primal, NULL, NULL, NULL,
13541  SCIP_HEURTIMING_BEFOREPRESOL, FALSE, &foundsol) );
13542 
13543  /* output a message, if a solution was found */
13544  if( foundsol )
13545  {
13546  SCIP_SOL* sol;
13547 
13548  assert(SCIPgetNSols(scip) > 0);
13549  sol = SCIPgetBestSol(scip);
13550  assert(sol != NULL);
13551  assert(SCIPgetSolOrigObj(scip,sol) != SCIP_INVALID); /*lint !e777*/
13552 
13554  "feasible solution found by %s heuristic after %.1f seconds, objective value %.6e\n",
13556  }
13557  }
13558 
13560 
13561  *infeasible = FALSE;
13562  *unbounded = SCIPgetNSols(scip) > 0 && SCIPisInfinity(scip, -SCIPgetSolOrigObj(scip, SCIPgetBestSol(scip)));
13563 
13564  finished = (scip->set->presol_maxrounds != -1 && scip->stat->npresolrounds >= scip->set->presol_maxrounds) || (*unbounded);
13565  stopped = SCIPsolveIsStopped(scip->set, scip->stat, TRUE);
13566 
13567  /* perform presolving rounds */
13568  while( !finished && !stopped )
13569  {
13570  /* store current number of reductions */
13572  scip->stat->lastnpresolaggrvars = scip->stat->npresolaggrvars;
13574  scip->stat->lastnpresolchgbds = scip->stat->npresolchgbds;
13575  scip->stat->lastnpresoladdholes = scip->stat->npresoladdholes;
13576  scip->stat->lastnpresoldelconss = scip->stat->npresoldelconss;
13577  scip->stat->lastnpresoladdconss = scip->stat->npresoladdconss;
13579  scip->stat->lastnpresolchgcoefs = scip->stat->npresolchgcoefs;
13580  scip->stat->lastnpresolchgsides = scip->stat->npresolchgsides;
13581 #ifdef SCIP_DISABLED_CODE
13582  scip->stat->lastnpresolimplications = scip->stat->nimplications;
13583  scip->stat->lastnpresolcliques = SCIPcliquetableGetNCliques(scip->cliquetable);
13584 #endif
13585 
13586  /* set presolving flag */
13587  scip->stat->performpresol = TRUE;
13588 
13589  /* sort propagators */
13590  SCIPsetSortPropsPresol(scip->set);
13591 
13592  /* sort presolvers by priority */
13593  SCIPsetSortPresols(scip->set);
13594 
13595  /* check if this will be the last presolving round (in that case, we want to run all presolvers) */
13596  lastround = (scip->set->presol_maxrounds == -1 ? FALSE : (scip->stat->npresolrounds + 1 >= scip->set->presol_maxrounds));
13597 
13598  presoltiming = SCIP_PRESOLTIMING_FAST;
13599 
13600  /* perform the presolving round by calling the presolvers, propagators, and constraint handlers */
13601  assert(!(*unbounded));
13602  assert(!(*infeasible));
13603  SCIP_CALL( presolveRound(scip, &presoltiming, unbounded, infeasible, lastround,
13604  &presolstart, scip->set->npresols, &propstart, scip->set->nprops, &consstart, scip->set->nconshdlrs) );
13605 
13606  /* check, if we should abort presolving due to not enough changes in the last round */
13607  finished = SCIPisPresolveFinished(scip);
13608 
13609  SCIPdebugMessage("presolving round %d returned with unbounded = %u, infeasible = %u, finished = %u\n", scip->stat->npresolrounds, *unbounded, *infeasible, finished);
13610 
13611  /* check whether problem is infeasible or unbounded */
13612  finished = finished || *unbounded || *infeasible;
13613 
13614  /* increase round number */
13615  scip->stat->npresolrounds++;
13616 
13617  if( !finished )
13618  {
13619  /* print presolving statistics */
13621  "(round %d, %-11s %d del vars, %d del conss, %d add conss, %d chg bounds, %d chg sides, %d chg coeffs, %d upgd conss, %d impls, %d clqs\n",
13622  scip->stat->npresolrounds, ( presoltiming == SCIP_PRESOLTIMING_FAST ? "fast)" :
13623  (presoltiming == SCIP_PRESOLTIMING_MEDIUM ? "medium)" : "exhaustive)") ),
13624  scip->stat->npresolfixedvars + scip->stat->npresolaggrvars,
13625  scip->stat->npresoldelconss, scip->stat->npresoladdconss,
13626  scip->stat->npresolchgbds, scip->stat->npresolchgsides,
13627  scip->stat->npresolchgcoefs, scip->stat->npresolupgdconss,
13629  }
13630 
13631  /* abort if time limit was reached or user interrupted */
13632  stopped = SCIPsolveIsStopped(scip->set, scip->stat, TRUE);
13633  }
13634 
13635  if( *infeasible || *unbounded )
13636  {
13637  /* first change status of scip, so that all plugins in their exitpre callbacks can ask SCIP for the correct status */
13638  if( *infeasible )
13639  {
13640  /* switch status to OPTIMAL */
13641  if( scip->primal->nlimsolsfound > 0 )
13642  {
13643  scip->stat->status = SCIP_STATUS_OPTIMAL;
13644  }
13645  else /* switch status to INFEASIBLE */
13647  }
13648  else if( scip->primal->nsols >= 1 ) /* switch status to UNBOUNDED */
13650  else /* switch status to INFORUNBD */
13652  }
13653 
13654  /* deinitialize presolving */
13655  if( finished && (!stopped || *unbounded || *infeasible) )
13656  {
13657  SCIP_CALL( exitPresolve(scip, *unbounded || *infeasible, infeasible) );
13658  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
13659 
13660  /* resorted variables if we are not already done */
13661  if( !(*infeasible) && !(*unbounded) )
13662  {
13663  /* (Re)Sort the variables, which appear in the four categories (binary, integer, implicit, continuous) after
13664  * presolve with respect to their original index (within their categories). Adjust the problem index afterwards
13665  * which is supposed to reflect the position in the variable array. This additional (re)sorting is supposed to
13666  * get more robust against the order presolving fixed variables. (We also reobtain a possible block structure
13667  * induced by the user model)
13668  */
13670  }
13671 
13672  if( scip->set->disp_verblevel == SCIP_VERBLEVEL_FULL )
13673  {
13674  SCIP_Real maxnonzeros = ((SCIP_Real)SCIPgetNConss(scip)) * SCIPgetNVars(scip);
13675  SCIP_Longint nchecknonzeros;
13676  SCIP_Longint nactivenonzeros;
13677  SCIP_Bool approxchecknonzeros;
13678  SCIP_Bool approxactivenonzeros;
13679 
13680  /* determine number of non-zeros */
13681  SCIP_CALL( calcNonZeros(scip, &nchecknonzeros, &nactivenonzeros, &approxchecknonzeros, &approxactivenonzeros) );
13682 
13685  "presolved problem has %s%" SCIP_LONGINT_FORMAT " active (%g%%) nonzeros and %s%" SCIP_LONGINT_FORMAT " (%g%%) check nonzeros\n",
13686  approxactivenonzeros ? "more than " : "", nactivenonzeros, nactivenonzeros/maxnonzeros * 100,
13687  approxchecknonzeros ? "more than " : "", nchecknonzeros, nchecknonzeros/maxnonzeros * 100);
13689  }
13690  }
13691  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
13692  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
13693 
13694  /* stop presolving time */
13695  SCIPclockStop(scip->stat->presolvingtime, scip->set);
13697 
13698  /* print presolving statistics */
13700  "presolving (%d rounds: %d fast, %d medium, %d exhaustive):\n", scip->stat->npresolrounds,
13703  " %d deleted vars, %d deleted constraints, %d added constraints, %d tightened bounds, %d added holes, %d changed sides, %d changed coefficients\n",
13707  " %d implications, %d cliques\n", scip->stat->nimplications, SCIPcliquetableGetNCliques(scip->cliquetable));
13708 
13709  /* remember number of constraints */
13711 
13712  return SCIP_OKAY;
13713 }
13714 
13715 /** tries to transform original solutions to the transformed problem space */
13716 static
13718  SCIP* scip /**< SCIP data structure */
13719  )
13720 {
13721  SCIP_SOL** sols;
13722  SCIP_SOL* sol;
13723  SCIP_Real* solvals;
13724  SCIP_Bool* solvalset;
13725  SCIP_Bool added;
13726  SCIP_Longint oldnsolsfound;
13727  int nsols;
13728  int ntransvars;
13729  int naddedsols;
13730  int s;
13731 
13732  nsols = SCIPgetNSols(scip);
13733  oldnsolsfound = scip->primal->nsolsfound;
13734 
13735  /* no solution to transform */
13736  if( nsols == 0 )
13737  return SCIP_OKAY;
13738 
13739  SCIPdebugMessage("try to transfer %d original solutions into the transformed problem space\n", nsols);
13740 
13741  ntransvars = scip->transprob->nvars;
13742  naddedsols = 0;
13743 
13744  /* It might happen, that the added transferred solution does not equal the corresponding original one, which might
13745  * result in the array of solutions being changed. Thus we temporarily copy the array and traverse it in reverse
13746  * order to ensure that the regarded solution in the copied array was not already freed when new solutions were added
13747  * and the worst solutions were freed.
13748  */
13749  SCIP_CALL( SCIPduplicateBufferArray(scip, &sols, SCIPgetSols(scip), nsols) );
13750  SCIP_CALL( SCIPallocBufferArray(scip, &solvals, ntransvars) );
13751  SCIP_CALL( SCIPallocBufferArray(scip, &solvalset, ntransvars) );
13752 
13753  for( s = nsols-1; s >= 0; --s )
13754  {
13755  sol = sols[s];
13756 
13757  /* it might happen that a transferred original solution has a better objective than its original counterpart
13758  * (e.g., because multi-aggregated variables get another value, but the solution is still feasible);
13759  * in this case, it might happen that the solution is not an original one and we just skip this solution
13760  */
13761  if( !SCIPsolIsOriginal(sol) )
13762  continue;
13763 
13764  SCIP_CALL( SCIPprimalTransformSol(scip->primal, sol, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
13765  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, solvals,
13766  solvalset, ntransvars, &added) );
13767 
13768  if( added )
13769  ++naddedsols;
13770  }
13771 
13772  if( naddedsols > 0 )
13773  {
13775  "transformed %d/%d original solutions to the transformed problem space\n",
13776  naddedsols, nsols);
13777 
13778  scip->stat->nexternalsolsfound += scip->primal->nsolsfound - oldnsolsfound;
13779  }
13780 
13781  SCIPfreeBufferArray(scip, &solvals);
13782  SCIPfreeBufferArray(scip, &solvalset);
13783  SCIPfreeBufferArray(scip, &sols);
13784 
13785  return SCIP_OKAY;
13786 }
13787 
13788 /** initializes solution process data structures */
13789 static
13791  SCIP* scip, /**< SCIP data structure */
13792  SCIP_Bool solved /**< is problem already solved? */
13793  )
13794 {
13795  assert(scip != NULL);
13796  assert(scip->mem != NULL);
13797  assert(scip->set != NULL);
13798  assert(scip->stat != NULL);
13799  assert(scip->nlp == NULL);
13800  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
13801 
13802  /**@todo check whether other methodscan be skipped if problem has been solved */
13803  /* if problem has been solved, several time consuming tasks must not be performed */
13804  if( !solved )
13805  {
13806  /* reset statistics for current branch and bound run */
13807  SCIPstatResetCurrentRun(scip->stat, solved);
13809 
13810  /* LP is empty anyway; mark empty LP to be solved and update validsollp counter */
13811  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter) );
13812 
13813  /* update upper bound and cutoff bound due to objective limit in primal data */
13814  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
13815  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
13816  }
13817 
13818  /* switch stage to INITSOLVE */
13819  scip->set->stage = SCIP_STAGE_INITSOLVE;
13820 
13821  /* initialize NLP if there are nonlinearities */
13822  if( scip->transprob->nlpenabled && !scip->set->nlp_disable )
13823  {
13824  SCIPdebugMessage("constructing empty NLP\n");
13825 
13826  SCIP_CALL( SCIPnlpCreate(&scip->nlp, scip->mem->probmem, scip->set, scip->stat, SCIPprobGetName(scip->transprob), scip->transprob->nvars) );
13827  assert(scip->nlp != NULL);
13828 
13829  SCIP_CALL( SCIPnlpAddVars(scip->nlp, scip->mem->probmem, scip->set, scip->transprob->nvars, scip->transprob->vars) );
13830  }
13831 
13832  /* possibly create visualization output file */
13833  SCIP_CALL( SCIPvisualInit(scip->stat->visual, scip->mem->probmem, scip->set, scip->messagehdlr) );
13834 
13835  /* initialize solution process data structures */
13838  SCIP_CALL( SCIPcutpoolCreate(&scip->cutpool, scip->mem->probmem, scip->set, scip->set->sepa_cutagelimit, TRUE) );
13839  SCIP_CALL( SCIPcutpoolCreate(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->set->sepa_cutagelimit, FALSE) );
13840  SCIP_CALL( SCIPtreeCreateRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
13841  scip->lp) );
13842 
13843  /* update dual bound of the root node if a valid dual bound is at hand */
13844  if( scip->transprob->dualbound < SCIP_INVALID )
13845  {
13846  SCIP_Real internobjval = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
13847 
13848  scip->stat->lastlowerbound = internobjval;
13849 
13850  SCIPnodeUpdateLowerbound(SCIPtreeGetRootNode(scip->tree), scip->stat, scip->set, scip->tree, scip->transprob,
13851  scip->origprob, internobjval);
13852  }
13853 
13854  /* try to transform original solutions to the transformed problem space */
13855  if( scip->set->misc_transorigsols )
13856  {
13857  SCIP_CALL( transformSols(scip) );
13858  }
13859 
13860  /* inform the transformed problem that the branch and bound process starts now */
13861  SCIP_CALL( SCIPprobInitSolve(scip->transprob, scip->set) );
13862 
13863  /* inform plugins that the branch and bound process starts now */
13864  SCIP_CALL( SCIPsetInitsolPlugins(scip->set, scip->mem->probmem, scip->stat) );
13865 
13866  /* remember number of constraints */
13868 
13869  /* if all variables are known, calculate a trivial primal bound by setting all variables to their worst bound */
13870  if( scip->set->nactivepricers == 0 )
13871  {
13872  SCIP_VAR* var;
13873  SCIP_Real obj;
13874  SCIP_Real objbound;
13875  SCIP_Real bd;
13876  int v;
13877 
13878  objbound = 0.0;
13879  for( v = 0; v < scip->transprob->nvars && !SCIPsetIsInfinity(scip->set, objbound); ++v )
13880  {
13881  var = scip->transprob->vars[v];
13882  obj = SCIPvarGetObj(var);
13883  if( !SCIPsetIsZero(scip->set, obj) )
13884  {
13885  bd = SCIPvarGetWorstBoundGlobal(var);
13886  if( SCIPsetIsInfinity(scip->set, REALABS(bd)) )
13887  objbound = SCIPsetInfinity(scip->set);
13888  else
13889  objbound += obj * bd;
13890  }
13891  }
13892 
13893  /* adjust primal bound, such that solution with worst bound may be found */
13894  objbound += SCIPsetCutoffbounddelta(scip->set);
13895 
13896  /* update cutoff bound */
13897  if( !SCIPsetIsInfinity(scip->set, objbound) && SCIPsetIsLT(scip->set, objbound, scip->primal->cutoffbound) )
13898  {
13899  /* adjust cutoff bound */
13900  SCIP_CALL( SCIPprimalSetCutoffbound(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
13901  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, objbound, FALSE) );
13902  }
13903  }
13904 
13905  /* switch stage to SOLVING */
13906  scip->set->stage = SCIP_STAGE_SOLVING;
13907 
13908  return SCIP_OKAY;
13909 }
13910 
13911 /** frees solution process data structures */
13912 static
13914  SCIP* scip, /**< SCIP data structure */
13915  SCIP_Bool restart /**< was this free solve call triggered by a restart? */
13916  )
13917 {
13918  assert(scip != NULL);
13919  assert(scip->mem != NULL);
13920  assert(scip->set != NULL);
13921  assert(scip->stat != NULL);
13922  assert(scip->set->stage == SCIP_STAGE_SOLVING || scip->set->stage == SCIP_STAGE_SOLVED);
13923 
13924  /* mark that we are currently restarting */
13925  if( restart )
13926  {
13927  scip->stat->inrestart = TRUE;
13928 
13929  /* copy the current dual bound into the problem data structure such that it can be used initialize the new search
13930  * tree
13931  */
13933  }
13934 
13935  /* remove focus from the current focus node */
13936  if( SCIPtreeGetFocusNode(scip->tree) != NULL )
13937  {
13938  SCIP_NODE* node = NULL;
13939  SCIP_Bool cutoff;
13940 
13941  SCIP_CALL( SCIPnodeFocus(&node, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
13942  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->conflict, scip->eventfilter,
13943  scip->eventqueue, scip->cliquetable, &cutoff, TRUE) );
13944  assert(!cutoff);
13945  }
13946 
13947  /* switch stage to EXITSOLVE */
13948  scip->set->stage = SCIP_STAGE_EXITSOLVE;
13949 
13950  /* inform plugins that the branch and bound process is finished */
13951  SCIP_CALL( SCIPsetExitsolPlugins(scip->set, scip->mem->probmem, scip->stat, restart) );
13952 
13953  /* free the NLP, if there is one, and reset the flags indicating nonlinearity */
13954  if( scip->nlp != NULL )
13955  {
13956  SCIP_CALL( SCIPnlpFree(&scip->nlp, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
13957  }
13958  scip->transprob->nlpenabled = FALSE;
13959 
13960  /* clear the LP, and flush the changes to clear the LP of the solver */
13961  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter) );
13963 
13964  /* resets the debug environment */
13965  SCIP_CALL( SCIPdebugReset(scip->set) ); /*lint !e506 !e774*/
13966 
13967  /* clear all row references in internal data structures */
13968  SCIP_CALL( SCIPcutpoolClear(scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
13969  SCIP_CALL( SCIPcutpoolClear(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
13970 
13971  /* we have to clear the tree prior to the problem deinitialization, because the rows stored in the forks and
13972  * subroots have to be released
13973  */
13974  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
13975 
13976  /* deinitialize transformed problem */
13977  SCIP_CALL( SCIPprobExitSolve(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, restart) );
13978 
13979  /* free solution process data structures */
13980  SCIP_CALL( SCIPcutpoolFree(&scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
13981  SCIP_CALL( SCIPcutpoolFree(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
13984 
13985  /* possibly close visualization output file */
13986  SCIPvisualExit(scip->stat->visual, scip->set, scip->messagehdlr);
13987 
13988  /* reset statistics for current branch and bound run */
13991  else
13993 
13994  /* switch stage to TRANSFORMED */
13995  scip->set->stage = SCIP_STAGE_TRANSFORMED;
13996 
13997  /* restart finished */
13998  assert( ! restart || scip->stat->inrestart );
13999  scip->stat->inrestart = FALSE;
14000 
14001  return SCIP_OKAY;
14002 }
14003 
14004 /** free transformed problem */
14005 static
14007  SCIP* scip /**< SCIP data structure */
14008  )
14009 {
14010  assert(scip != NULL);
14011  assert(scip->mem != NULL);
14012  assert(scip->stat != NULL);
14013  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED || scip->set->stage == SCIP_STAGE_PRESOLVING);
14014 
14015  /* call exit methods of plugins */
14016  SCIP_CALL( SCIPsetExitPlugins(scip->set, scip->mem->probmem, scip->stat) );
14017 
14018  /* copy best primal solutions to original solution candidate list */
14019  if( !scip->set->reopt_enable && scip->set->limit_maxorigsol > 0 && scip->set->misc_transsolsorig )
14020  {
14021  SCIP_Bool stored;
14022  SCIP_Bool hasinfval;
14023  int maxsols;
14024  int nsols;
14025  int s;
14026 
14027  assert(scip->origprimal->nsols == 0);
14028 
14029  nsols = scip->primal->nsols;
14030  maxsols = scip->set->limit_maxorigsol;
14031  stored = TRUE;
14032  s = 0;
14033 
14034  /* iterate over all solutions as long as the original solution candidate store size limit is not reached */
14035  while( s < nsols && scip->origprimal->nsols < maxsols )
14036  {
14037  SCIP_SOL* sol;
14038 
14039  sol = scip->primal->sols[s];
14040  assert(sol != NULL);
14041 
14042  if( !SCIPsolIsOriginal(sol) )
14043  {
14044  /* retransform solution into the original problem space */
14045  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
14046  }
14047  else
14048  hasinfval = FALSE;
14049 
14050  /* removing infinite fixings is turned off by the corresponding parameter */
14051  if( !scip->set->misc_finitesolstore )
14052  hasinfval = FALSE;
14053 
14054  if( !hasinfval )
14055  {
14056  /* add solution to original candidate solution storage */
14057  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, &stored) );
14058  }
14059  else
14060  {
14061  SCIP_SOL* newsol;
14062  SCIP_Bool success;
14063 
14064  SCIP_CALL( SCIPcreateFiniteSolCopy(scip, &newsol, sol, &success) );
14065 
14066  /* infinite fixing could be removed */
14067  if( newsol != NULL )
14068  {
14069  /* add solution to original candidate solution storage; we must not use SCIPprimalAddOrigSolFree()
14070  * because we want to create a copy of the solution in the origprimal solution store, but newsol was
14071  * created in the (transformed) primal
14072  */
14073  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, newsol, &stored) );
14074 
14075  /* free solution in (transformed) primal where it was created */
14076  SCIP_CALL( SCIPsolFree(&newsol, scip->mem->probmem, scip->primal) );
14077  }
14078  }
14079  ++s;
14080  }
14081 
14082  if( scip->origprimal->nsols > 1 )
14083  {
14085  "stored the %d best primal solutions in the original solution candidate list\n", scip->origprimal->nsols);
14086  }
14087  else if( scip->origprimal->nsols == 1 )
14088  {
14090  "stored the best primal solution in the original solution candidate list\n");
14091  }
14092  }
14093 
14094  /* switch stage to FREETRANS */
14095  scip->set->stage = SCIP_STAGE_FREETRANS;
14096 
14097  /* remove var locks set to avoid dual reductions */
14098  if( scip->set->reopt_enable || !scip->set->misc_allowdualreds )
14099  {
14100  int v;
14101 
14102  /* release and unlock all variables */
14103  for(v = 0; v < scip->origprob->nvars; v++)
14104  {
14105  SCIP_VAR* transvar;
14106  transvar = SCIPvarGetTransVar(scip->origprob->vars[v]);
14107  SCIP_CALL( SCIPaddVarLocks(scip, transvar, -1, -1) );
14108  SCIP_CALL( SCIPreleaseVar(scip, &transvar) );
14109  }
14110  }
14111 
14112  /* free transformed problem data structures */
14113  SCIP_CALL( SCIPprobFree(&scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
14115  SCIP_CALL( SCIPconflictFree(&scip->conflict, scip->mem->probmem) );
14116  SCIP_CALL( SCIPtreeFree(&scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
14117 
14118  /* free the debug solution which might live in transformed primal data structure */
14119  SCIP_CALL( SCIPdebugFreeSol(scip->set) ); /*lint !e506 !e774*/
14120  SCIP_CALL( SCIPprimalFree(&scip->primal, scip->mem->probmem) );
14121 
14123  SCIP_CALL( SCIPlpFree(&scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter) );
14125  SCIP_CALL( SCIPeventfilterFree(&scip->eventfilter, scip->mem->probmem, scip->set) );
14127 
14128  if( scip->set->misc_resetstat )
14129  {
14130  /* reset statistics to the point before the problem was transformed */
14131  SCIPstatReset(scip->stat, scip->set);
14132  }
14133  else
14134  {
14135  /* even if statistics are not completely reset, a partial reset of the primal-dual intgeral is necessary */
14137  }
14138 
14139  /* switch stage to PROBLEM */
14140  scip->set->stage = SCIP_STAGE_PROBLEM;
14141 
14142  /* reset objective limit */
14144 
14145  /* reset original variable's local and global bounds to their original values */
14146  SCIP_CALL( SCIPprobResetBounds(scip->origprob, scip->mem->probmem, scip->set, scip->stat) );
14147 
14148  return SCIP_OKAY;
14149 }
14150 
14151 /** displays most relevant statistics after problem was solved */
14152 static
14154  SCIP* scip /**< SCIP data structure */
14155  )
14156 {
14157  assert(scip != NULL);
14158 
14159  /* display most relevant statistics */
14160  if( scip->set->disp_verblevel >= SCIP_VERBLEVEL_NORMAL )
14161  {
14162  SCIP_Bool objlimitreached = FALSE;
14163 
14164  if( SCIPgetStage(scip) == SCIP_STAGE_SOLVED && scip->primal->nlimsolsfound == 0
14165  && !SCIPisInfinity(scip, getPrimalbound(scip)) )
14166  objlimitreached = TRUE;
14167 
14168  SCIPmessagePrintInfo(scip->messagehdlr, "\n");
14169  SCIPmessagePrintInfo(scip->messagehdlr, "SCIP Status : ");
14170  SCIP_CALL( SCIPprintStage(scip, NULL) );
14171  SCIPmessagePrintInfo(scip->messagehdlr, "\n");
14172  if( scip->set->reopt_enable )
14173  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Time (sec) : %.2f (over %d runs: %.2f)\n", SCIPclockGetTime(scip->stat->solvingtime), scip->stat->nreoptruns, SCIPclockGetTime(scip->stat->solvingtimeoverall));
14174  else
14175  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Time (sec) : %.2f\n", SCIPclockGetTime(scip->stat->solvingtime));
14176  if( scip->stat->nruns > 1 )
14177  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT " (total of %" SCIP_LONGINT_FORMAT " nodes in %d runs)\n",
14178  scip->stat->nnodes, scip->stat->ntotalnodes, scip->stat->nruns);
14179  else if( scip->set->reopt_enable )
14180  {
14181  SCIP_BRANCHRULE* branchrule;
14182 
14183  branchrule = SCIPfindBranchrule(scip, "nodereopt");
14184  assert(branchrule != NULL);
14185 
14186  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " reactivated)\n", scip->stat->nnodes, SCIPbranchruleGetNChildren(branchrule));
14187  }
14188  else
14189  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT "\n", scip->stat->nnodes);
14190  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED && scip->set->stage <= SCIP_STAGE_EXITSOLVE )
14191  {
14192  if( objlimitreached )
14193  {
14194  SCIPmessagePrintInfo(scip->messagehdlr, "Primal Bound : %+.14e (%" SCIP_LONGINT_FORMAT " solutions)\n",
14195  SCIPinfinity(scip), scip->primal->nsolsfound);
14196  }
14197  else
14198  {
14199  char limsolstring[SCIP_MAXSTRLEN];
14200  if( scip->primal->nsolsfound != scip->primal->nlimsolsfound )
14201  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN, ", %" SCIP_LONGINT_FORMAT " respecting the objective limit", scip->primal->nlimsolsfound);
14202  else
14203  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN,"");
14204 
14205  SCIPmessagePrintInfo(scip->messagehdlr, "Primal Bound : %+.14e (%" SCIP_LONGINT_FORMAT " solutions%s)\n",
14206  getPrimalbound(scip), scip->primal->nsolsfound, limsolstring);
14207  }
14208  }
14209  if( scip->set->stage >= SCIP_STAGE_SOLVING && scip->set->stage <= SCIP_STAGE_SOLVED )
14210  {
14211  if( objlimitreached )
14212  {
14213  SCIPmessagePrintInfo(scip->messagehdlr, "Dual Bound : %+.14e\n", SCIPinfinity(scip));
14214  }
14215  else
14216  {
14217  SCIPmessagePrintInfo(scip->messagehdlr, "Dual Bound : %+.14e\n", getDualbound(scip));
14218  }
14219  SCIPmessagePrintInfo(scip->messagehdlr, "Gap : ");
14220  if( SCIPsetIsInfinity(scip->set, SCIPgetGap(scip)) )
14221  SCIPmessagePrintInfo(scip->messagehdlr, "infinite\n");
14222  else
14223  SCIPmessagePrintInfo(scip->messagehdlr, "%.2f %%\n", 100.0*SCIPgetGap(scip));
14224  }
14225 
14226  /* check solution for feasibility in original problem */
14227  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
14228  {
14229  SCIP_SOL* sol;
14230 
14231  sol = SCIPgetBestSol(scip);
14232  if( sol != NULL )
14233  {
14234  SCIP_Real checkfeastolfac;
14235  SCIP_Real oldfeastol;
14236  SCIP_Bool dispallviols;
14237  SCIP_Bool feasible;
14238 
14239  oldfeastol = SCIPfeastol(scip);
14240  SCIP_CALL( SCIPgetRealParam(scip, "numerics/checkfeastolfac", &checkfeastolfac) );
14241  SCIP_CALL( SCIPgetBoolParam(scip, "display/allviols", &dispallviols) );
14242 
14243  /* scale feasibility tolerance by set->num_checkfeastolfac */
14244  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
14245  {
14246  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol * checkfeastolfac) );
14247  }
14248 
14249  SCIP_CALL( SCIPcheckSolOrig(scip, sol, &feasible, TRUE, dispallviols) );
14250 
14251  /* restore old feasibilty tolerance */
14252  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
14253  {
14254  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol) );
14255  }
14256 
14257  if( !feasible )
14258  {
14259  SCIPmessagePrintInfo(scip->messagehdlr, "best solution is not feasible in original problem\n");
14260  }
14261  }
14262  }
14263  }
14264 
14265  return SCIP_OKAY;
14266 }
14267 
14268 /** calls compression based on the reoptimization structure after the presolving */
14269 static
14271  SCIP* scip /**< global SCIP settings */
14272  )
14273 {
14274  SCIP_RESULT result;
14275  int c;
14276  int noldnodes;
14277  int nnewnodes;
14278 
14279  result = SCIP_DIDNOTFIND;
14280 
14281  noldnodes = SCIPreoptGetNNodes(scip->reopt, scip->tree->root);
14282 
14283  if( noldnodes <= 1 )
14284  {
14285  return SCIP_OKAY;
14286  }
14287 
14289  "tree compression:\n");
14291  " given tree has %d nodes.\n", noldnodes);
14292 
14293  /* sort compressions by priority */
14294  SCIPsetSortComprs(scip->set);
14295 
14296  for(c = 0; c < scip->set->ncomprs; c++)
14297  {
14298  assert(result == SCIP_DIDNOTFIND || result == SCIP_DIDNOTRUN);
14299 
14300  /* call tree compression technique */
14301  SCIP_CALL( SCIPcomprExec(scip->set->comprs[c], scip->set, scip->reopt, &result) );
14302 
14303  if( result == SCIP_SUCCESS )
14304  {
14305  nnewnodes = SCIPreoptGetNNodes(scip->reopt, scip->tree->root);
14307  " <%s> compressed the search tree to %d nodes (rate %g).\n", SCIPcomprGetName(scip->set->comprs[c]),
14308  nnewnodes, ((SCIP_Real)nnewnodes)/noldnodes);
14309 
14310  break;
14311  }
14312  }
14313 
14314  if( result != SCIP_SUCCESS )
14315  {
14316  assert(result == SCIP_DIDNOTFIND || result == SCIP_DIDNOTRUN);
14318  " search tree could not be compressed.\n");
14319  }
14320 
14321  return SCIP_OKAY;
14322 }
14323 
14324 /** transforms and presolves problem
14325  *
14326  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
14327  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
14328  *
14329  * @pre This method can be called if @p scip is in one of the following stages:
14330  * - \ref SCIP_STAGE_PROBLEM
14331  * - \ref SCIP_STAGE_TRANSFORMED
14332  * - \ref SCIP_STAGE_PRESOLVING
14333  * - \ref SCIP_STAGE_PRESOLVED
14334  *
14335  * @post After calling this method \SCIP reaches one of the following stages:
14336  * - \ref SCIP_STAGE_PRESOLVING if the presolving process was interrupted
14337  * - \ref SCIP_STAGE_PRESOLVED if the presolving process was finished and did not solve the problem
14338  * - \ref SCIP_STAGE_SOLVED if the problem was solved during presolving
14339  *
14340  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
14341  */
14343  SCIP* scip /**< SCIP data structure */
14344  )
14345 {
14346  SCIP_Bool unbounded;
14347  SCIP_Bool infeasible;
14348 
14349  SCIP_CALL( checkStage(scip, "SCIPpresolve", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
14350 
14351  /* start solving timer */
14352  SCIPclockStart(scip->stat->solvingtime, scip->set);
14353  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
14354 
14355  /* capture the CTRL-C interrupt */
14356  if( scip->set->misc_catchctrlc )
14358 
14359  /* reset the user interrupt flag */
14360  scip->stat->userinterrupt = FALSE;
14361 
14362  switch( scip->set->stage )
14363  {
14364  case SCIP_STAGE_PROBLEM:
14365  /* initialize solving data structures and transform problem */
14366  SCIP_CALL( SCIPtransformProb(scip) );
14367  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
14368 
14369  /*lint -fallthrough*/
14370 
14372  case SCIP_STAGE_PRESOLVING:
14373  /* presolve problem */
14374  SCIP_CALL( presolve(scip, &unbounded, &infeasible) );
14375  assert(scip->set->stage == SCIP_STAGE_PRESOLVED || scip->set->stage == SCIP_STAGE_PRESOLVING);
14376 
14377  if( infeasible || unbounded )
14378  {
14379  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
14380 
14381  /* initialize solving process data structures to be able to switch to SOLVED stage */
14382  SCIP_CALL( initSolve(scip, TRUE) );
14383 
14384  /* switch stage to SOLVED */
14385  scip->set->stage = SCIP_STAGE_SOLVED;
14386 
14387  /* print solution message */
14388  switch( scip->stat->status )/*lint --e{788}*/
14389  {
14390  case SCIP_STATUS_OPTIMAL:
14391  /* remove the root node from the tree, s.t. the lower bound is set to +infinity ???????????? (see initSolve())*/
14392  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
14393  break;
14394 
14397  "presolving detected infeasibility\n");
14398  break;
14399 
14400  case SCIP_STATUS_UNBOUNDED:
14402  "presolving detected unboundedness\n");
14403  break;
14404 
14405  case SCIP_STATUS_INFORUNBD:
14407  "presolving detected unboundedness (or infeasibility)\n");
14408  break;
14409 
14410  default:
14411  /* note that this is in an internal SCIP error since the status is corrupted */
14412  SCIPerrorMessage("invalid SCIP status <%d>\n", scip->stat->status);
14413  SCIPABORT();
14414  return SCIP_ERROR; /*lint !e527*/
14415  }
14416  }
14417  else if( scip->set->stage == SCIP_STAGE_PRESOLVED )
14418  {
14419  int h;
14420 
14421  /* print presolved problem statistics */
14423  "presolved problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
14424  scip->transprob->nvars, scip->transprob->nbinvars, scip->transprob->nintvars, scip->transprob->nimplvars,
14425  scip->transprob->ncontvars, scip->transprob->nconss);
14426 
14427  for( h = 0; h < scip->set->nconshdlrs; ++h )
14428  {
14429  int nactiveconss;
14430 
14431  nactiveconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
14432  if( nactiveconss > 0 )
14433  {
14435  "%7d constraints of type <%s>\n", nactiveconss, SCIPconshdlrGetName(scip->set->conshdlrs[h]));
14436  }
14437  }
14438 
14439  if( SCIPprobIsObjIntegral(scip->transprob) )
14440  {
14442  "transformed objective value is always integral (scale: %.15g)\n", scip->transprob->objscale);
14443  }
14444  }
14445  else
14446  {
14447  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
14448  SCIPmessagePrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, SCIP_VERBLEVEL_HIGH, "presolving was interrupted.\n");
14449  }
14450 
14451  /* display timing statistics */
14453  "Presolving Time: %.2f\n", SCIPclockGetTime(scip->stat->presolvingtime));
14454  break;
14455 
14456  case SCIP_STAGE_PRESOLVED:
14457  case SCIP_STAGE_SOLVED:
14458  break;
14459 
14460  default:
14461  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
14462  return SCIP_INVALIDCALL;
14463  } /*lint !e788*/
14464 
14465  /* release the CTRL-C interrupt */
14466  if( scip->set->misc_catchctrlc )
14468 
14469  /* stop solving timer */
14470  SCIPclockStop(scip->stat->solvingtime, scip->set);
14471  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
14472 
14473  if( scip->set->stage == SCIP_STAGE_SOLVED )
14474  {
14475  /* display most relevant statistics */
14477  }
14478 
14479  return SCIP_OKAY;
14480 }
14481 
14482 /** transforms, presolves, and solves problem
14483  *
14484  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
14485  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
14486  *
14487  * @pre This method can be called if @p scip is in one of the following stages:
14488  * - \ref SCIP_STAGE_PROBLEM
14489  * - \ref SCIP_STAGE_TRANSFORMED
14490  * - \ref SCIP_STAGE_PRESOLVING
14491  * - \ref SCIP_STAGE_PRESOLVED
14492  * - \ref SCIP_STAGE_SOLVING
14493  * - \ref SCIP_STAGE_SOLVED
14494  *
14495  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
14496  * process was interrupted:
14497  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
14498  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
14499  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
14500  *
14501  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
14502  */
14504  SCIP* scip /**< SCIP data structure */
14505  )
14506 {
14507  SCIP_Bool statsprinted = FALSE;
14508  SCIP_Bool restart;
14509 
14510  SCIP_CALL( checkStage(scip, "SCIPsolve", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
14511 
14512  /* if the stage is already SCIP_STAGE_SOLVED do nothing */
14513  if( scip->set->stage == SCIP_STAGE_SOLVED )
14514  return SCIP_OKAY;
14515 
14517  {
14518  SCIPwarningMessage(scip, "SCIPsolve() was called, but problem is already solved\n");
14519  return SCIP_OKAY;
14520  }
14521 
14522  /* check, if a node selector exists */
14523  if( SCIPsetGetNodesel(scip->set, scip->stat) == NULL )
14524  {
14525  SCIPerrorMessage("no node selector available\n");
14526  return SCIP_PLUGINNOTFOUND;
14527  }
14528 
14529  /* check, if a integrality constraint handler exists if there are integral variables */
14530  if( (SCIPgetNBinVars(scip) >= 0 || SCIPgetNIntVars(scip) >= 0) && SCIPfindConshdlr(scip, "integral") == NULL )
14531  {
14532  SCIPwarningMessage(scip, "integrality constraint handler not available\n");
14533  }
14534 
14535  /* initialize presolving flag (may be modified in SCIPpresolve()) */
14536  scip->stat->performpresol = FALSE;
14537 
14538  /* start solving timer */
14539  SCIPclockStart(scip->stat->solvingtime, scip->set);
14540  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
14541 
14542  /* capture the CTRL-C interrupt */
14543  if( scip->set->misc_catchctrlc )
14545 
14546  /* reset the user interrupt flag */
14547  scip->stat->userinterrupt = FALSE;
14548 
14549  /* automatic restarting loop */
14550  restart = scip->stat->userrestart;
14551 
14552  do
14553  {
14554  if( restart )
14555  {
14556  /* free the solving process data in order to restart */
14557  assert(scip->set->stage == SCIP_STAGE_SOLVING);
14558  if( scip->stat->userrestart )
14560  "(run %d, node %" SCIP_LONGINT_FORMAT ") performing user restart\n",
14561  scip->stat->nruns, scip->stat->nnodes, scip->stat->nrootintfixingsrun);
14562  else
14564  "(run %d, node %" SCIP_LONGINT_FORMAT ") restarting after %d global fixings of integer variables\n",
14565  scip->stat->nruns, scip->stat->nnodes, scip->stat->nrootintfixingsrun);
14566  /* an extra blank line should be printed separately since the buffer message handler only handles up to one line
14567  * correctly */
14569  SCIP_CALL( freeSolve(scip, TRUE) );
14570  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
14571  }
14572  restart = FALSE;
14573  scip->stat->userrestart = FALSE;
14574 
14575  switch( scip->set->stage )
14576  {
14577  case SCIP_STAGE_PROBLEM:
14579  case SCIP_STAGE_PRESOLVING:
14580  /* initialize solving data structures, transform and problem */
14581  SCIP_CALL( SCIPpresolve(scip) );
14582 
14583  /* remember that we already printed the relevant statistics */
14584  if( scip->set->stage == SCIP_STAGE_SOLVED )
14585  statsprinted = TRUE;
14586 
14587  if( scip->set->reopt_enable )
14588  {
14589  /* currently reoptimization works for (mixed) binary problems only. hence, we have to disable reoptimization
14590  * if there exist integer variables after presolving
14591  */
14592  if( scip->transprob->nintvars > 0 )
14593  {
14594  if( SCIPisParamFixed(scip, "reoptimization/enable") )
14595  {
14596  SCIP_CALL( SCIPunfixParam(scip, "reoptimization/enable") );
14597  }
14598  SCIP_CALL( SCIPsetBoolParam(scip, "reoptimization/enable", FALSE) );
14599 
14600  SCIPwarningMessage(scip, "reoptimization needs to be disabled because the problem contains %d general "
14601  "integer variables after presolving.\n", scip->transprob->nintvars);
14602  }
14603 
14604  /* it could happen that we need to disable reoptimization
14605  *
14606  * @note this can only happen in the current (3.2) and the upcomming bugfix release (3.2.1).
14607  *
14608  * @note in the next major release reoptimization will be available for general MIPs.
14609  */
14610  if( scip->set->reopt_enable )
14611  {
14612  /* increase number of reopt_runs */
14613  ++scip->stat->nreoptruns;
14614 
14615  /* inform the reoptimization plugin that a new iteration starts */
14616  SCIP_CALL( SCIPreoptAddRun(scip->reopt, scip->set, scip->mem->probmem, scip->transprob->vars,
14617  scip->transprob->nvars, scip->set->limit_maxsol) );
14618  }
14619  }
14620 
14621  if( scip->set->stage == SCIP_STAGE_SOLVED || scip->set->stage == SCIP_STAGE_PRESOLVING )
14622  break;
14623  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
14624 
14625  /*lint -fallthrough*/
14626 
14627  case SCIP_STAGE_PRESOLVED:
14628  /* check if reoptimization is enabled and global constraints are saved */
14629  if( scip->stat->nreoptruns > 1 && scip->set->reopt_enable )
14630  {
14631  SCIP_Bool reoptrestart;
14632  /* @ todo: we could check if the problem is feasible, eg, by backtracking */
14633 
14634  SCIP_CALL( SCIPreoptCheckRestart(scip->reopt, scip->set, scip->mem->probmem, NULL, scip->transprob->vars,
14635  scip->transprob->nvars, &reoptrestart) );
14636 
14637  if( scip->set->reopt_sepaglbinfsubtrees || scip->set->reopt_sepabestsol )
14638  {
14639  SCIP_CALL( SCIPreoptApplyGlbConss(scip, scip->reopt, scip->set, scip->stat, scip->mem->probmem) );
14640  }
14641  }
14642 
14643  /* try to compress the search tree if reoptimization is enabled */
14644  if( scip->set->reopt_enable && scip->set->compr_enable )
14645  {
14646  SCIP_CALL( compressReoptTree(scip) );
14647  }
14648 
14649  /* initialize solving process data structures */
14650  SCIP_CALL( initSolve(scip, FALSE) );
14651  assert(scip->set->stage == SCIP_STAGE_SOLVING);
14653 
14654  /*lint -fallthrough*/
14655 
14656  case SCIP_STAGE_SOLVING:
14657  /* reset display */
14658  SCIPstatResetDisplay(scip->stat);
14659 
14660  /* continue solution process */
14661  SCIP_CALL( SCIPsolveCIP(scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->mem, scip->origprob, scip->transprob,
14662  scip->primal, scip->tree, scip->reopt, scip->lp, scip->relaxation, scip->pricestore, scip->sepastore,
14663  scip->cutpool, scip->delayedcutpool, scip->branchcand, scip->conflict, scip->eventfilter, scip->eventqueue, scip->cliquetable, &restart) );
14664 
14665  /* detect, whether problem is solved */
14666  if( SCIPtreeGetNNodes(scip->tree) == 0 && SCIPtreeGetCurrentNode(scip->tree) == NULL )
14667  {
14668  assert(scip->stat->status == SCIP_STATUS_OPTIMAL
14669  || scip->stat->status == SCIP_STATUS_INFEASIBLE
14670  || scip->stat->status == SCIP_STATUS_UNBOUNDED
14671  || scip->stat->status == SCIP_STATUS_INFORUNBD);
14672  assert(!restart);
14673 
14674  /* tree is empty, and no current node exists -> problem is solved */
14675  scip->set->stage = SCIP_STAGE_SOLVED;
14676  }
14677  break;
14678 
14679  case SCIP_STAGE_SOLVED:
14680  assert(scip->stat->status == SCIP_STATUS_OPTIMAL
14681  || scip->stat->status == SCIP_STATUS_INFEASIBLE
14682  || scip->stat->status == SCIP_STATUS_UNBOUNDED
14683  || scip->stat->status == SCIP_STATUS_INFORUNBD);
14684 
14685  break;
14686 
14687  default:
14688  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
14689  return SCIP_INVALIDCALL;
14690  } /*lint !e788*/
14691  }
14692  while( restart && !SCIPsolveIsStopped(scip->set, scip->stat, TRUE) );
14693 
14694  /* we have to store all unprocessed nodes if reoptimization is enabled */
14695  if( scip->set->reopt_enable && scip->set->stage != SCIP_STAGE_PRESOLVING && scip->set->stage != SCIP_STAGE_SOLVED
14696  && SCIPsolveIsStopped(scip->set, scip->stat, TRUE) && SCIPgetNNodesLeft(scip) > 0 )
14697  {
14698  SCIP_NODE** leaves;
14699  SCIP_NODE** children;
14700  SCIP_NODE** siblings;
14701  int nleaves;
14702  int nchildren;
14703  int nsiblings;
14704 
14705  /* get all open leave nodes */
14706  SCIP_CALL( SCIPgetLeaves(scip, &leaves, &nleaves) );
14707 
14708  /* get all open children nodes */
14709  SCIP_CALL( SCIPgetChildren(scip, &children, &nchildren) );
14710 
14711  /* get all open sibling nodes */
14712  SCIP_CALL( SCIPgetSiblings(scip, &siblings, &nsiblings) );
14713 
14714  /* add all open node to the reoptimization tree */
14715  SCIP_CALL( SCIPreoptSaveOpenNodes(scip->reopt, scip->set, scip->mem->probmem, leaves, nleaves, children, nchildren, siblings, nsiblings) );
14716  }
14717 
14718  /* release the CTRL-C interrupt */
14719  if( scip->set->misc_catchctrlc )
14721 
14722  if( scip->set->reopt_enable )
14723  {
14724  /* save found solutions */
14725  int nsols;
14726  int s;
14727 
14728  nsols = scip->set->reopt_savesols == -1 ? INT_MAX : MAX(scip->set->reopt_savesols, 1);
14729  nsols = MIN(scip->primal->nsols, nsols);
14730 
14731  for( s = 0; s < nsols; s++ )
14732  {
14733  SCIP_SOL* sol;
14734  SCIP_Bool added;
14735 
14736  sol = scip->primal->sols[s];
14737  assert(sol != NULL);
14738 
14739  if( !SCIPsolIsOriginal(sol) )
14740  {
14741  SCIP_Bool hasinfval;
14742 
14743  /* retransform solution into the original problem space */
14744  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
14745  }
14746 
14747  if( SCIPsolGetNodenum(sol) > 0 || SCIPsolGetHeur(sol) != NULL || (s == 0 && scip->set->reopt_sepabestsol) )
14748  {
14749  /* if the best solution should be separated, we must not store it in the solution tree */
14750  if( s == 0 && scip->set->reopt_sepabestsol )
14751  {
14752  SCIP_CALL( SCIPreoptAddOptSol(scip->reopt, sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal) );
14753  }
14754  /* add solution to solution tree */
14755  else
14756  {
14757  SCIP_CALL( SCIPreoptAddSol(scip->reopt, scip->set, scip->stat, scip->origprimal, scip->mem->probmem,
14758  sol, s == 0, &added, scip->origprob->vars, scip->origprob->nvars, scip->stat->nreoptruns) );
14759  }
14760  }
14761  }
14762 
14763  SCIPdebugMessage("-> saved %d solution.\n", nsols);
14764  }
14765 
14766  /* stop solving timer */
14767  SCIPclockStop(scip->stat->solvingtime, scip->set);
14768  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
14769 
14770  /* decrease time limit during reoptimization */
14771  if( scip->set->reopt_enable && scip->set->reopt_commontimelimit )
14772  {
14773  SCIP_Real timelimit;
14774  SCIP_Real usedtime;
14775 
14776  SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
14777  usedtime = SCIPgetSolvingTime(scip);
14778  timelimit = timelimit - usedtime;
14779  timelimit = MAX(0, timelimit);
14780 
14781  SCIP_CALL( SCIPsetRealParam(scip, "limits/time", timelimit) );
14782  }
14783 
14784  if( !statsprinted )
14785  {
14786  /* display most relevant statistics */
14788  }
14789 
14790  return SCIP_OKAY;
14791 }
14792 
14793 /** include specific heuristics and branching rules for reoptimization
14794  *
14795  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
14796  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
14797  *
14798  * @pre This method can be called if @p scip is in one of the following stages:
14799  * - \ref SCIP_STAGE_PROBLEM
14800  */
14802  SCIP* scip, /**< SCIP data structure */
14803  SCIP_Bool enable /**< enable reoptimization (TRUE) or disable it (FALSE) */
14804  )
14805 {
14806  assert(scip != NULL);
14807 
14808  /* we want to skip if nothing has changed */
14809  if( (enable && scip->set->reopt_enable && scip->reopt != NULL)
14810  || (!enable && !scip->set->reopt_enable && scip->reopt == NULL) )
14811  return SCIP_OKAY;
14812 
14813  /* check stage and throw an error if we try to disable reoptimization during the solving process.
14814  *
14815  * @note the case that we will disable the reoptimization and have already performed presolving can only happen if
14816  * we are try to solve a general MIP
14817  *
14818  * @note this fix is only for the bugfix release 3.2.1, in the next major release reoptimization can be used for
14819  * general MIPs, too.
14820  */
14821  if( scip->set->stage > SCIP_STAGE_PROBLEM && !(!enable && scip->set->stage == SCIP_STAGE_PRESOLVED) )
14822  {
14823  SCIPerrorMessage("reoptimization cannot be %s after starting the (pre)solving process\n", enable ? "enabled" : "disabled");
14824  return SCIP_INVALIDCALL;
14825  }
14826 
14827  /* if the current stage is SCIP_STAGE_PROBLEM we have to include the heuristics and branching rule */
14828  if( scip->set->stage == SCIP_STAGE_PROBLEM || (!enable && scip->set->stage == SCIP_STAGE_PRESOLVED) )
14829  {
14830  /* initialize all reoptimization data structures */
14831  if( enable && scip->reopt == NULL )
14832  {
14833  SCIP_CALL( SCIPreoptCreate(&scip->reopt, scip->set, scip->mem->probmem) );
14835 
14836  assert(SCIPfindBranchrule(scip, "nodereopt") != NULL);
14837  }
14838  /* disable all reoptimization plugins and free the structure if necessary */
14839  else if( (!enable && scip->reopt != NULL) || (!enable && scip->set->reopt_enable && scip->reopt == NULL) )
14840  {
14841  if( scip->reopt != NULL )
14842  {
14843  SCIP_CALL( SCIPreoptFree(&(scip->reopt), scip->set, scip->origprimal, scip->mem->probmem) );
14844  assert(scip->reopt == NULL);
14845  }
14847  }
14848  }
14849 
14850  /* set enable flag */
14851  scip->set->reopt_enable = enable;
14852 
14853  return SCIP_OKAY;
14854 }
14855 
14856 /** save bound change based on dual information in the reoptimization tree
14857  *
14858  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
14859  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
14860  *
14861  * @pre This method can be called if @p scip is in one of the following stages:
14862  * - \ref SCIP_STAGE_SOLVING
14863  * - \ref SCIP_STAGE_SOLVED
14864  */
14866  SCIP* scip, /**< SCIP data structure */
14867  SCIP_NODE* node, /**< node of the search tree */
14868  SCIP_VAR* var, /**< variable whose bound changed */
14869  SCIP_Real newbound, /**< new bound of the variable */
14870  SCIP_Real oldbound /**< old bound of the variable */
14871  )
14872 {
14873  SCIP_CALL( checkStage(scip, "SCIPaddReoptDualBndchg", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
14874 
14875  assert(SCIPsetIsFeasLT(scip->set, newbound, oldbound) || SCIPsetIsFeasGT(scip->set, newbound, oldbound));
14876 
14877  SCIP_CALL( SCIPreoptAddDualBndchg(scip->reopt, scip->set, scip->mem->probmem, node, var, newbound, oldbound) );
14878 
14879  return SCIP_OKAY;
14880 }
14881 
14882 /** returns the optimal solution of the last iteration or NULL of none exists */
14884  SCIP* scip /**< SCIP data structure */
14885  )
14886 {
14887  SCIP_SOL* sol;
14888 
14889  assert(scip != NULL);
14890 
14891  sol = NULL;
14892 
14893  if( scip->set->reopt_enable && scip->stat->nreoptruns > 1 )
14894  {
14895  sol = SCIPreoptGetLastBestSol(scip->reopt);
14896  }
14897 
14898  return sol;
14899 }
14900 
14901 /** returns the objective coefficent of a given variable in a previous iteration
14902  *
14903  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
14904  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
14905  *
14906  * @pre This method can be called if @p scip is in one of the following stages:
14907  * - \ref SCIP_STAGE_PRESOLVING
14908  * - \ref SCIP_STAGE_SOLVING
14909  */
14911  SCIP* scip, /**< SCIP data structure */
14912  SCIP_VAR* var, /**< variable */
14913  int run, /**< number of the run */
14914  SCIP_Real* objcoef /**< pointer to store the objective coefficient */
14915  )
14916 {
14917  assert(scip != NULL);
14918  assert(var != NULL);
14919  assert(0 < run && run <= scip->stat->nreoptruns);
14920 
14921  SCIP_CALL( checkStage(scip, "SCIPgetReoptOldObjCoef", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
14922 
14923  if( !SCIPvarIsOriginal(var) )
14924  {
14925  assert(SCIPvarIsTransformed(var));
14926  *objcoef = SCIPreoptGetOldObjCoef(scip->reopt, run, SCIPvarGetProbindex(var));
14927  return SCIP_OKAY;
14928  }
14929  else
14930  {
14931  SCIP_VAR* transvar;
14932 
14933  assert(SCIPvarIsOriginal(var) || SCIPvarIsNegated(var));
14934  SCIP_CALL( SCIPvarGetTransformed(var, scip->mem->probmem, scip->set, scip->stat, &transvar) );
14935  assert(transvar != NULL);
14936  assert(SCIPvarIsActive(transvar));
14937 
14938  *objcoef = SCIPreoptGetOldObjCoef(scip->reopt, run, SCIPvarGetProbindex(transvar));
14939  return SCIP_OKAY;
14940  }
14941 }
14942 
14943 /** return the ids of child nodes stored in the reoptimization tree
14944  *
14945  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
14946  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
14947  *
14948  * @pre This method can be called if @p scip is in one of the following stages:
14949  * - \ref SCIP_STAGE_PRESOLVED
14950  * - \ref SCIP_STAGE_SOLVING
14951  * - \ref SCIP_STAGE_SOLVED
14952  */
14954  SCIP* scip, /**< SCIP data structure */
14955  SCIP_NODE* node, /**< node of the search tree */
14956  unsigned int* ids, /**< array of ids */
14957  int idssize, /**< allocated memory */
14958  int* nids /**< number of child nodes */
14959  )
14960 {
14961  assert(scip != NULL);
14962 
14963  SCIP_CALL( checkStage(scip, "SCIPgetReoptChildIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
14964 
14965  (*nids) = 0;
14966 
14967  if( !scip->set->reopt_enable )
14968  return SCIP_OKAY;
14969 
14970  SCIP_CALL( SCIPreoptGetChildIDs(scip->reopt, scip->set, scip->mem->probmem, node, ids, idssize, nids) );
14971 
14972  return SCIP_OKAY;
14973 }
14974 
14975 /** return the ids of all leave nodes store in the reoptimization tree induced by the given node
14976  *
14977  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
14978  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
14979  *
14980  * @pre This method can be called if @p scip is in one of the following stages:
14981  * - \ref SCIP_STAGE_PRESOLVED
14982  * - \ref SCIP_STAGE_SOLVING
14983  * - \ref SCIP_STAGE_SOLVED
14984  */
14986  SCIP* scip, /**< SCIP data structure */
14987  SCIP_NODE* node, /**< node of the search tree */
14988  unsigned int* ids, /**< array of ids */
14989  int idssize, /**< size of ids array */
14990  int* nids /**< number of child nodes */
14991  )
14992 {
14993  assert(scip != NULL);
14994 
14995  SCIP_CALL( checkStage(scip, "SCIPgetReoptLeaveIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
14996 
14997  (*nids) = 0;
14998 
14999  if( idssize == 0 || !scip->set->reopt_enable )
15000  return SCIP_OKAY;
15001 
15002  SCIP_CALL( SCIPreoptGetLeaves(scip->reopt, node, ids, idssize, nids) );
15003 
15004  return SCIP_OKAY;
15005 }
15006 
15007 /** returns the number of nodes in the reoptimization tree induced by @p node; if @p node == NULL the method
15008  * returns the number of nodes of the whole reoptimization tree.
15009  */
15011  SCIP* scip, /**< SCIP data structure */
15012  SCIP_NODE* node /**< node of the search tree */
15013  )
15014 {
15015  assert(scip != NULL);
15016  assert(scip->set->reopt_enable);
15017  assert(scip->reopt != NULL);
15018 
15019  return SCIPreoptGetNNodes(scip->reopt, node);
15020 }
15021 
15022 /** returns the number of leaf nodes of the subtree induced by @p node; if @p node == NULL, the method
15023  * returns the number of leaf nodes of the whole reoptimization tree.
15024  */
15026  SCIP* scip, /**< SCIP data structure */
15027  SCIP_NODE* node /**< node of the search tree */
15028  )
15029 {
15030  assert(scip != NULL);
15031  assert(scip->set->reopt_enable);
15032  assert(scip->reopt != NULL);
15033 
15034  return SCIPreoptGetNLeaves(scip->reopt, node);
15035 }
15036 
15037 /** gets the node of the reoptimization tree corresponding to the unique @p id */
15039  SCIP* scip, /**< SCIP data structure */
15040  unsigned int id /**< unique id */
15041  )
15042 {
15043  assert(scip != NULL);
15044  assert(scip->set->reopt_enable);
15045  assert(scip->reopt != NULL);
15046 
15047  return SCIPreoptGetReoptnode(scip->reopt, id);
15048 }
15049 
15050 /** add a variable bound change to a given reoptnode
15051  *
15052  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15053  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15054  *
15055  * @pre This method can be called if @p scip is in one of the following stages:
15056  * - \ref SCIP_STAGE_PRESOLVED
15057  * - \ref SCIP_STAGE_SOLVING
15058  * - \ref SCIP_STAGE_SOLVED
15059  */
15061  SCIP* scip, /**< SCIP data structure */
15062  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
15063  SCIP_VAR* var, /**< variable pointer */
15064  SCIP_Real val, /**< value of the variable */
15065  SCIP_BOUNDTYPE boundtype /**< bound type of the variable value */
15066  )
15067 {
15068  assert(scip != NULL);
15069  assert(reoptnode != NULL);
15070  assert(scip->set->reopt_enable);
15071  assert(scip->reopt != NULL);
15072 
15073  SCIP_CALL( checkStage(scip, "SCIPaddReoptnodeBndchg", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
15074 
15075  SCIP_CALL( SCIPreoptnodeAddBndchg(reoptnode, scip->mem->probmem, var, val, boundtype) );
15076 
15077  return SCIP_OKAY;
15078 }
15079 
15080 /** set the @p representation as the new search frontier
15081  *
15082  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15083  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15084  *
15085  * @pre This method can be called if @p scip is in one of the following stages:
15086  * - \ref SCIP_STAGE_PRESOLVED
15087  */
15089  SCIP* scip, /**< SCIP data structure */
15090  SCIP_REOPTNODE** representation, /**< array of representatives */
15091  int nrepresentatives, /**< number of representatives */
15092  SCIP_Bool* success /**< pointer to store the result */
15093  )
15094 {
15095  assert(scip != NULL);
15096  assert(representation != NULL);
15097  assert(nrepresentatives > 0);
15098  assert(scip->set->reopt_enable);
15099  assert(scip->reopt != NULL);
15100 
15101  SCIP_CALL( checkStage(scip, "SCIPsetReoptCompression", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
15102 
15103  SCIP_CALL( SCIPreoptApplyCompression(scip->reopt, scip->set, scip->mem->probmem, representation, nrepresentatives, success) );
15104 
15105  return SCIP_OKAY;
15106 }
15107 
15108 /** add stored constraint to a reoptimization node
15109  *
15110  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15111  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15112  *
15113  * @pre This method can be called if @p scip is in one of the following stages:
15114  * - \ref SCIP_STAGE_PRESOLVED
15115  */
15117  SCIP* scip, /**< SCIP data structure */
15118  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
15119  SCIP_VAR** vars, /**< array of variables */
15120  SCIP_Real* vals, /**< array of variable bounds */
15121  int nvars, /**< number of variables */
15122  REOPT_CONSTYPE constype /**< type of the constraint */
15123  )
15124 {
15125  assert(scip != NULL);
15126  assert(reoptnode != NULL);
15127  assert(vars != NULL);
15128  assert(vals != NULL);
15129  assert(nvars >= 0);
15130 
15131  SCIP_CALL( checkStage(scip, "SCIPaddReoptnodeCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
15132 
15133  SCIP_CALL( SCIPreoptnodeAddCons(reoptnode, scip->mem->probmem, vars, vals, nvars, constype) );
15134 
15135  return SCIP_OKAY;
15136 }
15137 
15138 /** return the branching path stored in the reoptree at ID id */
15140  SCIP* scip, /**< SCIP data structure */
15141  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
15142  SCIP_VAR** vars, /**< array of variables */
15143  SCIP_Real* vals, /**< array of variable bounds */
15144  SCIP_BOUNDTYPE* boundtypes, /**< array of bound types */
15145  int mem, /**< allocated memory */
15146  int* nvars, /**< number of variables */
15147  int* nafterdualvars /**< number of variables directly after the first based on dual information */
15148  )
15149 {
15150  assert(scip != NULL);
15151  assert(vars != NULL);
15152  assert(vals != NULL);
15153  assert(boundtypes != NULL);
15154  assert(scip->set->reopt_enable);
15155  assert(scip->reopt != NULL);
15156 
15157  SCIPreoptnodeGetPath(scip->reopt, reoptnode, vars, vals, boundtypes, mem, nvars, nafterdualvars);
15158 }
15159 
15160 /** initialize a set of empty reoptimization nodes
15161  *
15162  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15163  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15164  *
15165  * @pre This method can be called if @p scip is in one of the following stages:
15166  * - \ref SCIP_STAGE_PRESOLVED
15167  */
15169  SCIP* scip, /**< SCIP data structure */
15170  SCIP_REOPTNODE** representatives, /**< array of representatives */
15171  int nrepresentatives /**< number of representatives */
15172  )
15173 {
15174  int r;
15175 
15176  assert(scip != NULL);
15177  assert(representatives != NULL);
15178 
15179  SCIP_CALL( checkStage(scip, "SCIPinitRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
15180 
15181  for( r = 0; r < nrepresentatives; r++ )
15182  {
15183  SCIP_CALL( SCIPallocBlockMemory(scip, &representatives[r]) ); /*lint !e866*/
15184  SCIPreoptnodeInit(representatives[r], scip->set);
15185  }
15186 
15187  return SCIP_OKAY;
15188 }
15189 
15190 /** reset a set of initialized reoptimization nodes
15191  *
15192  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15193  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15194  *
15195  * @pre This method can be called if @p scip is in one of the following stages:
15196  * - \ref SCIP_STAGE_PRESOLVED
15197  */
15199  SCIP* scip, /**< SCIP data structure */
15200  SCIP_REOPTNODE** representatives, /**< array of representatives */
15201  int nrepresentatives /**< number of representatives */
15202  )
15203 {
15204  int r;
15205 
15206  assert(scip != NULL);
15207  assert(representatives != NULL);
15208 
15209  SCIP_CALL( checkStage(scip, "SCIPresetRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
15210 
15211  for( r = 0; r < nrepresentatives; r++ )
15212  {
15213  SCIP_CALL( SCIPreoptnodeReset(scip->reopt, scip->set, scip->mem->probmem, representatives[r]) );
15214  }
15215 
15216  return SCIP_OKAY;
15217 }
15218 
15219 /** free a set of initialized reoptimization nodes
15220  *
15221  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15222  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15223  *
15224  * @pre This method can be called if @p scip is in one of the following stages:
15225  * - \ref SCIP_STAGE_PRESOLVED
15226  */
15228  SCIP* scip, /**< SCIP data structure */
15229  SCIP_REOPTNODE** representatives, /**< array of representatives */
15230  int nrepresentatives /**< number of representatives */
15231  )
15232 {
15233  int r;
15234 
15235  assert(scip != NULL);
15236  assert(representatives != NULL);
15237 
15238  SCIP_CALL( checkStage(scip, "SCIPfreeRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
15239 
15240  for( r = 0; r < nrepresentatives; r++ )
15241  {
15242  if( representatives[r] != NULL )
15243  {
15244  SCIP_CALL( SCIPreoptnodeDelete(&representatives[r], scip->mem->probmem) );
15245  assert(representatives[r] == NULL);
15246  }
15247  }
15248 
15249  return SCIP_OKAY;
15250 }
15251 
15252 /** reactivate the given @p reoptnode and split them into several nodes if necessary
15253  *
15254  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15255  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15256  *
15257  * @pre This method can be called if @p scip is in one of the following stages:
15258  * - \ref SCIP_STAGE_SOLVING
15259  * - \ref SCIP_STAGE_SOLVED
15260  */
15262  SCIP* scip, /**< SCIP data structure */
15263  SCIP_REOPTNODE* reoptnode, /**< node to reactivate */
15264  unsigned int id, /**< unique id of the reoptimization node */
15265  SCIP_Real estimate, /**< estimate of the child nodes that should be created */
15266  SCIP_NODE** childnodes, /**< array to store the created child nodes */
15267  int* ncreatedchilds, /**< pointer to store number of created child nodes */
15268  int* naddedconss, /**< pointer to store number of generated constraints */
15269  int childnodessize, /**< available size of childnodes array */
15270  SCIP_Bool* success /**< pointer store the result*/
15271  )
15272 {
15273  assert(scip != NULL);
15274  assert(reoptnode != NULL);
15275 
15276  SCIP_CALL( checkStage(scip, "SCIPapplyReopt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
15277 
15278  SCIP_CALL( SCIPreoptApply(scip->reopt, scip, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
15279  scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, scip->mem->probmem,
15280  (unsigned int)scip->set->misc_permutationseed, reoptnode, id, estimate, childnodes, ncreatedchilds,
15281  naddedconss, childnodessize, success) );
15282 
15283  return SCIP_OKAY;
15284 }
15285 
15286 /** frees branch and bound tree and all solution process data; statistics, presolving data and transformed problem is
15287  * preserved
15288  *
15289  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15290  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15291  *
15292  * @pre This method can be called if @p scip is in one of the following stages:
15293  * - \ref SCIP_STAGE_INIT
15294  * - \ref SCIP_STAGE_PROBLEM
15295  * - \ref SCIP_STAGE_TRANSFORMED
15296  * - \ref SCIP_STAGE_PRESOLVING
15297  * - \ref SCIP_STAGE_PRESOLVED
15298  * - \ref SCIP_STAGE_SOLVING
15299  * - \ref SCIP_STAGE_SOLVED
15300  *
15301  * @post If this method is called in \SCIP stage \ref SCIP_STAGE_INIT or \ref SCIP_STAGE_PROBLEM, the stage of
15302  * \SCIP is not changed; otherwise, the \SCIP stage is changed to \ref SCIP_STAGE_TRANSFORMED
15303  *
15304  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
15305  */
15307  SCIP* scip, /**< SCIP data structure */
15308  SCIP_Bool restart /**< should certain data be preserved for improved restarting? */
15309  )
15310 {
15311  SCIP_CALL( checkStage(scip, "SCIPfreeSolve", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
15312 
15313  switch( scip->set->stage )
15314  {
15315  case SCIP_STAGE_INIT:
15316  case SCIP_STAGE_PROBLEM:
15318  return SCIP_OKAY;
15319 
15320  case SCIP_STAGE_PRESOLVING:
15321  {
15322  SCIP_Bool infeasible;
15323 
15324  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
15325  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
15326  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
15327  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
15328 
15329  /* exit presolving */
15330  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
15331  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15332  }
15333 
15334  /*lint -fallthrough*/
15335  case SCIP_STAGE_PRESOLVED:
15336  /* switch stage to TRANSFORMED */
15337  scip->set->stage = SCIP_STAGE_TRANSFORMED;
15338  return SCIP_OKAY;
15339 
15340  case SCIP_STAGE_SOLVING:
15341  case SCIP_STAGE_SOLVED:
15342  /* free solution process data structures */
15343  SCIP_CALL( freeSolve(scip, restart) );
15344  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
15345  return SCIP_OKAY;
15346 
15347  default:
15348  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
15349  return SCIP_INVALIDCALL;
15350  } /*lint !e788*/
15351 }
15352 
15353 /** frees all solution process data including presolving and transformed problem, only original problem is kept
15354  *
15355  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15356  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15357  *
15358  * @pre This method can be called if @p scip is in one of the following stages:
15359  * - \ref SCIP_STAGE_INIT
15360  * - \ref SCIP_STAGE_PROBLEM
15361  * - \ref SCIP_STAGE_TRANSFORMED
15362  * - \ref SCIP_STAGE_PRESOLVING
15363  * - \ref SCIP_STAGE_PRESOLVED
15364  * - \ref SCIP_STAGE_SOLVING
15365  * - \ref SCIP_STAGE_SOLVED
15366  *
15367  * @post After calling this method \SCIP reaches one of the following stages:
15368  * - \ref SCIP_STAGE_INIT if the method was called from \SCIP stage \ref SCIP_STAGE_INIT
15369  * - \ref SCIP_STAGE_PROBLEM if the method was called from any other of the allowed stages
15370  *
15371  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
15372  */
15374  SCIP* scip /**< SCIP data structure */
15375  )
15376 {
15377  SCIP_CALL( checkStage(scip, "SCIPfreeTransform", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
15378 
15379  switch( scip->set->stage )
15380  {
15381  case SCIP_STAGE_INIT:
15382  case SCIP_STAGE_PROBLEM:
15383  return SCIP_OKAY;
15384 
15385  case SCIP_STAGE_PRESOLVING:
15386  {
15387  SCIP_Bool infeasible;
15388 
15389  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
15390  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
15391  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
15392  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
15393 
15394  /* exit presolving */
15395  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
15396  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15397  }
15398 
15399  /*lint -fallthrough*/
15400  case SCIP_STAGE_PRESOLVED:
15401  case SCIP_STAGE_SOLVING:
15402  case SCIP_STAGE_SOLVED:
15403  /* free solution process data */
15404  SCIP_CALL( SCIPfreeSolve(scip, FALSE) );
15405  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
15406 
15407  /*lint -fallthrough*/
15408 
15410  /* free transformed problem data structures */
15411  SCIP_CALL( freeTransform(scip) );
15412  assert(scip->set->stage == SCIP_STAGE_PROBLEM);
15413  return SCIP_OKAY;
15414 
15415  default:
15416  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
15417  return SCIP_INVALIDCALL;
15418  } /*lint !e788*/
15419 }
15420 
15421 /** informs \SCIP that the solving process should be interrupted as soon as possible (e.g., after the current node has
15422  * been solved)
15423  *
15424  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15425  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15426  *
15427  * @pre This method can be called if @p scip is in one of the following stages:
15428  * - \ref SCIP_STAGE_PROBLEM
15429  * - \ref SCIP_STAGE_TRANSFORMING
15430  * - \ref SCIP_STAGE_TRANSFORMED
15431  * - \ref SCIP_STAGE_INITPRESOLVE
15432  * - \ref SCIP_STAGE_PRESOLVING
15433  * - \ref SCIP_STAGE_EXITPRESOLVE
15434  * - \ref SCIP_STAGE_PRESOLVED
15435  * - \ref SCIP_STAGE_SOLVING
15436  * - \ref SCIP_STAGE_SOLVED
15437  * - \ref SCIP_STAGE_EXITSOLVE
15438  * - \ref SCIP_STAGE_FREETRANS
15439  *
15440  * @note the \SCIP stage does not get changed
15441  */
15443  SCIP* scip /**< SCIP data structure */
15444  )
15445 {
15446  SCIP_CALL( checkStage(scip, "SCIPinterruptSolve", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE) );
15447 
15448  /* set the userinterrupt flag */
15449  scip->stat->userinterrupt = TRUE;
15450 
15451  return SCIP_OKAY;
15452 }
15453 
15454 /** informs SCIP that the solving process should be restarted as soon as possible (e.g., after the current node has
15455  * been solved)
15456  *
15457  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15458  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15459  *
15460  * @pre This method can be called if @p scip is in one of the following stages:
15461  * - \ref SCIP_STAGE_INITPRESOLVE
15462  * - \ref SCIP_STAGE_PRESOLVING
15463  * - \ref SCIP_STAGE_EXITPRESOLVE
15464  * - \ref SCIP_STAGE_SOLVING
15465  *
15466  * @note the \SCIP stage does not get changed
15467  */
15469  SCIP* scip /**< SCIP data structure */
15470  )
15471 {
15472  SCIP_CALL( checkStage(scip, "SCIPrestartSolve", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
15473 
15474  /* set the userrestart flag */
15475  scip->stat->userrestart = TRUE;
15476 
15477  return SCIP_OKAY;
15478 }
15479 
15480 /** returns whether reoptimization is enabled or not */
15482  SCIP* scip /**< SCIP data structure */
15483  )
15484 {
15485  assert(scip != NULL);
15486 
15487  return scip->set->reopt_enable;
15488 }
15489 
15490 /** returns the stored solutions corresponding to a given run */
15492  SCIP* scip, /**< SCIP data structure */
15493  int run, /**< number of the run */
15494  SCIP_SOL** sols, /**< array to store solutions */
15495  int solssize, /**< size of the array */
15496  int* nsols /**< pointer to store number of solutions */
15497  )
15498 {
15499  assert(scip != NULL);
15500  assert(sols != NULL);
15501  assert(solssize > 0);
15502 
15503  if( scip->set->reopt_enable )
15504  {
15505  assert(run > 0 && run <= scip->stat->nreoptruns);
15506  SCIP_CALL( SCIPreoptGetSolsRun(scip->reopt, run, sols, solssize, nsols) );
15507  }
15508  else
15509  {
15510  *nsols = 0;
15511  }
15512 
15513  return SCIP_OKAY;
15514 }
15515 
15516 /** mark all stored solutions as not updated */
15518  SCIP* scip /**< SCIP data structure */
15519  )
15520 {
15521  assert(scip != NULL);
15522  assert(scip->set->reopt_enable);
15523  assert(scip->reopt != NULL);
15524 
15525  if( scip->set->reopt_enable )
15526  {
15527  assert(scip->reopt != NULL);
15529  }
15530 }
15531 
15532 /** check if the reoptimization process should be restarted
15533  *
15534  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15535  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15536  *
15537  * @pre This method can be called if @p scip is in one of the following stages:
15538  * - \ref SCIP_STAGE_TRANSFORMED
15539  * - \ref SCIP_STAGE_SOLVING
15540  */
15542  SCIP* scip, /**< SCIP data structure */
15543  SCIP_NODE* node, /**< current node of the branch and bound tree (or NULL) */
15544  SCIP_Bool* restart /**< pointer to store of the reoptimitation process should be restarted */
15545  )
15546 {
15547  assert(scip != NULL);
15548  assert(scip->set->reopt_enable);
15549  assert(scip->reopt != NULL);
15550 
15551  SCIP_CALL( checkStage(scip, "SCIPcheckReoptRestart", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
15552 
15553  SCIP_CALL( SCIPreoptCheckRestart(scip->reopt, scip->set, scip->mem->probmem, node, scip->transprob->vars,
15554  scip->transprob->nvars, restart) );
15555 
15556  return SCIP_OKAY;
15557 }
15558 
15559 /** return the similarity between two objective functions */
15561  SCIP* scip, /**< SCIP data structure */
15562  int run1, /**< number of run */
15563  int run2 /**< number of run */
15564  )
15565 {
15566  assert(scip != NULL);
15567  assert(run1 > 0 && run1 <= scip->stat->nreoptruns);
15568  assert(run2 > 0 && run2 <= scip->stat->nreoptruns);
15569 
15570  if( run1 == scip->stat->nreoptruns && run2 == run1-1 )
15571  return SCIPreoptGetSimToPrevious(scip->reopt);
15572  else
15573  return SCIPreoptGetSimilarity(scip->reopt, scip->set, run1, run2, scip->transprob->vars, scip->transprob->nvars);
15574 }
15575 
15576 /** returns if a node should be reoptimized */
15578  SCIP* scip, /**< SCIP data structure */
15579  SCIP_NODE* node /**< node of the search tree */
15580  )
15581 {
15582  assert(scip != NULL);
15583  assert(node != NULL);
15584 
15585  if( scip->set->reopt_enable )
15586  {
15587  SCIP_REOPTNODE* reoptnode;
15588  unsigned int id;
15589 
15590  assert(scip->reopt != NULL);
15591 
15592  id = SCIPnodeGetReoptID(node);
15593 
15594  if( id == 0 && node != SCIPgetRootNode(scip) )
15595  return FALSE;
15596  else
15597  {
15598  reoptnode = SCIPgetReoptnode(scip, id);
15599  assert(reoptnode != NULL);
15600 
15601  return SCIPreoptnodeGetNChildren(reoptnode) > 0;
15602  }
15603  }
15604  else
15605  return FALSE;
15606 }
15607 
15608 /** deletes the given reoptimization node
15609  *
15610  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15611  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15612  *
15613  * @pre This method can be called if @p scip is in one of the following stages:
15614  * - \ref SCIP_STAGE_TRANSFORMED
15615  * - \ref SCIP_STAGE_SOLVING
15616  */
15618  SCIP* scip, /**< SCIP data structure */
15619  SCIP_REOPTNODE** reoptnode /**< node of the reoptimization tree */
15620  )
15621 {
15622  assert(scip != NULL);
15623  assert(scip->set->reopt_enable);
15624  assert(scip->reopt != NULL);
15625  assert((*reoptnode) != NULL);
15626 
15627  SCIP_CALL( checkStage(scip, "SCIPdeleteReoptnode", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
15628 
15629  SCIP_CALL( SCIPreoptnodeDelete(reoptnode, scip->mem->probmem) );
15630 
15631  return SCIP_OKAY;
15632 }
15633 
15634 /** splits the root into several nodes and moves the child nodes of the root to one of the created nodes
15635  *
15636  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15637  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15638  *
15639  * @pre This method can be called if @p scip is in one of the following stages:
15640  * - \ref SCIP_STAGE_SOLVING
15641  */
15643  SCIP* scip, /**< SCIP data structure */
15644  int* ncreatedchilds, /**< pointer to store the number of created nodes */
15645  int* naddedconss /**< pointer to store the number added constraints */
15646  )
15647 {
15648  assert(scip != NULL);
15649  assert(scip->set->reopt_enable);
15650  assert(scip->reopt != NULL);
15651 
15652  SCIP_CALL( checkStage(scip, "SCIPsplitReoptRoot", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
15653 
15654  SCIP_CALL( SCIPreoptSplitRoot(scip->reopt, scip->tree, scip->set, scip->mem->probmem,
15655  (unsigned int)scip->set->misc_permutationseed, ncreatedchilds, naddedconss) );
15656 
15657  return SCIP_OKAY;
15658 }
15659 
15660 /** remove the stored information about bound changes based in dual information
15661  *
15662  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15663  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15664  *
15665  * @pre This method can be called if @p scip is in one of the following stages:
15666  * - \ref SCIP_STAGE_SOLVING
15667  * - \ref SCIP_STAGE_SOLVED
15668  */
15670  SCIP* scip, /**< SCIP data structure */
15671  SCIP_NODE* node /**< node of the search tree */
15672  )
15673 {
15674  assert(scip != NULL);
15675  assert(scip->set->reopt_enable);
15676  assert(node != NULL);
15677 
15678  SCIP_CALL( checkStage(scip, "SCIPresetReoptnodeDualcons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
15679 
15680  SCIP_CALL( SCIPreoptResetDualBndchgs(scip->reopt, node, scip->mem->probmem) );
15681 
15682  return SCIP_OKAY;
15683 }
15684 
15685 /** returns whether we are in the restarting phase
15686  *
15687  * @return TRUE, if we are in the restarting phase; FALSE, otherwise
15688  *
15689  * @pre This method can be called if @p scip is in one of the following stages:
15690  * - \ref SCIP_STAGE_INITPRESOLVE
15691  * - \ref SCIP_STAGE_PRESOLVING
15692  * - \ref SCIP_STAGE_EXITPRESOLVE
15693  * - \ref SCIP_STAGE_PRESOLVED
15694  * - \ref SCIP_STAGE_INITSOLVE
15695  * - \ref SCIP_STAGE_SOLVING
15696  * - \ref SCIP_STAGE_SOLVED
15697  * - \ref SCIP_STAGE_EXITSOLVE
15698  * - \ref SCIP_STAGE_FREETRANS
15699  */
15701  SCIP* scip /**< SCIP data structure */
15702  )
15703 {
15704  SCIP_CALL_ABORT( checkStage(scip, "SCIPisInRestart", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
15705 
15706  /* return the restart status */
15707  return scip->stat->inrestart;
15708 }
15709 
15710 
15711 /*
15712  * variable methods
15713  */
15714 
15715 /** creates and captures problem variable; if variable is of integral type, fractional bounds are automatically rounded;
15716  * an integer variable with bounds zero and one is automatically converted into a binary variable;
15717  *
15718  * @warning When doing column generation and the original problem is a maximization problem, notice that SCIP will
15719  * transform the problem into a minimization problem by multiplying the objective function by -1. Thus, the
15720  * original objective function value of variables created during the solving process has to be multiplied by
15721  * -1, too.
15722  *
15723  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15724  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15725  *
15726  * @pre This method can be called if @p scip is in one of the following stages:
15727  * - \ref SCIP_STAGE_PROBLEM
15728  * - \ref SCIP_STAGE_TRANSFORMING
15729  * - \ref SCIP_STAGE_INITPRESOLVE
15730  * - \ref SCIP_STAGE_PRESOLVING
15731  * - \ref SCIP_STAGE_EXITPRESOLVE
15732  * - \ref SCIP_STAGE_PRESOLVED
15733  * - \ref SCIP_STAGE_SOLVING
15734  *
15735  * @note the variable gets captured, hence at one point you have to release it using the method SCIPreleaseVar()
15736  */
15738  SCIP* scip, /**< SCIP data structure */
15739  SCIP_VAR** var, /**< pointer to variable object */
15740  const char* name, /**< name of variable, or NULL for automatic name creation */
15741  SCIP_Real lb, /**< lower bound of variable */
15742  SCIP_Real ub, /**< upper bound of variable */
15743  SCIP_Real obj, /**< objective function value */
15744  SCIP_VARTYPE vartype, /**< type of variable */
15745  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
15746  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
15747  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable, or NULL */
15748  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data, or NULL */
15749  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable, or NULL */
15750  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
15751  SCIP_VARDATA* vardata /**< user data for this specific variable */
15752  )
15753 {
15754  assert(var != NULL);
15755  assert(lb <= ub);
15756 
15757  SCIP_CALL( checkStage(scip, "SCIPcreateVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
15758 
15759  /* forbid infinite objective function values */
15760  if( SCIPisInfinity(scip, REALABS(obj)) )
15761  {
15762  SCIPerrorMessage("invalid objective function value: value is infinite\n");
15763  return SCIP_INVALIDDATA;
15764  }
15765 
15766  switch( scip->set->stage )
15767  {
15768  case SCIP_STAGE_PROBLEM:
15769  SCIP_CALL( SCIPvarCreateOriginal(var, scip->mem->probmem, scip->set, scip->stat,
15770  name, lb, ub, obj, vartype, initial, removable, vardelorig, vartrans, vardeltrans, varcopy, vardata) );
15771  break;
15772 
15775  case SCIP_STAGE_PRESOLVING:
15777  case SCIP_STAGE_PRESOLVED:
15778  case SCIP_STAGE_SOLVING:
15779  SCIP_CALL( SCIPvarCreateTransformed(var, scip->mem->probmem, scip->set, scip->stat,
15780  name, lb, ub, obj, vartype, initial, removable, vardelorig, vartrans, vardeltrans, varcopy, vardata) );
15781  break;
15782 
15783  default:
15784  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
15785  return SCIP_INVALIDCALL;
15786  } /*lint !e788*/
15787 
15788  return SCIP_OKAY;
15789 }
15790 
15791 /** creates and captures problem variable with optional callbacks and variable data set to NULL, which can be set
15792  * afterwards using SCIPvarSetDelorigData(), SCIPvarSetTransData(),
15793  * SCIPvarSetDeltransData(), SCIPvarSetCopy(), and SCIPvarSetData(); sets variable flags initial=TRUE
15794  * and removable = FALSE, which can be adjusted by using SCIPvarSetInitial() and SCIPvarSetRemovable(), resp.;
15795  * if variable is of integral type, fractional bounds are automatically rounded;
15796  * an integer variable with bounds zero and one is automatically converted into a binary variable;
15797  *
15798  * @warning When doing column generation and the original problem is a maximization problem, notice that SCIP will
15799  * transform the problem into a minimization problem by multiplying the objective function by -1. Thus, the
15800  * original objective function value of variables created during the solving process has to be multiplied by
15801  * -1, too.
15802  *
15803  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15804  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15805  *
15806  * @pre This method can be called if @p scip is in one of the following stages:
15807  * - \ref SCIP_STAGE_PROBLEM
15808  * - \ref SCIP_STAGE_TRANSFORMING
15809  * - \ref SCIP_STAGE_INITPRESOLVE
15810  * - \ref SCIP_STAGE_PRESOLVING
15811  * - \ref SCIP_STAGE_EXITPRESOLVE
15812  * - \ref SCIP_STAGE_PRESOLVED
15813  * - \ref SCIP_STAGE_SOLVING
15814  *
15815  * @note the variable gets captured, hence at one point you have to release it using the method SCIPreleaseVar()
15816  */
15818  SCIP* scip, /**< SCIP data structure */
15819  SCIP_VAR** var, /**< pointer to variable object */
15820  const char* name, /**< name of variable, or NULL for automatic name creation */
15821  SCIP_Real lb, /**< lower bound of variable */
15822  SCIP_Real ub, /**< upper bound of variable */
15823  SCIP_Real obj, /**< objective function value */
15824  SCIP_VARTYPE vartype /**< type of variable */
15825  )
15826 {
15827  SCIP_CALL( checkStage(scip, "SCIPcreateVarBasic", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
15828 
15829  SCIP_CALL( SCIPcreateVar(scip, var, name, lb, ub, obj, vartype, TRUE, FALSE, NULL, NULL, NULL, NULL, NULL) );
15830 
15831  return SCIP_OKAY;
15832 }
15833 
15834 /** outputs the variable name to the file stream
15835  *
15836  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15837  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15838  *
15839  * @pre This method can be called if @p scip is in one of the following stages:
15840  * - \ref SCIP_STAGE_PROBLEM
15841  * - \ref SCIP_STAGE_TRANSFORMING
15842  * - \ref SCIP_STAGE_TRANSFORMED
15843  * - \ref SCIP_STAGE_INITPRESOLVE
15844  * - \ref SCIP_STAGE_PRESOLVING
15845  * - \ref SCIP_STAGE_EXITPRESOLVE
15846  * - \ref SCIP_STAGE_PRESOLVED
15847  * - \ref SCIP_STAGE_INITSOLVE
15848  * - \ref SCIP_STAGE_SOLVING
15849  * - \ref SCIP_STAGE_SOLVED
15850  * - \ref SCIP_STAGE_EXITSOLVE
15851  * - \ref SCIP_STAGE_FREETRANS
15852  */
15854  SCIP* scip, /**< SCIP data structure */
15855  FILE* file, /**< output file, or NULL for stdout */
15856  SCIP_VAR* var, /**< variable to output */
15857  SCIP_Bool type /**< should the variable type be also posted */
15858  )
15859 {
15860  assert(scip != NULL);
15861  assert(var != NULL);
15862 
15863  SCIP_CALL( checkStage(scip, "SCIPwriteVarName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
15864 
15865  /* print variable name */
15866  if( SCIPvarIsNegated(var) )
15867  {
15868  SCIP_VAR* negatedvar;
15869 
15870  SCIP_CALL( SCIPgetNegatedVar(scip, var, &negatedvar) );
15871  SCIPinfoMessage(scip, file, "<~%s>", SCIPvarGetName(negatedvar));
15872  }
15873  else
15874  {
15875  SCIPinfoMessage(scip, file, "<%s>", SCIPvarGetName(var));
15876  }
15877 
15878  if( type )
15879  {
15880  /* print variable type */
15881  SCIPinfoMessage(scip, file, "[%c]",
15885  }
15886 
15887  return SCIP_OKAY;
15888 }
15889 
15890 /** print the given list of variables to output stream separated by the given delimiter character;
15891  *
15892  * i. e. the variables x1, x2, ..., xn with given delimiter ',' are written as: <x1>, <x2>, ..., <xn>;
15893  *
15894  * the method SCIPparseVarsList() can parse such a string
15895  *
15896  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15897  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15898  *
15899  * @pre This method can be called if @p scip is in one of the following stages:
15900  * - \ref SCIP_STAGE_PROBLEM
15901  * - \ref SCIP_STAGE_TRANSFORMING
15902  * - \ref SCIP_STAGE_TRANSFORMED
15903  * - \ref SCIP_STAGE_INITPRESOLVE
15904  * - \ref SCIP_STAGE_PRESOLVING
15905  * - \ref SCIP_STAGE_EXITPRESOLVE
15906  * - \ref SCIP_STAGE_PRESOLVED
15907  * - \ref SCIP_STAGE_INITSOLVE
15908  * - \ref SCIP_STAGE_SOLVING
15909  * - \ref SCIP_STAGE_SOLVED
15910  * - \ref SCIP_STAGE_EXITSOLVE
15911  * - \ref SCIP_STAGE_FREETRANS
15912  *
15913  * @note The printing process is done via the message handler system.
15914  */
15916  SCIP* scip, /**< SCIP data structure */
15917  FILE* file, /**< output file, or NULL for stdout */
15918  SCIP_VAR** vars, /**< variable array to output */
15919  int nvars, /**< number of variables */
15920  SCIP_Bool type, /**< should the variable type be also posted */
15921  char delimiter /**< character which is used for delimitation */
15922  )
15923 {
15924  int v;
15925 
15926  SCIP_CALL( checkStage(scip, "SCIPwriteVarsList", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
15927 
15928  for( v = 0; v < nvars; ++v )
15929  {
15930  if( v > 0 )
15931  {
15932  SCIPinfoMessage(scip, file, "%c", delimiter);
15933  }
15934 
15935  /* print variable name */
15936  SCIP_CALL( SCIPwriteVarName(scip, file, vars[v], type) );
15937  }
15938 
15939  return SCIP_OKAY;
15940 }
15941 
15942 /** print the given variables and coefficients as linear sum in the following form
15943  * c1 <x1> + c2 <x2> ... + cn <xn>
15944  *
15945  * This string can be parsed by the method SCIPparseVarsLinearsum().
15946  *
15947  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15948  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15949  *
15950  * @pre This method can be called if @p scip is in one of the following stages:
15951  * - \ref SCIP_STAGE_PROBLEM
15952  * - \ref SCIP_STAGE_TRANSFORMING
15953  * - \ref SCIP_STAGE_TRANSFORMED
15954  * - \ref SCIP_STAGE_INITPRESOLVE
15955  * - \ref SCIP_STAGE_PRESOLVING
15956  * - \ref SCIP_STAGE_EXITPRESOLVE
15957  * - \ref SCIP_STAGE_PRESOLVED
15958  * - \ref SCIP_STAGE_INITSOLVE
15959  * - \ref SCIP_STAGE_SOLVING
15960  * - \ref SCIP_STAGE_SOLVED
15961  * - \ref SCIP_STAGE_EXITSOLVE
15962  * - \ref SCIP_STAGE_FREETRANS
15963  *
15964  * @note The printing process is done via the message handler system.
15965  */
15967  SCIP* scip, /**< SCIP data structure */
15968  FILE* file, /**< output file, or NULL for stdout */
15969  SCIP_VAR** vars, /**< variable array to output */
15970  SCIP_Real* vals, /**< array of coefficients or NULL if all coefficients are 1.0 */
15971  int nvars, /**< number of variables */
15972  SCIP_Bool type /**< should the variable type be also posted */
15973  )
15974 {
15975  int v;
15976 
15977  SCIP_CALL( checkStage(scip, "SCIPwriteVarsLinearsum", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
15978 
15979  for( v = 0; v < nvars; ++v )
15980  {
15981  if( vals != NULL )
15982  {
15983  if( vals[v] == 1.0 )
15984  {
15985  if( v > 0 )
15986  SCIPinfoMessage(scip, file, " +");
15987  }
15988  else if( vals[v] == -1.0 )
15989  SCIPinfoMessage(scip, file, " -");
15990  else
15991  SCIPinfoMessage(scip, file, " %+.15g", vals[v]);
15992  }
15993  else if( nvars > 0 )
15994  SCIPinfoMessage(scip, file, " +");
15995 
15996  /* print variable name */
15997  SCIP_CALL( SCIPwriteVarName(scip, file, vars[v], type) );
15998  }
15999 
16000  return SCIP_OKAY;
16001 }
16002 
16003 /** print the given monomials as polynomial in the following form
16004  * c1 <x11>^e11 <x12>^e12 ... <x1n>^e1n + c2 <x21>^e21 <x22>^e22 ... + ... + cn <xn1>^en1 ...
16005  *
16006  * This string can be parsed by the method SCIPparseVarsPolynomial().
16007  *
16008  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16009  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16010  *
16011  * @pre This method can be called if @p scip is in one of the following stages:
16012  * - \ref SCIP_STAGE_PROBLEM
16013  * - \ref SCIP_STAGE_TRANSFORMING
16014  * - \ref SCIP_STAGE_TRANSFORMED
16015  * - \ref SCIP_STAGE_INITPRESOLVE
16016  * - \ref SCIP_STAGE_PRESOLVING
16017  * - \ref SCIP_STAGE_EXITPRESOLVE
16018  * - \ref SCIP_STAGE_PRESOLVED
16019  * - \ref SCIP_STAGE_INITSOLVE
16020  * - \ref SCIP_STAGE_SOLVING
16021  * - \ref SCIP_STAGE_SOLVED
16022  * - \ref SCIP_STAGE_EXITSOLVE
16023  * - \ref SCIP_STAGE_FREETRANS
16024  *
16025  * @note The printing process is done via the message handler system.
16026  */
16028  SCIP* scip, /**< SCIP data structure */
16029  FILE* file, /**< output file, or NULL for stdout */
16030  SCIP_VAR*** monomialvars, /**< arrays with variables for each monomial */
16031  SCIP_Real** monomialexps, /**< arrays with variable exponents, or NULL if always 1.0 */
16032  SCIP_Real* monomialcoefs, /**< array with monomial coefficients */
16033  int* monomialnvars, /**< array with number of variables for each monomial */
16034  int nmonomials, /**< number of monomials */
16035  SCIP_Bool type /**< should the variable type be also posted */
16036  )
16037 {
16038  int i;
16039  int v;
16040 
16041  assert(scip != NULL);
16042  assert(monomialvars != NULL || nmonomials == 0);
16043  assert(monomialcoefs != NULL || nmonomials == 0);
16044  assert(monomialnvars != NULL || nmonomials == 0);
16045 
16046  SCIP_CALL( checkStage(scip, "SCIPwriteVarsPolynomial", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
16047 
16048  if( nmonomials == 0 )
16049  {
16050  SCIPinfoMessage(scip, file, " 0 ");
16051  return SCIP_OKAY;
16052  }
16053 
16054  for( i = 0; i < nmonomials; ++i )
16055  {
16056  if( monomialcoefs[i] == 1.0 ) /*lint !e613*/
16057  {
16058  if( i > 0 )
16059  SCIPinfoMessage(scip, file, " +");
16060  }
16061  else if( monomialcoefs[i] == -1.0 ) /*lint !e613*/
16062  SCIPinfoMessage(scip, file, " -");
16063  else
16064  SCIPinfoMessage(scip, file, " %+.15g", monomialcoefs[i]); /*lint !e613*/
16065 
16066  assert(monomialvars[i] != NULL || monomialnvars[i] == 0); /*lint !e613*/
16067 
16068  for( v = 0; v < monomialnvars[i]; ++v ) /*lint !e613*/
16069  {
16070  SCIP_CALL( SCIPwriteVarName(scip, file, monomialvars[i][v], type) ); /*lint !e613*/
16071  if( monomialexps != NULL && monomialexps[i] != NULL && monomialexps[i][v] != 1.0 )
16072  {
16073  SCIPinfoMessage(scip, file, "^%.15g", monomialexps[i][v]);
16074  }
16075  }
16076  }
16077 
16078  return SCIP_OKAY;
16079 }
16080 
16081 /** parses variable information (in cip format) out of a string; if the parsing process was successful a variable is
16082  * created and captured; if variable is of integral type, fractional bounds are automatically rounded; an integer
16083  * variable with bounds zero and one is automatically converted into a binary variable
16084  *
16085  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16086  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16087  *
16088  * @pre This method can be called if @p scip is in one of the following stages:
16089  * - \ref SCIP_STAGE_PROBLEM
16090  * - \ref SCIP_STAGE_TRANSFORMING
16091  * - \ref SCIP_STAGE_INITPRESOLVE
16092  * - \ref SCIP_STAGE_PRESOLVING
16093  * - \ref SCIP_STAGE_EXITPRESOLVE
16094  * - \ref SCIP_STAGE_PRESOLVED
16095  * - \ref SCIP_STAGE_SOLVING
16096  */
16098  SCIP* scip, /**< SCIP data structure */
16099  SCIP_VAR** var, /**< pointer to store the problem variable */
16100  const char* str, /**< string to parse */
16101  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
16102  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
16103  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
16104  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable */
16105  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data */
16106  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable */
16107  SCIP_VARDATA* vardata, /**< user data for this specific variable */
16108  char** endptr, /**< pointer to store the final string position if successful */
16109  SCIP_Bool* success /**< pointer store if the paring process was successful */
16110  )
16111 {
16112  assert(var != NULL);
16113 
16114  SCIP_CALL( checkStage(scip, "SCIPparseVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
16115 
16116  switch( scip->set->stage )
16117  {
16118  case SCIP_STAGE_PROBLEM:
16119  SCIP_CALL( SCIPvarParseOriginal(var, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
16120  str, initial, removable, varcopy, vardelorig, vartrans, vardeltrans, vardata, endptr, success) );
16121  break;
16122 
16125  case SCIP_STAGE_PRESOLVING:
16127  case SCIP_STAGE_PRESOLVED:
16128  case SCIP_STAGE_SOLVING:
16129  SCIP_CALL( SCIPvarParseTransformed(var, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
16130  str, initial, removable, varcopy, vardelorig, vartrans, vardeltrans, vardata, endptr, success) );
16131  break;
16132 
16133  default:
16134  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
16135  return SCIP_INVALIDCALL;
16136  } /*lint !e788*/
16137 
16138  return SCIP_OKAY;
16139 }
16140 
16141 /** parses the given string for a variable name and stores the variable in the corresponding pointer if such a variable
16142  * exits and returns the position where the parsing stopped
16143  *
16144  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16145  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16146  *
16147  * @pre This method can be called if @p scip is in one of the following stages:
16148  * - \ref SCIP_STAGE_PROBLEM
16149  * - \ref SCIP_STAGE_TRANSFORMING
16150  * - \ref SCIP_STAGE_INITPRESOLVE
16151  * - \ref SCIP_STAGE_PRESOLVING
16152  * - \ref SCIP_STAGE_EXITPRESOLVE
16153  * - \ref SCIP_STAGE_PRESOLVED
16154  * - \ref SCIP_STAGE_SOLVING
16155  */
16157  SCIP* scip, /**< SCIP data structure */
16158  const char* str, /**< string to parse */
16159  SCIP_VAR** var, /**< pointer to store the problem variable, or NULL if it does not exit */
16160  char** endptr /**< pointer to store the final string position if successful */
16161  )
16162 {
16163  char varname[SCIP_MAXSTRLEN];
16164 
16165  assert(str != NULL);
16166  assert(var != NULL);
16167  assert(endptr != NULL);
16168 
16169  SCIP_CALL( checkStage(scip, "SCIPparseVarName", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
16170 
16171  SCIPstrCopySection(str, '<', '>', varname, SCIP_MAXSTRLEN, endptr);
16172  assert(*endptr != NULL);
16173 
16174  if( *varname == '\0' )
16175  {
16176  SCIPerrorMessage("invalid variable name string given: could not find '<'\n");
16177  return SCIP_INVALIDDATA;
16178  }
16179 
16180  /* check if we have a negated variable */
16181  if( *varname == '~' )
16182  {
16183  SCIPdebugMessage("parsed negated variable name <%s>\n", &varname[1]);
16184 
16185  /* search for the variable and ignore '~' */
16186  (*var) = SCIPfindVar(scip, &varname[1]);
16187 
16188  if( *var != NULL )
16189  {
16190  SCIP_CALL( SCIPgetNegatedVar(scip, *var, var) );
16191  }
16192  }
16193  else
16194  {
16195  SCIPdebugMessage("parsed variable name <%s>\n", varname);
16196 
16197  /* search for the variable */
16198  (*var) = SCIPfindVar(scip, varname);
16199  }
16200 
16201  str = *endptr;
16202 
16203  /* skip additional variable type marker */
16204  if( *str == '[' && (str[1] == SCIP_VARTYPE_BINARY_CHAR || str[1] == SCIP_VARTYPE_INTEGER_CHAR ||
16205  str[1] == SCIP_VARTYPE_IMPLINT_CHAR || str[1] == SCIP_VARTYPE_CONTINUOUS_CHAR ) && str[2] == ']' )
16206  (*endptr) += 3;
16207 
16208  return SCIP_OKAY;
16209 }
16210 
16211 /** parse the given string as variable list (here ',' is the delimiter)) (<x1>, <x2>, ..., <xn>) (see
16212  * SCIPwriteVarsList() ); if it was successful, the pointer success is set to TRUE
16213  *
16214  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16215  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16216  *
16217  * @pre This method can be called if @p scip is in one of the following stages:
16218  * - \ref SCIP_STAGE_PROBLEM
16219  * - \ref SCIP_STAGE_TRANSFORMING
16220  * - \ref SCIP_STAGE_INITPRESOLVE
16221  * - \ref SCIP_STAGE_PRESOLVING
16222  * - \ref SCIP_STAGE_EXITPRESOLVE
16223  * - \ref SCIP_STAGE_PRESOLVED
16224  * - \ref SCIP_STAGE_SOLVING
16225  *
16226  * @note The pointer success in only set to FALSE in the case that a variable with a parsed variable name does not exist.
16227  *
16228  * @note If the number of (parsed) variables is greater than the available slots in the variable array, nothing happens
16229  * except that the required size is stored in the corresponding integer; the reason for this approach is that we
16230  * cannot reallocate memory, since we do not know how the memory has been allocated (e.g., by a C++ 'new' or SCIP
16231  * memory functions).
16232  */
16234  SCIP* scip, /**< SCIP data structure */
16235  const char* str, /**< string to parse */
16236  SCIP_VAR** vars, /**< array to store the parsed variable */
16237  int* nvars, /**< pointer to store number of parsed variables */
16238  int varssize, /**< size of the variable array */
16239  int* requiredsize, /**< pointer to store the required array size for the active variables */
16240  char** endptr, /**< pointer to store the final string position if successful */
16241  char delimiter, /**< character which is used for delimitation */
16242  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
16243  )
16244 {
16245  SCIP_VAR** tmpvars;
16246  SCIP_VAR* var;
16247  int ntmpvars = 0;
16248  int v;
16249 
16250  assert( nvars != NULL );
16251  assert( requiredsize != NULL );
16252  assert( endptr != NULL );
16253  assert( success != NULL );
16254 
16255  SCIP_CALL( checkStage(scip, "SCIPparseVarsList", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
16256 
16257  /* allocate buffer memory for temporary storing the parsed variables */
16258  SCIP_CALL( SCIPallocBufferArray(scip, &tmpvars, varssize) );
16259 
16260  (*success) = TRUE;
16261 
16262  do
16263  {
16264  *endptr = (char*)str;
16265 
16266  /* parse variable name */
16267  SCIP_CALL( SCIPparseVarName(scip, str, &var, endptr) );
16268 
16269  if( var == NULL )
16270  {
16271  SCIPdebugMessage("variable with name <%s> does not exist\n", SCIPvarGetName(var));
16272  (*success) = FALSE;
16273  break;
16274  }
16275 
16276  /* store the variable in the tmp array */
16277  if( ntmpvars < varssize )
16278  tmpvars[ntmpvars] = var;
16279 
16280  ntmpvars++;
16281 
16282  str = *endptr;
16283 
16284  while( isspace((unsigned char)*str) )
16285  str++;
16286  }
16287  while( *str == delimiter );
16288 
16289  *endptr = (char*)str;
16290 
16291  /* if all variable name searches were successful and the variable array has enough slots, copy the collected variables */
16292  if( (*success) && ntmpvars <= varssize )
16293  {
16294  for( v = 0; v < ntmpvars; ++v )
16295  vars[v] = tmpvars[v];
16296 
16297  (*nvars) = ntmpvars;
16298  }
16299  else
16300  (*nvars) = 0;
16301 
16302  (*requiredsize) = ntmpvars;
16303 
16304  /* free buffer arrays */
16305  SCIPfreeBufferArray(scip, &tmpvars);
16306 
16307  return SCIP_OKAY;
16308 }
16309 
16310 /** parse the given string as linear sum of variables and coefficients (c1 <x1> + c2 <x2> + ... + cn <xn>)
16311  * (see SCIPwriteVarsLinearsum() ); if it was successful, the pointer success is set to TRUE
16312  *
16313  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16314  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16315  *
16316  * @pre This method can be called if @p scip is in one of the following stages:
16317  * - \ref SCIP_STAGE_PROBLEM
16318  * - \ref SCIP_STAGE_TRANSFORMING
16319  * - \ref SCIP_STAGE_INITPRESOLVE
16320  * - \ref SCIP_STAGE_PRESOLVING
16321  * - \ref SCIP_STAGE_EXITPRESOLVE
16322  * - \ref SCIP_STAGE_PRESOLVED
16323  * - \ref SCIP_STAGE_SOLVING
16324  *
16325  * @note The pointer success in only set to FALSE in the case that a variable with a parsed variable name does not exist.
16326  *
16327  * @note If the number of (parsed) variables is greater than the available slots in the variable array, nothing happens
16328  * except that the required size is stored in the corresponding integer; the reason for this approach is that we
16329  * cannot reallocate memory, since we do not know how the memory has been allocated (e.g., by a C++ 'new' or SCIP
16330  * memory functions).
16331  */
16333  SCIP* scip, /**< SCIP data structure */
16334  const char* str, /**< string to parse */
16335  SCIP_VAR** vars, /**< array to store the parsed variables */
16336  SCIP_Real* vals, /**< array to store the parsed coefficients */
16337  int* nvars, /**< pointer to store number of parsed variables */
16338  int varssize, /**< size of the variable array */
16339  int* requiredsize, /**< pointer to store the required array size for the active variables */
16340  char** endptr, /**< pointer to store the final string position if successful */
16341  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
16342  )
16343 {
16344  SCIP_VAR*** monomialvars;
16345  SCIP_Real** monomialexps;
16346  SCIP_Real* monomialcoefs;
16347  int* monomialnvars;
16348  int nmonomials;
16349 
16350  SCIP_CALL( checkStage(scip, "SCIPparseVarsLinearsum", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
16351 
16352  assert(scip != NULL);
16353  assert(str != NULL);
16354  assert(vars != NULL || varssize == 0);
16355  assert(vals != NULL || varssize == 0);
16356  assert(nvars != NULL);
16357  assert(requiredsize != NULL);
16358  assert(endptr != NULL);
16359  assert(success != NULL);
16360 
16361  *requiredsize = 0;
16362 
16363  SCIP_CALL( SCIPparseVarsPolynomial(scip, str, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, &nmonomials, endptr, success) );
16364 
16365  if( !*success )
16366  {
16367  assert(nmonomials == 0); /* SCIPparseVarsPolynomial should have freed all buffers, so no need to call free here */
16368  return SCIP_OKAY;
16369  }
16370 
16371  /* check if linear sum is just "0" */
16372  if( nmonomials == 1 && monomialnvars[0] == 0 && monomialcoefs[0] == 0.0 )
16373  {
16374  *nvars = 0;
16375  *requiredsize = 0;
16376 
16377  SCIPfreeParseVarsPolynomialData(scip, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, nmonomials);
16378 
16379  return SCIP_OKAY;
16380  }
16381 
16382  *nvars = nmonomials;
16383  *requiredsize = nmonomials;
16384 
16385  /* if we have enough slots in the variables array, copy variables over */
16386  if( varssize >= nmonomials )
16387  {
16388  int v;
16389 
16390  for( v = 0; v < nmonomials; ++v )
16391  {
16392  if( monomialnvars[v] == 0 )
16393  {
16394  SCIPerrorMessage("constant in linear sum\n");
16395  *success = FALSE;
16396  break;
16397  }
16398  if( monomialnvars[v] > 1 || monomialexps[v][0] != 1.0 )
16399  {
16400  SCIPerrorMessage("nonlinear monomial in linear sum\n");
16401  *success = FALSE;
16402  break;
16403  }
16404  assert(monomialnvars[v] == 1);
16405  assert(monomialvars[v][0] != NULL);
16406  assert(monomialexps[v][0] == 1.0);
16407 
16408  vars[v] = monomialvars[v][0]; /*lint !e613*/
16409  vals[v] = monomialcoefs[v]; /*lint !e613*/
16410  }
16411  }
16412 
16413  SCIPfreeParseVarsPolynomialData(scip, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, nmonomials);
16414 
16415  return SCIP_OKAY;
16416 }
16417 
16418 /** parse the given string as polynomial of variables and coefficients
16419  * (c1 <x11>^e11 <x12>^e12 ... <x1n>^e1n + c2 <x21>^e21 <x22>^e22 ... + ... + cn <xn1>^en1 ...)
16420  * (see SCIPwriteVarsPolynomial()); if it was successful, the pointer success is set to TRUE
16421  *
16422  * The user has to call SCIPfreeParseVarsPolynomialData(scip, monomialvars, monomialexps,
16423  * monomialcoefs, monomialnvars, *nmonomials) short after SCIPparseVarsPolynomial to free all the
16424  * allocated memory again. Do not keep the arrays created by SCIPparseVarsPolynomial around, since
16425  * they use buffer memory that is intended for short term use only.
16426  *
16427  * Parsing is stopped at the end of string (indicated by the \\0-character) or when no more monomials
16428  * are recognized.
16429  *
16430  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16431  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16432  *
16433  * @pre This method can be called if @p scip is in one of the following stages:
16434  * - \ref SCIP_STAGE_PROBLEM
16435  * - \ref SCIP_STAGE_TRANSFORMING
16436  * - \ref SCIP_STAGE_INITPRESOLVE
16437  * - \ref SCIP_STAGE_PRESOLVING
16438  * - \ref SCIP_STAGE_EXITPRESOLVE
16439  * - \ref SCIP_STAGE_PRESOLVED
16440  * - \ref SCIP_STAGE_SOLVING
16441  */
16443  SCIP* scip, /**< SCIP data structure */
16444  const char* str, /**< string to parse */
16445  SCIP_VAR**** monomialvars, /**< pointer to store arrays with variables for each monomial */
16446  SCIP_Real*** monomialexps, /**< pointer to store arrays with variable exponents */
16447  SCIP_Real** monomialcoefs, /**< pointer to store array with monomial coefficients */
16448  int** monomialnvars, /**< pointer to store array with number of variables for each monomial */
16449  int* nmonomials, /**< pointer to store number of parsed monomials */
16450  char** endptr, /**< pointer to store the final string position if successful */
16451  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
16452  )
16453 {
16454  typedef enum
16455  {
16456  SCIPPARSEPOLYNOMIAL_STATE_BEGIN, /* we are at the beginning of a monomial */
16457  SCIPPARSEPOLYNOMIAL_STATE_INTERMED, /* we are in between the factors of a monomial */
16458  SCIPPARSEPOLYNOMIAL_STATE_COEF, /* we parse the coefficient of a monomial */
16459  SCIPPARSEPOLYNOMIAL_STATE_VARS, /* we parse monomial variables */
16460  SCIPPARSEPOLYNOMIAL_STATE_EXPONENT, /* we parse the exponent of a variable */
16461  SCIPPARSEPOLYNOMIAL_STATE_END, /* we are at the end the polynomial */
16462  SCIPPARSEPOLYNOMIAL_STATE_ERROR /* a parsing error occured */
16463  } SCIPPARSEPOLYNOMIAL_STATES;
16464 
16465  SCIPPARSEPOLYNOMIAL_STATES state;
16466  int monomialssize;
16467 
16468  /* data of currently parsed monomial */
16469  int varssize;
16470  int nvars;
16471  SCIP_VAR** vars;
16472  SCIP_Real* exponents;
16473  SCIP_Real coef;
16474 
16475  assert(scip != NULL);
16476  assert(str != NULL);
16477  assert(monomialvars != NULL);
16478  assert(monomialexps != NULL);
16479  assert(monomialnvars != NULL);
16480  assert(monomialcoefs != NULL);
16481  assert(nmonomials != NULL);
16482  assert(endptr != NULL);
16483  assert(success != NULL);
16484 
16485  SCIP_CALL( checkStage(scip, "SCIPparseVarsPolynomial", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
16486 
16487  *success = FALSE;
16488  *nmonomials = 0;
16489  monomialssize = 0;
16490  *monomialvars = NULL;
16491  *monomialexps = NULL;
16492  *monomialcoefs = NULL;
16493  *monomialnvars = NULL;
16494 
16495  /* initialize state machine */
16496  state = SCIPPARSEPOLYNOMIAL_STATE_BEGIN;
16497  varssize = 0;
16498  nvars = 0;
16499  vars = NULL;
16500  exponents = NULL;
16501  coef = SCIP_INVALID;
16502 
16503  SCIPdebugMessage("parsing polynomial from '%s'\n", str);
16504 
16505  while( *str && state != SCIPPARSEPOLYNOMIAL_STATE_END && state != SCIPPARSEPOLYNOMIAL_STATE_ERROR )
16506  {
16507  /* skip white space */
16508  while( isspace((unsigned char)*str) )
16509  str++;
16510 
16511  assert(state != SCIPPARSEPOLYNOMIAL_STATE_END);
16512 
16513  switch( state )
16514  {
16515  case SCIPPARSEPOLYNOMIAL_STATE_BEGIN:
16516  {
16517  if( coef != SCIP_INVALID ) /*lint !e777*/
16518  {
16519  SCIPdebugMessage("push monomial with coefficient <%g> and <%d> vars\n", coef, nvars);
16520  /* push previous monomial */
16521  if( monomialssize <= *nmonomials )
16522  {
16523  monomialssize = SCIPcalcMemGrowSize(scip, *nmonomials+1);
16524 
16525  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, monomialssize) );
16526  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, monomialssize) );
16527  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, monomialssize) );
16528  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, monomialssize) );
16529  }
16530 
16531  if( nvars > 0 )
16532  {
16533  SCIP_CALL( SCIPduplicateBufferArray(scip, &(*monomialvars)[*nmonomials], vars, nvars) ); /*lint !e866*/
16534  SCIP_CALL( SCIPduplicateBufferArray(scip, &(*monomialexps)[*nmonomials], exponents, nvars) ); /*lint !e866*/
16535  }
16536  else
16537  {
16538  (*monomialvars)[*nmonomials] = NULL;
16539  (*monomialexps)[*nmonomials] = NULL;
16540  }
16541  (*monomialcoefs)[*nmonomials] = coef;
16542  (*monomialnvars)[*nmonomials] = nvars;
16543  ++*nmonomials;
16544 
16545  nvars = 0;
16546  coef = SCIP_INVALID;
16547  }
16548 
16549  if( *str == '<' )
16550  {
16551  /* there seem to come a variable at the beginning of a monomial
16552  * so assume the coefficient is 1.0
16553  */
16554  state = SCIPPARSEPOLYNOMIAL_STATE_VARS;
16555  coef = 1.0;
16556  break;
16557  }
16558  if( *str == '-' || *str == '+' || isdigit(*str) )
16559  {
16560  state = SCIPPARSEPOLYNOMIAL_STATE_COEF;
16561  break;
16562  }
16563 
16564  state = SCIPPARSEPOLYNOMIAL_STATE_END;
16565 
16566  break;
16567  }
16568 
16569  case SCIPPARSEPOLYNOMIAL_STATE_INTERMED:
16570  {
16571  if( *str == '<' )
16572  {
16573  /* there seem to come another variable */
16574  state = SCIPPARSEPOLYNOMIAL_STATE_VARS;
16575  break;
16576  }
16577 
16578  if( *str == '-' || *str == '+' || isdigit(*str) )
16579  {
16580  /* there seem to come a coefficient, which means the next monomial */
16581  state = SCIPPARSEPOLYNOMIAL_STATE_BEGIN;
16582  break;
16583  }
16584 
16585  /* since we cannot detect the symbols we stop parsing the polynomial */
16586  state = SCIPPARSEPOLYNOMIAL_STATE_END;
16587  break;
16588  }
16589 
16590  case SCIPPARSEPOLYNOMIAL_STATE_COEF:
16591  {
16592  if( *str == '+' && !isdigit(str[1]) )
16593  {
16594  /* only a plus sign, without number */
16595  coef = 1.0;
16596  ++str;
16597  }
16598  else if( *str == '-' && !isdigit(str[1]) )
16599  {
16600  /* only a minus sign, without number */
16601  coef = -1.0;
16602  ++str;
16603  }
16604  else if( SCIPstrToRealValue(str, &coef, endptr) )
16605  {
16606  str = *endptr;
16607  }
16608  else
16609  {
16610  SCIPerrorMessage("could not parse number in the beginning of '%s'\n", str);
16611  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
16612  break;
16613  }
16614 
16615  /* after the coefficient we go into the intermediate state, i.e., expecting next variables */
16616  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
16617 
16618  break;
16619  }
16620 
16621  case SCIPPARSEPOLYNOMIAL_STATE_VARS:
16622  {
16623  SCIP_VAR* var;
16624 
16625  assert(*str == '<');
16626 
16627  /* parse variable name */
16628  SCIP_CALL( SCIPparseVarName(scip, str, &var, endptr) );
16629 
16630  /* check if variable name was parsed */
16631  if( *endptr == str )
16632  {
16633  state = SCIPPARSEPOLYNOMIAL_STATE_END;
16634  break;
16635  }
16636 
16637  if( var == NULL )
16638  {
16639  SCIPerrorMessage("did not find variable in the beginning of %s\n", str);
16640  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
16641  break;
16642  }
16643 
16644  /* add variable to vars array */
16645  if( nvars + 1 > varssize )
16646  {
16647  varssize = SCIPcalcMemGrowSize(scip, nvars+1);
16648  SCIP_CALL( SCIPreallocBufferArray(scip, &vars, varssize) );
16649  SCIP_CALL( SCIPreallocBufferArray(scip, &exponents, varssize) );
16650  }
16651  assert(vars != NULL);
16652  assert(exponents != NULL);
16653 
16654  vars[nvars] = var;
16655  exponents[nvars] = 1.0;
16656  ++nvars;
16657 
16658  str = *endptr;
16659 
16660  if( *str == '^' )
16661  state = SCIPPARSEPOLYNOMIAL_STATE_EXPONENT;
16662  else
16663  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
16664 
16665  break;
16666  }
16667 
16668  case SCIPPARSEPOLYNOMIAL_STATE_EXPONENT:
16669  {
16670  assert(*str == '^');
16671  assert(nvars > 0); /* we should be in a monomial that has already a variable */
16672  assert(exponents != NULL);
16673  ++str;
16674 
16675  if( !SCIPstrToRealValue(str, &exponents[nvars-1], endptr) )
16676  {
16677  SCIPerrorMessage("could not parse number in the beginning of '%s'\n", str);
16678  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
16679  break;
16680  }
16681  str = *endptr;
16682 
16683  /* after the exponent we go into the intermediate state, i.e., expecting next variables */
16684  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
16685  break;
16686  }
16687 
16688  case SCIPPARSEPOLYNOMIAL_STATE_END:
16689  case SCIPPARSEPOLYNOMIAL_STATE_ERROR:
16690  default:
16691  SCIPerrorMessage("unexpected state\n");
16692  return SCIP_READERROR;
16693  }
16694  }
16695 
16696  /* set end pointer */
16697  *endptr = (char*)str;
16698 
16699  /* check state at end of string */
16700  switch( state )
16701  {
16702  case SCIPPARSEPOLYNOMIAL_STATE_BEGIN:
16703  case SCIPPARSEPOLYNOMIAL_STATE_END:
16704  case SCIPPARSEPOLYNOMIAL_STATE_INTERMED:
16705  {
16706  if( coef != SCIP_INVALID ) /*lint !e777*/
16707  {
16708  /* push last monomial */
16709  SCIPdebugMessage("push monomial with coefficient <%g> and <%d> vars\n", coef, nvars);
16710  if( monomialssize <= *nmonomials )
16711  {
16712  monomialssize = *nmonomials+1;
16713  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, monomialssize) );
16714  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, monomialssize) );
16715  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, monomialssize) );
16716  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, monomialssize) );
16717  }
16718 
16719  if( nvars > 0 )
16720  {
16721  /* shrink vars and exponents array to needed size and take over ownership */
16722  SCIP_CALL( SCIPreallocBufferArray(scip, &vars, nvars) );
16723  SCIP_CALL( SCIPreallocBufferArray(scip, &exponents, nvars) );
16724  (*monomialvars)[*nmonomials] = vars;
16725  (*monomialexps)[*nmonomials] = exponents;
16726  vars = NULL;
16727  exponents = NULL;
16728  }
16729  else
16730  {
16731  (*monomialvars)[*nmonomials] = NULL;
16732  (*monomialexps)[*nmonomials] = NULL;
16733  }
16734  (*monomialcoefs)[*nmonomials] = coef;
16735  (*monomialnvars)[*nmonomials] = nvars;
16736  ++*nmonomials;
16737  }
16738 
16739  *success = TRUE;
16740  break;
16741  }
16742 
16743  case SCIPPARSEPOLYNOMIAL_STATE_COEF:
16744  case SCIPPARSEPOLYNOMIAL_STATE_VARS:
16745  case SCIPPARSEPOLYNOMIAL_STATE_EXPONENT:
16746  {
16747  SCIPerrorMessage("unexpected parsing state at end of polynomial string\n");
16748  }
16749  /*lint -fallthrough*/
16750  case SCIPPARSEPOLYNOMIAL_STATE_ERROR:
16751  assert(!*success);
16752  break;
16753  }
16754 
16755  /* free memory to store current monomial, if still existing */
16756  SCIPfreeBufferArrayNull(scip, &vars);
16757  SCIPfreeBufferArrayNull(scip, &exponents);
16758 
16759  if( *success && *nmonomials > 0 )
16760  {
16761  /* shrink arrays to required size, so we do not need to keep monomialssize around */
16762  assert(*nmonomials <= monomialssize);
16763  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, *nmonomials) );
16764  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, *nmonomials) );
16765  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, *nmonomials) );
16766  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, *nmonomials) );
16767 
16768  /* SCIPwriteVarsPolynomial(scip, NULL, *monomialvars, *monomialexps, *monomialcoefs, *monomialnvars, *nmonomials, FALSE); */
16769  }
16770  else
16771  {
16772  /* in case of error, cleanup all data here */
16773  SCIPfreeParseVarsPolynomialData(scip, monomialvars, monomialexps, monomialcoefs, monomialnvars, *nmonomials);
16774  *nmonomials = 0;
16775  }
16776 
16777  return SCIP_OKAY;
16778 }
16779 
16780 /** frees memory allocated when parsing a polynomial from a string
16781  *
16782  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16783  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16784  *
16785  * @pre This method can be called if @p scip is in one of the following stages:
16786  * - \ref SCIP_STAGE_PROBLEM
16787  * - \ref SCIP_STAGE_TRANSFORMING
16788  * - \ref SCIP_STAGE_INITPRESOLVE
16789  * - \ref SCIP_STAGE_PRESOLVING
16790  * - \ref SCIP_STAGE_EXITPRESOLVE
16791  * - \ref SCIP_STAGE_PRESOLVED
16792  * - \ref SCIP_STAGE_SOLVING
16793  */
16795  SCIP* scip, /**< SCIP data structure */
16796  SCIP_VAR**** monomialvars, /**< pointer to store arrays with variables for each monomial */
16797  SCIP_Real*** monomialexps, /**< pointer to store arrays with variable exponents */
16798  SCIP_Real** monomialcoefs, /**< pointer to store array with monomial coefficients */
16799  int** monomialnvars, /**< pointer to store array with number of variables for each monomial */
16800  int nmonomials /**< pointer to store number of parsed monomials */
16801  )
16802 {
16803  int i;
16804 
16805  assert(scip != NULL);
16806  assert(monomialvars != NULL);
16807  assert(monomialexps != NULL);
16808  assert(monomialcoefs != NULL);
16809  assert(monomialnvars != NULL);
16810  assert((*monomialvars != NULL) == (nmonomials > 0));
16811  assert((*monomialexps != NULL) == (nmonomials > 0));
16812  assert((*monomialcoefs != NULL) == (nmonomials > 0));
16813  assert((*monomialnvars != NULL) == (nmonomials > 0));
16814 
16815  SCIP_CALL_ABORT( checkStage(scip, "SCIPfreeParseVarsPolynomialData", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
16816 
16817  if( nmonomials == 0 )
16818  return;
16819 
16820  for( i = nmonomials - 1; i >= 0; --i )
16821  {
16822  SCIPfreeBufferArrayNull(scip, &(*monomialvars)[i]);
16823  SCIPfreeBufferArrayNull(scip, &(*monomialexps)[i]);
16824  }
16825 
16826  SCIPfreeBufferArray(scip, monomialvars);
16827  SCIPfreeBufferArray(scip, monomialexps);
16828  SCIPfreeBufferArray(scip, monomialcoefs);
16829  SCIPfreeBufferArray(scip, monomialnvars);
16830 }
16831 
16832 /** increases usage counter of variable
16833  *
16834  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16835  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16836  *
16837  * @pre This method can be called if @p scip is in one of the following stages:
16838  * - \ref SCIP_STAGE_PROBLEM
16839  * - \ref SCIP_STAGE_TRANSFORMING
16840  * - \ref SCIP_STAGE_TRANSFORMED
16841  * - \ref SCIP_STAGE_INITPRESOLVE
16842  * - \ref SCIP_STAGE_PRESOLVING
16843  * - \ref SCIP_STAGE_EXITPRESOLVE
16844  * - \ref SCIP_STAGE_PRESOLVED
16845  * - \ref SCIP_STAGE_INITSOLVE
16846  * - \ref SCIP_STAGE_SOLVING
16847  * - \ref SCIP_STAGE_SOLVED
16848  * - \ref SCIP_STAGE_EXITSOLVE
16849  */
16851  SCIP* scip, /**< SCIP data structure */
16852  SCIP_VAR* var /**< variable to capture */
16853  )
16854 {
16855  SCIP_CALL( checkStage(scip, "SCIPcaptureVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
16856  assert(var->scip == scip);
16857 
16858  SCIPvarCapture(var);
16859 
16860  return SCIP_OKAY;
16861 }
16862 
16863 /** decreases usage counter of variable, if the usage pointer reaches zero the variable gets freed
16864  *
16865  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16866  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16867  *
16868  * @pre This method can be called if @p scip is in one of the following stages:
16869  * - \ref SCIP_STAGE_PROBLEM
16870  * - \ref SCIP_STAGE_TRANSFORMING
16871  * - \ref SCIP_STAGE_TRANSFORMED
16872  * - \ref SCIP_STAGE_INITPRESOLVE
16873  * - \ref SCIP_STAGE_PRESOLVING
16874  * - \ref SCIP_STAGE_EXITPRESOLVE
16875  * - \ref SCIP_STAGE_PRESOLVED
16876  * - \ref SCIP_STAGE_INITSOLVE
16877  * - \ref SCIP_STAGE_SOLVING
16878  * - \ref SCIP_STAGE_SOLVED
16879  * - \ref SCIP_STAGE_EXITSOLVE
16880  * - \ref SCIP_STAGE_FREETRANS
16881  *
16882  * @note the pointer of the variable will be NULLed
16883  */
16885  SCIP* scip, /**< SCIP data structure */
16886  SCIP_VAR** var /**< pointer to variable */
16887  )
16888 {
16889  assert(var != NULL);
16890  assert(*var != NULL);
16891  assert((*var)->scip == scip);
16892 
16893  SCIP_CALL( checkStage(scip, "SCIPreleaseVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
16894 
16895  switch( scip->set->stage )
16896  {
16897  case SCIP_STAGE_PROBLEM:
16898  SCIP_CALL( SCIPvarRelease(var, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
16899  return SCIP_OKAY;
16900 
16904  case SCIP_STAGE_PRESOLVING:
16906  case SCIP_STAGE_PRESOLVED:
16907  case SCIP_STAGE_INITSOLVE:
16908  case SCIP_STAGE_SOLVING:
16909  case SCIP_STAGE_SOLVED:
16910  case SCIP_STAGE_EXITSOLVE:
16911  case SCIP_STAGE_FREETRANS:
16912  if( !SCIPvarIsTransformed(*var) && (*var)->nuses == 1 )
16913  {
16914  SCIPerrorMessage("cannot release last use of original variable while the transformed problem exists\n");
16915  return SCIP_INVALIDCALL;
16916  }
16917  SCIP_CALL( SCIPvarRelease(var, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
16918  return SCIP_OKAY;
16919 
16920  default:
16921  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
16922  return SCIP_INVALIDCALL;
16923  } /*lint !e788*/
16924 }
16925 
16926 /** changes the name of a variable
16927  *
16928  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16929  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16930  *
16931  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PROBLEM
16932  *
16933  * @note to get the current name of a variable, use SCIPvarGetName() from pub_var.h
16934  */
16936  SCIP* scip, /**< SCIP data structure */
16937  SCIP_VAR* var, /**< variable */
16938  const char* name /**< new name of constraint */
16939  )
16940 {
16941  SCIP_CALL( checkStage(scip, "SCIPchgVarName", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16942  assert( var->scip == scip );
16943 
16944  if( SCIPgetStage(scip) != SCIP_STAGE_PROBLEM )
16945  {
16946  SCIPerrorMessage("variable names can only be changed in problem creation stage\n");
16947  SCIPABORT();
16948  return SCIP_INVALIDCALL; /*lint !e527*/
16949  }
16950 
16951  /* remove variable's name from the namespace if the variable was already added */
16952  if( SCIPvarGetProbindex(var) != -1 )
16953  {
16954  SCIP_CALL( SCIPprobRemoveVarName(scip->origprob, var) );
16955  }
16956 
16957  /* change variable name */
16958  SCIP_CALL( SCIPvarChgName(var, SCIPblkmem(scip), name) );
16959 
16960  /* add variable's name to the namespace if the variable was already added */
16961  if( SCIPvarGetProbindex(var) != -1 )
16962  {
16963  SCIP_CALL( SCIPprobAddVarName(scip->origprob, var) );
16964  }
16965 
16966  return SCIP_OKAY;
16967 }
16968 
16969 /** gets and captures transformed variable of a given variable; if the variable is not yet transformed,
16970  * a new transformed variable for this variable is created
16971  *
16972  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16973  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16974  *
16975  * @pre This method can be called if @p scip is in one of the following stages:
16976  * - \ref SCIP_STAGE_TRANSFORMING
16977  * - \ref SCIP_STAGE_TRANSFORMED
16978  * - \ref SCIP_STAGE_INITPRESOLVE
16979  * - \ref SCIP_STAGE_PRESOLVING
16980  * - \ref SCIP_STAGE_EXITPRESOLVE
16981  * - \ref SCIP_STAGE_PRESOLVED
16982  * - \ref SCIP_STAGE_INITSOLVE
16983  * - \ref SCIP_STAGE_SOLVING
16984  */
16986  SCIP* scip, /**< SCIP data structure */
16987  SCIP_VAR* var, /**< variable to get/create transformed variable for */
16988  SCIP_VAR** transvar /**< pointer to store the transformed variable */
16989  )
16990 {
16991  assert(transvar != NULL);
16992 
16993  SCIP_CALL( checkStage(scip, "SCIPtransformVar", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
16994 
16995  if( SCIPvarIsTransformed(var) )
16996  {
16997  *transvar = var;
16998  SCIPvarCapture(*transvar);
16999  }
17000  else
17001  {
17002  SCIP_CALL( SCIPvarTransform(var, scip->mem->probmem, scip->set, scip->stat, scip->origprob->objsense, transvar) );
17003  }
17004 
17005  return SCIP_OKAY;
17006 }
17007 
17008 /** gets and captures transformed variables for an array of variables;
17009  * if a variable of the array is not yet transformed, a new transformed variable for this variable is created;
17010  * it is possible to call this method with vars == transvars
17011  *
17012  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17013  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17014  *
17015  * @pre This method can be called if @p scip is in one of the following stages:
17016  * - \ref SCIP_STAGE_TRANSFORMING
17017  * - \ref SCIP_STAGE_TRANSFORMED
17018  * - \ref SCIP_STAGE_INITPRESOLVE
17019  * - \ref SCIP_STAGE_PRESOLVING
17020  * - \ref SCIP_STAGE_EXITPRESOLVE
17021  * - \ref SCIP_STAGE_PRESOLVED
17022  * - \ref SCIP_STAGE_INITSOLVE
17023  * - \ref SCIP_STAGE_SOLVING
17024  */
17026  SCIP* scip, /**< SCIP data structure */
17027  int nvars, /**< number of variables to get/create transformed variables for */
17028  SCIP_VAR** vars, /**< array with variables to get/create transformed variables for */
17029  SCIP_VAR** transvars /**< array to store the transformed variables */
17030  )
17031 {
17032  int v;
17033 
17034  assert(nvars == 0 || vars != NULL);
17035  assert(nvars == 0 || transvars != NULL);
17036 
17037  SCIP_CALL( checkStage(scip, "SCIPtransformVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17038 
17039  for( v = 0; v < nvars; ++v )
17040  {
17041  if( SCIPvarIsTransformed(vars[v]) )
17042  {
17043  transvars[v] = vars[v];
17044  SCIPvarCapture(transvars[v]);
17045  }
17046  else
17047  {
17048  SCIP_CALL( SCIPvarTransform(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->origprob->objsense,
17049  &transvars[v]) );
17050  }
17051  }
17052 
17053  return SCIP_OKAY;
17054 }
17055 
17056 /** gets corresponding transformed variable of a given variable;
17057  * returns NULL as transvar, if transformed variable is not yet existing
17058  *
17059  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17060  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17061  *
17062  * @pre This method can be called if @p scip is in one of the following stages:
17063  * - \ref SCIP_STAGE_TRANSFORMING
17064  * - \ref SCIP_STAGE_TRANSFORMED
17065  * - \ref SCIP_STAGE_INITPRESOLVE
17066  * - \ref SCIP_STAGE_PRESOLVING
17067  * - \ref SCIP_STAGE_EXITPRESOLVE
17068  * - \ref SCIP_STAGE_PRESOLVED
17069  * - \ref SCIP_STAGE_INITSOLVE
17070  * - \ref SCIP_STAGE_SOLVING
17071  * - \ref SCIP_STAGE_SOLVED
17072  * - \ref SCIP_STAGE_EXITSOLVE
17073  * - \ref SCIP_STAGE_FREETRANS
17074  */
17076  SCIP* scip, /**< SCIP data structure */
17077  SCIP_VAR* var, /**< variable to get transformed variable for */
17078  SCIP_VAR** transvar /**< pointer to store the transformed variable */
17079  )
17080 {
17081  assert(transvar != NULL);
17082 
17083  SCIP_CALL( checkStage(scip, "SCIPgetTransformedVar", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17084 
17085  if( SCIPvarIsTransformed(var) )
17086  *transvar = var;
17087  else
17088  {
17089  SCIP_CALL( SCIPvarGetTransformed(var, scip->mem->probmem, scip->set, scip->stat, transvar) );
17090  }
17091 
17092  return SCIP_OKAY;
17093 }
17094 
17095 /** gets corresponding transformed variables for an array of variables;
17096  * stores NULL in a transvars slot, if the transformed variable is not yet existing;
17097  * it is possible to call this method with vars == transvars, but remember that variables that are not
17098  * yet transformed will be replaced with NULL
17099  *
17100  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17101  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17102  *
17103  * @pre This method can be called if @p scip is in one of the following stages:
17104  * - \ref SCIP_STAGE_TRANSFORMING
17105  * - \ref SCIP_STAGE_TRANSFORMED
17106  * - \ref SCIP_STAGE_INITPRESOLVE
17107  * - \ref SCIP_STAGE_PRESOLVING
17108  * - \ref SCIP_STAGE_EXITPRESOLVE
17109  * - \ref SCIP_STAGE_PRESOLVED
17110  * - \ref SCIP_STAGE_INITSOLVE
17111  * - \ref SCIP_STAGE_SOLVING
17112  * - \ref SCIP_STAGE_SOLVED
17113  * - \ref SCIP_STAGE_EXITSOLVE
17114  * - \ref SCIP_STAGE_FREETRANS
17115  */
17117  SCIP* scip, /**< SCIP data structure */
17118  int nvars, /**< number of variables to get transformed variables for */
17119  SCIP_VAR** vars, /**< array with variables to get transformed variables for */
17120  SCIP_VAR** transvars /**< array to store the transformed variables */
17121  )
17122 {
17123  int v;
17124 
17125  assert(nvars == 0 || vars != NULL);
17126  assert(nvars == 0 || transvars != NULL);
17127 
17128  SCIP_CALL( checkStage(scip, "SCIPgetTransformedVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17129 
17130  for( v = 0; v < nvars; ++v )
17131  {
17132  if( SCIPvarIsTransformed(vars[v]) )
17133  transvars[v] = vars[v];
17134  else
17135  {
17136  SCIP_CALL( SCIPvarGetTransformed(vars[v], scip->mem->probmem, scip->set, scip->stat, &transvars[v]) );
17137  }
17138  }
17139 
17140  return SCIP_OKAY;
17141 }
17142 
17143 /** gets negated variable x' = lb + ub - x of variable x; negated variable is created, if not yet existing;
17144  * in difference to \ref SCIPcreateVar, the negated variable must not be released (unless captured explicitly)
17145  *
17146  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17147  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17148  *
17149  * @pre This method can be called if @p scip is in one of the following stages:
17150  * - \ref SCIP_STAGE_PROBLEM
17151  * - \ref SCIP_STAGE_TRANSFORMING
17152  * - \ref SCIP_STAGE_TRANSFORMED
17153  * - \ref SCIP_STAGE_INITPRESOLVE
17154  * - \ref SCIP_STAGE_PRESOLVING
17155  * - \ref SCIP_STAGE_EXITPRESOLVE
17156  * - \ref SCIP_STAGE_PRESOLVED
17157  * - \ref SCIP_STAGE_INITSOLVE
17158  * - \ref SCIP_STAGE_SOLVING
17159  * - \ref SCIP_STAGE_SOLVED
17160  * - \ref SCIP_STAGE_EXITSOLVE
17161  * - \ref SCIP_STAGE_FREETRANS
17162  */
17164  SCIP* scip, /**< SCIP data structure */
17165  SCIP_VAR* var, /**< variable to get negated variable for */
17166  SCIP_VAR** negvar /**< pointer to store the negated variable */
17167  )
17168 {
17169  SCIP_CALL( checkStage(scip, "SCIPgetNegatedVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17170  assert( var->scip == scip );
17171 
17172  SCIP_CALL( SCIPvarNegate(var, scip->mem->probmem, scip->set, scip->stat, negvar) );
17173 
17174  return SCIP_OKAY;
17175 }
17176 
17177 /** gets negated variables x' = lb + ub - x of variables x; negated variables are created, if not yet existing
17178  *
17179  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17180  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17181  *
17182  * @pre This method can be called if @p scip is in one of the following stages:
17183  * - \ref SCIP_STAGE_PROBLEM
17184  * - \ref SCIP_STAGE_TRANSFORMING
17185  * - \ref SCIP_STAGE_TRANSFORMED
17186  * - \ref SCIP_STAGE_INITPRESOLVE
17187  * - \ref SCIP_STAGE_PRESOLVING
17188  * - \ref SCIP_STAGE_EXITPRESOLVE
17189  * - \ref SCIP_STAGE_PRESOLVED
17190  * - \ref SCIP_STAGE_INITSOLVE
17191  * - \ref SCIP_STAGE_SOLVING
17192  * - \ref SCIP_STAGE_SOLVED
17193  * - \ref SCIP_STAGE_EXITSOLVE
17194  * - \ref SCIP_STAGE_FREETRANS
17195  */
17197  SCIP* scip, /**< SCIP data structure */
17198  int nvars, /**< number of variables to get negated variables for */
17199  SCIP_VAR** vars, /**< array of variables to get negated variables for */
17200  SCIP_VAR** negvars /**< array to store the negated variables */
17201  )
17202 {
17203  int v;
17204 
17205  SCIP_CALL( checkStage(scip, "SCIPgetNegatedVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17206 
17207  for( v = 0; v < nvars; ++v )
17208  {
17209  SCIP_CALL( SCIPvarNegate(vars[v], scip->mem->probmem, scip->set, scip->stat, &(negvars[v])) );
17210  }
17211 
17212  return SCIP_OKAY;
17213 }
17214 
17215 /** gets a binary variable that is equal to the given binary variable, and that is either active, fixed, or
17216  * multi-aggregated, or the negated variable of an active, fixed, or multi-aggregated variable
17217  *
17218  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17219  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17220  *
17221  * @pre This method can be called if @p scip is in one of the following stages:
17222  * - \ref SCIP_STAGE_PROBLEM
17223  * - \ref SCIP_STAGE_TRANSFORMED
17224  * - \ref SCIP_STAGE_INITPRESOLVE
17225  * - \ref SCIP_STAGE_PRESOLVING
17226  * - \ref SCIP_STAGE_EXITPRESOLVE
17227  * - \ref SCIP_STAGE_PRESOLVED
17228  * - \ref SCIP_STAGE_INITSOLVE
17229  * - \ref SCIP_STAGE_SOLVING
17230  * - \ref SCIP_STAGE_SOLVED
17231  * - \ref SCIP_STAGE_EXITSOLVE
17232  */
17234  SCIP* scip, /**< SCIP data structure */
17235  SCIP_VAR* var, /**< binary variable to get binary representative for */
17236  SCIP_VAR** repvar, /**< pointer to store the binary representative */
17237  SCIP_Bool* negated /**< pointer to store whether the negation of an active variable was returned */
17238  )
17239 {
17240  assert(scip != NULL);
17241  assert(var != NULL);
17242  assert(repvar != NULL);
17243  assert(negated != NULL);
17244  assert(var->scip == scip);
17245 
17246  SCIP_CALL( checkStage(scip, "SCIPgetBinvarRepresentative", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
17247 
17248  /* get the active representative of the given variable */
17249  *repvar = var;
17250  *negated = FALSE;
17251  SCIP_CALL( SCIPvarGetProbvarBinary(repvar, negated) );
17252 
17253  /* negate the representative, if it corresponds to the negation of the given variable */
17254  if( *negated )
17255  {
17256  SCIP_CALL( SCIPgetNegatedVar(scip, *repvar, repvar) );
17257  }
17258 
17259  return SCIP_OKAY;
17260 }
17261 
17262 /** gets binary variables that are equal to the given binary variables, and which are either active, fixed, or
17263  * multi-aggregated, or the negated variables of active, fixed, or multi-aggregated variables
17264  *
17265  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17266  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17267  *
17268  * @pre This method can be called if @p scip is in one of the following stages:
17269  * - \ref SCIP_STAGE_PROBLEM
17270  * - \ref SCIP_STAGE_TRANSFORMED
17271  * - \ref SCIP_STAGE_INITPRESOLVE
17272  * - \ref SCIP_STAGE_PRESOLVING
17273  * - \ref SCIP_STAGE_EXITPRESOLVE
17274  * - \ref SCIP_STAGE_PRESOLVED
17275  * - \ref SCIP_STAGE_INITSOLVE
17276  * - \ref SCIP_STAGE_SOLVING
17277  * - \ref SCIP_STAGE_SOLVED
17278  * - \ref SCIP_STAGE_EXITSOLVE
17279  */
17281  SCIP* scip, /**< SCIP data structure */
17282  int nvars, /**< number of binary variables to get representatives for */
17283  SCIP_VAR** vars, /**< binary variables to get binary representatives for */
17284  SCIP_VAR** repvars, /**< array to store the binary representatives */
17285  SCIP_Bool* negated /**< array to store whether the negation of an active variable was returned */
17286  )
17287 {
17288  int v;
17289 
17290  assert(scip != NULL);
17291  assert(vars != NULL || nvars == 0);
17292  assert(repvars != NULL || nvars == 0);
17293  assert(negated != NULL || nvars == 0);
17294 
17295  SCIP_CALL( checkStage(scip, "SCIPgetBinvarRepresentatives", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
17296 
17297  if( nvars == 0 )
17298  return SCIP_OKAY;
17299 
17300  /* get the active representative of the given variable */
17301  BMScopyMemoryArray(repvars, vars, nvars);
17302  BMSclearMemoryArray(negated, nvars);
17303  SCIP_CALL( SCIPvarsGetProbvarBinary(&repvars, &negated, nvars) );
17304 
17305  /* negate the representatives, if they correspond to the negation of the given variables */
17306  for( v = nvars - 1; v >= 0; --v )
17307  if( negated[v] )
17308  {
17309  SCIP_CALL( SCIPgetNegatedVar(scip, repvars[v], &(repvars[v])) );
17310  }
17311 
17312  return SCIP_OKAY;
17313 }
17314 
17315 /** flattens aggregation graph of multi-aggregated variable in order to avoid exponential recursion later on
17316  *
17317  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17318  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17319  *
17320  * @pre This method can be called if @p scip is in one of the following stages:
17321  * - \ref SCIP_STAGE_INITPRESOLVE
17322  * - \ref SCIP_STAGE_PRESOLVING
17323  * - \ref SCIP_STAGE_EXITPRESOLVE
17324  * - \ref SCIP_STAGE_PRESOLVED
17325  * - \ref SCIP_STAGE_INITSOLVE
17326  * - \ref SCIP_STAGE_SOLVING
17327  * - \ref SCIP_STAGE_SOLVED
17328  */
17330  SCIP* scip, /**< SCIP data structure */
17331  SCIP_VAR* var /**< problem variable */
17332  )
17333 {
17334  assert( scip != NULL );
17335  assert( var != NULL );
17336  SCIP_CALL( checkStage(scip, "SCIPflattenVarAggregationGraph", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17337 
17338  SCIP_CALL( SCIPvarFlattenAggregationGraph(var, scip->mem->probmem, scip->set) );
17339  return SCIP_OKAY;
17340 }
17341 
17342 /** Transforms a given linear sum of variables, that is a_1*x_1 + ... + a_n*x_n + c into a corresponding linear sum of
17343  * active variables, that is b_1*y_1 + ... + b_m*y_m + d.
17344  *
17345  * If the number of needed active variables is greater than the available slots in the variable array, nothing happens
17346  * except that the required size is stored in the corresponding variable (requiredsize). Otherwise, the active variable
17347  * representation is stored in the variable array, scalar array and constant.
17348  *
17349  * The reason for this approach is that we cannot reallocate memory, since we do not know how the memory has been
17350  * allocated (e.g., by a C++ 'new' or SCIP functions).
17351  *
17352  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17353  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17354  *
17355  * @pre This method can be called if @p scip is in one of the following stages:
17356  * - \ref SCIP_STAGE_TRANSFORMED
17357  * - \ref SCIP_STAGE_INITPRESOLVE
17358  * - \ref SCIP_STAGE_PRESOLVING
17359  * - \ref SCIP_STAGE_EXITPRESOLVE
17360  * - \ref SCIP_STAGE_PRESOLVED
17361  * - \ref SCIP_STAGE_INITSOLVE
17362  * - \ref SCIP_STAGE_SOLVING
17363  * - \ref SCIP_STAGE_SOLVED
17364  * - \ref SCIP_STAGE_EXITSOLVE
17365  * - \ref SCIP_STAGE_FREETRANS
17366  *
17367  * @note The resulting linear sum is stored into the given variable array, scalar array, and constant. That means the
17368  * given entries are overwritten.
17369  *
17370  * @note That method can be used to convert a single variables into variable space of active variables. Therefore call
17371  * the method with the linear sum 1.0*x + 0.0.
17372  */
17374  SCIP* scip, /**< SCIP data structure */
17375  SCIP_VAR** vars, /**< variable array x_1, ..., x_n in the linear sum which will be
17376  * overwritten by the variable array y_1, ..., y_m in the linear sum
17377  * w.r.t. active variables */
17378  SCIP_Real* scalars, /**< scalars a_1, ..., a_n in linear sum which will be overwritten to the
17379  * scalars b_1, ..., b_m in the linear sum of the active variables */
17380  int* nvars, /**< pointer to number of variables in the linear sum which will be
17381  * overwritten by the number of variables in the linear sum corresponding
17382  * to the active variables */
17383  int varssize, /**< available slots in vars and scalars array which is needed to check if
17384  * the array are large enough for the linear sum w.r.t. active
17385  * variables */
17386  SCIP_Real* constant, /**< pointer to constant c in linear sum a_1*x_1 + ... + a_n*x_n + c which
17387  * will chnage to constant d in the linear sum b_1*y_1 + ... + b_m*y_m +
17388  * d w.r.t. the active variables */
17389  int* requiredsize, /**< pointer to store the required array size for the linear sum w.r.t. the
17390  * active variables */
17391  SCIP_Bool mergemultiples /**< should multiple occurrences of a var be replaced by a single coeff? */
17392  )
17393 {
17394  assert( scip != NULL );
17395  assert( nvars != NULL );
17396  assert( vars != NULL || *nvars == 0 );
17397  assert( scalars != NULL || *nvars == 0 );
17398  assert( constant != NULL );
17399  assert( requiredsize != NULL );
17400  assert( *nvars <= varssize );
17401 
17402  SCIP_CALL( checkStage(scip, "SCIPgetProbvarLinearSum", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17403  SCIP_CALL( SCIPvarGetActiveRepresentatives(scip->set, vars, scalars, nvars, varssize, constant, requiredsize, mergemultiples) );
17404 
17405  return SCIP_OKAY;
17406 }
17407 
17408 /** transforms given variable, scalar and constant to the corresponding active, fixed, or
17409  * multi-aggregated variable, scalar and constant; if the variable resolves to a fixed variable,
17410  * "scalar" will be 0.0 and the value of the sum will be stored in "constant"; a multi-aggregation
17411  * with only one active variable (this can happen due to fixings after the multi-aggregation),
17412  * is treated like an aggregation; if the multi-aggregation constant is infinite, "scalar" will be 0.0
17413  *
17414  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17415  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17416  *
17417  * @pre This method can be called if @p scip is in one of the following stages:
17418  * - \ref SCIP_STAGE_TRANSFORMED
17419  * - \ref SCIP_STAGE_INITPRESOLVE
17420  * - \ref SCIP_STAGE_PRESOLVING
17421  * - \ref SCIP_STAGE_EXITPRESOLVE
17422  * - \ref SCIP_STAGE_PRESOLVED
17423  * - \ref SCIP_STAGE_INITSOLVE
17424  * - \ref SCIP_STAGE_SOLVING
17425  * - \ref SCIP_STAGE_SOLVED
17426  * - \ref SCIP_STAGE_EXITSOLVE
17427  * - \ref SCIP_STAGE_FREETRANS
17428  */
17430  SCIP* scip, /**< SCIP data structure */
17431  SCIP_VAR** var, /**< pointer to problem variable x in sum a*x + c */
17432  SCIP_Real* scalar, /**< pointer to scalar a in sum a*x + c */
17433  SCIP_Real* constant /**< pointer to constant c in sum a*x + c */
17434  )
17435 {
17436  assert(scip != NULL);
17437  assert(var != NULL);
17438  assert(scalar != NULL);
17439  assert(constant != NULL);
17440 
17441  SCIP_CALL( checkStage(scip, "SCIPgetProbvarSum", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17442  SCIP_CALL( SCIPvarGetProbvarSum(var, scip->set, scalar, constant) );
17443 
17444  return SCIP_OKAY;
17445 }
17446 
17447 /** return for given variables all their active counterparts; all active variables will be pairwise different
17448  * @note It does not hold that the first output variable is the active variable for the first input variable.
17449  *
17450  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17451  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17452  *
17453  * @pre This method can be called if @p scip is in one of the following stages:
17454  * - \ref SCIP_STAGE_TRANSFORMED
17455  * - \ref SCIP_STAGE_INITPRESOLVE
17456  * - \ref SCIP_STAGE_PRESOLVING
17457  * - \ref SCIP_STAGE_EXITPRESOLVE
17458  * - \ref SCIP_STAGE_PRESOLVED
17459  * - \ref SCIP_STAGE_INITSOLVE
17460  * - \ref SCIP_STAGE_SOLVING
17461  * - \ref SCIP_STAGE_SOLVED
17462  * - \ref SCIP_STAGE_EXITSOLVE
17463  * - \ref SCIP_STAGE_FREETRANS
17464  */
17466  SCIP* scip, /**< SCIP data structure */
17467  SCIP_VAR** vars, /**< variable array with given variables and as output all active
17468  * variables, if enough slots exist
17469  */
17470  int* nvars, /**< number of given variables, and as output number of active variables,
17471  * if enough slots exist
17472  */
17473  int varssize, /**< available slots in vars array */
17474  int* requiredsize /**< pointer to store the required array size for the active variables */
17475  )
17476 {
17477  assert(scip != NULL);
17478  assert(nvars != NULL);
17479  assert(vars != NULL || *nvars == 0);
17480  assert(varssize >= *nvars);
17481  assert(requiredsize != NULL);
17482 
17483  SCIP_CALL( checkStage(scip, "SCIPgetActiveVars", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17484  SCIP_CALL( SCIPvarsGetActiveVars(scip->set, vars, nvars, varssize, requiredsize) );
17485 
17486  return SCIP_OKAY;
17487 }
17488 
17489 /** returns the reduced costs of the variable in the current node's LP relaxation;
17490  * the current node has to have a feasible LP.
17491  *
17492  * returns SCIP_INVALID if the variable is active but not in the current LP;
17493  * returns 0 if the variable has been aggregated out or fixed in presolving.
17494  *
17495  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
17496  */
17498  SCIP* scip, /**< SCIP data structure */
17499  SCIP_VAR* var /**< variable to get reduced costs, should be a column in current node LP */
17500  )
17501 {
17502  assert( scip != NULL );
17503  assert( var != NULL );
17504  assert( var->scip == scip );
17505 
17506  switch( SCIPvarGetStatus(var) )
17507  {
17509  if( var->data.original.transvar == NULL )
17510  return SCIP_INVALID;
17511  return SCIPgetVarRedcost(scip, var->data.original.transvar);
17512 
17513  case SCIP_VARSTATUS_COLUMN:
17514  return SCIPgetColRedcost(scip, SCIPvarGetCol(var));
17515 
17516  case SCIP_VARSTATUS_LOOSE:
17517  return SCIP_INVALID;
17518 
17519  case SCIP_VARSTATUS_FIXED:
17523  return 0.0;
17524 
17525  default:
17526  SCIPerrorMessage("unknown variable status\n");
17527  SCIPABORT();
17528  return 0.0; /*lint !e527*/
17529  }
17530 }
17531 
17532 /** returns the implied reduced costs of the variable in the current node's LP relaxation;
17533  * the current node has to have a feasible LP.
17534  *
17535  * returns SCIP_INVALID if the variable is active but not in the current LP;
17536  * returns 0 if the variable has been aggregated out or fixed in presolving.
17537  *
17538  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
17539  */
17541  SCIP* scip, /**< SCIP data structure */
17542  SCIP_VAR* var, /**< variable to get reduced costs, should be a column in current node LP */
17543  SCIP_Bool varfixing /**< FALSE if for x == 0, TRUE for x == 1 */
17544  )
17545 {
17546  assert( scip != NULL );
17547  assert( var != NULL );
17548  assert( var->scip == scip );
17549 
17550  switch( SCIPvarGetStatus(var) )
17551  {
17553  if( var->data.original.transvar == NULL )
17554  return SCIP_INVALID;
17555  return SCIPgetVarImplRedcost(scip, var->data.original.transvar, varfixing);
17556 
17557  case SCIP_VARSTATUS_COLUMN:
17558  return SCIPvarGetImplRedcost(var, scip->set, varfixing, scip->stat, scip->transprob, scip->lp);
17559 
17560  case SCIP_VARSTATUS_LOOSE:
17561  return SCIP_INVALID;
17562 
17563  case SCIP_VARSTATUS_FIXED:
17567  return 0.0;
17568 
17569  default:
17570  SCIPerrorMessage("unknown variable status\n");
17571  SCIPABORT();
17572  return 0.0; /*lint !e527*/
17573  }
17574 }
17575 
17576 
17577 /** returns the Farkas coefficient of the variable in the current node's LP relaxation;
17578  * the current node has to have an infeasible LP.
17579  *
17580  * returns SCIP_INVALID if the variable is active but not in the current LP;
17581  * returns 0 if the variable has been aggregated out or fixed in presolving.
17582  *
17583  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
17584  */
17586  SCIP* scip, /**< SCIP data structure */
17587  SCIP_VAR* var /**< variable to get reduced costs, should be a column in current node LP */
17588  )
17589 {
17590  assert(scip != NULL);
17591  assert(var != NULL);
17592  assert(var->scip == scip);
17593 
17594  switch( SCIPvarGetStatus(var) )
17595  {
17597  if( var->data.original.transvar == NULL )
17598  return SCIP_INVALID;
17599  return SCIPgetVarFarkasCoef(scip,var->data.original.transvar);
17600 
17601  case SCIP_VARSTATUS_COLUMN:
17602  return SCIPgetColFarkasCoef(scip,SCIPvarGetCol(var));
17603 
17604  case SCIP_VARSTATUS_LOOSE:
17605  return SCIP_INVALID;
17606 
17607  case SCIP_VARSTATUS_FIXED:
17611  return 0.0;
17612 
17613  default:
17614  SCIPerrorMessage("unknown variable status\n");
17615  SCIPABORT();
17616  return 0.0; /*lint !e527*/
17617  }
17618 }
17619 
17620 /** gets solution value for variable in current node
17621  *
17622  * @return solution value for variable in current node
17623  *
17624  * @pre This method can be called if @p scip is in one of the following stages:
17625  * - \ref SCIP_STAGE_PRESOLVED
17626  * - \ref SCIP_STAGE_SOLVING
17627  */
17629  SCIP* scip, /**< SCIP data structure */
17630  SCIP_VAR* var /**< variable to get solution value for */
17631  )
17632 {
17633  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17634  assert( var->scip == scip );
17635 
17636  return SCIPvarGetSol(var, SCIPtreeHasCurrentNodeLP(scip->tree));
17637 }
17638 
17639 /** gets solution values of multiple variables in current node
17640  *
17641  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17642  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17643  *
17644  * @pre This method can be called if @p scip is in one of the following stages:
17645  * - \ref SCIP_STAGE_PRESOLVED
17646  * - \ref SCIP_STAGE_SOLVING
17647  */
17649  SCIP* scip, /**< SCIP data structure */
17650  int nvars, /**< number of variables to get solution value for */
17651  SCIP_VAR** vars, /**< array with variables to get value for */
17652  SCIP_Real* vals /**< array to store solution values of variables */
17653  )
17654 {
17655  int v;
17656 
17657  assert(nvars == 0 || vars != NULL);
17658  assert(nvars == 0 || vals != NULL);
17659 
17660  SCIP_CALL( checkStage(scip, "SCIPgetVarSols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17661 
17662  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
17663  {
17664  for( v = 0; v < nvars; ++v )
17665  vals[v] = SCIPvarGetLPSol(vars[v]);
17666  }
17667  else
17668  {
17669  for( v = 0; v < nvars; ++v )
17670  vals[v] = SCIPvarGetPseudoSol(vars[v]);
17671  }
17672 
17673  return SCIP_OKAY;
17674 }
17675 
17676 /** sets the solution value of all variables in the global relaxation solution to zero
17677  *
17678  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17679  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17680  *
17681  * @pre This method can be called if @p scip is in one of the following stages:
17682  * - \ref SCIP_STAGE_PRESOLVED
17683  * - \ref SCIP_STAGE_SOLVING
17684  */
17686  SCIP* scip /**< SCIP data structure */
17687  )
17688 {
17689  SCIP_VAR** vars;
17690  int nvars;
17691  int v;
17692 
17693  assert(scip != NULL);
17694 
17695  SCIP_CALL( checkStage(scip, "SCIPclearRelaxSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17696 
17697  /* the relaxation solution is already cleared */
17698  if( SCIPrelaxationIsSolZero(scip->relaxation) )
17699  return SCIP_OKAY;
17700 
17701  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
17702 
17703  for( v = 0; v < nvars; v++ )
17704  {
17705  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, 0.0, FALSE) );
17706  }
17707 
17708  SCIPrelaxationSetSolObj(scip->relaxation, 0.0);
17710 
17711  return SCIP_OKAY;
17712 }
17713 
17714 /** sets the value of the given variable in the global relaxation solution;
17715  * this solution can be filled by the relaxation handlers and can be used by heuristics and for separation;
17716  * You can use SCIPclearRelaxSolVals() to set all values to zero, initially;
17717  * after setting all solution values, you have to call SCIPmarkRelaxSolValid()
17718  * to inform SCIP that the stored solution is valid
17719  *
17720  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17721  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17722  *
17723  * @pre This method can be called if @p scip is in one of the following stages:
17724  * - \ref SCIP_STAGE_PRESOLVED
17725  * - \ref SCIP_STAGE_SOLVING
17726  */
17728  SCIP* scip, /**< SCIP data structure */
17729  SCIP_VAR* var, /**< variable to set value for */
17730  SCIP_Real val /**< solution value of variable */
17731  )
17732 {
17733  assert(scip != NULL);
17734 
17735  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17736 
17737  SCIP_CALL( SCIPvarSetRelaxSol(var, scip->set, scip->relaxation, val, TRUE) );
17738 
17739  if( val != 0.0 )
17742 
17743  return SCIP_OKAY;
17744 }
17745 
17746 /** sets the values of the given variables in the global relaxation solution;
17747  * this solution can be filled by the relaxation handlers and can be used by heuristics and for separation;
17748  * the solution is automatically cleared, s.t. all other variables get value 0.0
17749  *
17750  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17751  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17752  *
17753  * @pre This method can be called if @p scip is in one of the following stages:
17754  * - \ref SCIP_STAGE_PRESOLVED
17755  * - \ref SCIP_STAGE_SOLVING
17756  */
17758  SCIP* scip, /**< SCIP data structure */
17759  int nvars, /**< number of variables to set relaxation solution value for */
17760  SCIP_VAR** vars, /**< array with variables to set value for */
17761  SCIP_Real* vals /**< array with solution values of variables */
17762  )
17763 {
17764  int v;
17765 
17766  assert(scip != NULL);
17767  assert(nvars == 0 || vars != NULL);
17768  assert(nvars == 0 || vals != NULL);
17769 
17770  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17771 
17773 
17774  for( v = 0; v < nvars; v++ )
17775  {
17776  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, vals[v], TRUE) );
17777  }
17778 
17781 
17782  return SCIP_OKAY;
17783 }
17784 
17785 /** sets the values of the variables in the global relaxation solution to the values
17786  * in the given primal solution; the relaxation solution can be filled by the relaxation hanlders
17787  * and might be used by heuristics and for separation
17788  *
17789  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17790  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17791  *
17792  * @pre This method can be called if @p scip is in one of the following stages:
17793  * - \ref SCIP_STAGE_PRESOLVED
17794  * - \ref SCIP_STAGE_SOLVING
17795  */
17797  SCIP* scip, /**< SCIP data structure */
17798  SCIP_SOL* sol /**< primal relaxation solution */
17799  )
17800 {
17801  SCIP_VAR** vars;
17802  SCIP_Real* vals;
17803  int nvars;
17804  int v;
17805 
17806  assert(scip != NULL);
17807 
17808  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolValsSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17809 
17810  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
17811 
17812  /* alloc buffer array for solution values of the variables and get the values */
17813  SCIP_CALL( SCIPallocBufferArray(scip, &vals, nvars) );
17814  SCIP_CALL( SCIPgetSolVals(scip, sol, nvars, vars, vals) );
17815 
17817 
17818  for( v = 0; v < nvars; v++ )
17819  {
17820  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, vals[v], FALSE) );
17821  }
17822 
17823  SCIPrelaxationSetSolObj(scip->relaxation, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
17824 
17827 
17828  SCIPfreeBufferArray(scip, &vals);
17829 
17830  return SCIP_OKAY;
17831 }
17832 
17833 /** returns whether the relaxation solution is valid
17834  *
17835  * @return TRUE, if the relaxation solution is valid; FALSE, otherwise
17836  *
17837  * @pre This method can be called if @p scip is in one of the following stages:
17838  * - \ref SCIP_STAGE_PRESOLVED
17839  * - \ref SCIP_STAGE_SOLVING
17840  */
17842  SCIP* scip /**< SCIP data structure */
17843  )
17844 {
17845  assert(scip != NULL);
17846 
17847  SCIP_CALL_ABORT( checkStage(scip, "SCIPisRelaxSolValid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17848 
17849  return SCIPrelaxationIsSolValid(scip->relaxation);
17850 }
17851 
17852 /** informs SCIP, that the relaxation solution is valid
17853  *
17854  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17855  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17856  *
17857  * @pre This method can be called if @p scip is in one of the following stages:
17858  * - \ref SCIP_STAGE_PRESOLVED
17859  * - \ref SCIP_STAGE_SOLVING
17860  */
17862  SCIP* scip /**< SCIP data structure */
17863  )
17864 {
17865  assert(scip != NULL);
17866 
17867  SCIP_CALL( checkStage(scip, "SCIPmarkRelaxSolValid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17868 
17870 
17871  return SCIP_OKAY;
17872 }
17873 
17874 /** informs SCIP, that the relaxation solution is invalid
17875  *
17876  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17877  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17878  *
17879  * @pre This method can be called if @p scip is in one of the following stages:
17880  * - \ref SCIP_STAGE_PRESOLVED
17881  * - \ref SCIP_STAGE_SOLVING
17882  */
17884  SCIP* scip /**< SCIP data structure */
17885  )
17886 {
17887  assert(scip != NULL);
17888 
17889  SCIP_CALL( checkStage(scip, "SCIPmarkRelaxSolInvalid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17890 
17892 
17893  return SCIP_OKAY;
17894 }
17895 
17896 /** gets the relaxation solution value of the given variable
17897  *
17898  * @return the relaxation solution value of the given variable
17899  *
17900  * @pre This method can be called if @p scip is in one of the following stages:
17901  * - \ref SCIP_STAGE_PRESOLVED
17902  * - \ref SCIP_STAGE_SOLVING
17903  */
17905  SCIP* scip, /**< SCIP data structure */
17906  SCIP_VAR* var /**< variable to get value for */
17907  )
17908 {
17909  assert(scip != NULL);
17910  assert(var != NULL);
17911  assert(var->scip == scip);
17912 
17913  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRelaxSolVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17914 
17915  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
17916  {
17917  SCIPerrorMessage("Relaxation Solution is not valid!\n");
17918  SCIPABORT();
17919  return SCIP_INVALID; /*lint !e527*/
17920  }
17921 
17922  return SCIPvarGetRelaxSol(var, scip->set);
17923 }
17924 
17925 /** gets the relaxation solution objective value
17926  *
17927  * @return the objective value of the relaxation solution
17928  *
17929  * @pre This method can be called if @p scip is in one of the following stages:
17930  * - \ref SCIP_STAGE_PRESOLVED
17931  * - \ref SCIP_STAGE_SOLVING
17932  */
17934  SCIP* scip /**< SCIP data structure */
17935  )
17936 {
17937  assert(scip != NULL);
17938 
17939  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRelaxSolObj", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17940 
17941  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
17942  {
17943  SCIPerrorMessage("Relaxation Solution is not valid!\n");
17944  SCIPABORT();
17945  return SCIP_INVALID; /*lint !e527*/
17946  }
17947 
17948  return SCIPrelaxationGetSolObj(scip->relaxation);
17949 }
17950 
17951 /** start strong branching - call before any strong branching
17952  *
17953  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17954  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17955  *
17956  * @pre This method can be called if @p scip is in one of the following stages:
17957  * - \ref SCIP_STAGE_PRESOLVED
17958  * - \ref SCIP_STAGE_SOLVING
17959  *
17960  * @note if propagation is enabled, strong branching is not done directly on the LP, but probing nodes are created
17961  * which allow to perform propagation but also creates some overhead
17962  */
17964  SCIP* scip, /**< SCIP data structure */
17965  SCIP_Bool enablepropagation /**< should propagation be done before solving the strong branching LP? */
17966  )
17967 {
17968  assert( scip != NULL );
17969  SCIP_CALL( checkStage(scip, "SCIPstartStrongbranch", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17970 
17971  assert(!SCIPinProbing(scip));
17972 
17973  SCIPdebugMessage("starting strong branching mode%s: lpcount=%" SCIP_LONGINT_FORMAT "\n", enablepropagation ? " with propagation" : "", scip->stat->lpcount - scip->stat->nsbdivinglps);
17974 
17975  /* start probing mode to allow propagation before solving the strong branching LPs; if no propagation should be done,
17976  * start the strong branching mode in the LP interface
17977  */
17978  if( enablepropagation )
17979  {
17980  if( SCIPtreeProbing(scip->tree) )
17981  {
17982  SCIPerrorMessage("cannot start strong branching with propagation while in probing mode\n");
17983  return SCIP_INVALIDCALL;
17984  }
17985 
17986  if( scip->lp != NULL && SCIPlpDiving(scip->lp) )
17987  {
17988  SCIPerrorMessage("cannot start strong branching with propagation while in diving mode\n");
17989  return SCIP_INVALIDCALL;
17990  }
17991 
17992  /* other then in SCIPstartProbing(), we do not disable collecting variable statistics during strong branching;
17993  * we cannot disable it, because the pseudo costs would not be updated, otherwise,
17994  * and reliability branching would end up doing strong branching all the time
17995  */
17996  SCIP_CALL( SCIPtreeStartProbing(scip->tree, scip->mem->probmem, scip->set, scip->lp, TRUE) );
17997 
17998  /* inform the LP that the current probing mode is used for strong branching */
18000 
18001  }
18002  else
18003  {
18005  }
18006 
18007  return SCIP_OKAY;
18008 }
18009 
18010 /** end strong branching - call after any strong branching
18011  *
18012  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18013  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18014  *
18015  * @pre This method can be called if @p scip is in one of the following stages:
18016  * - \ref SCIP_STAGE_PRESOLVED
18017  * - \ref SCIP_STAGE_SOLVING
18018  */
18020  SCIP* scip /**< SCIP data structure */
18021  )
18022 {
18023  assert( scip != NULL );
18024 
18025  SCIP_CALL( checkStage(scip, "SCIPendStrongbranch", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18026 
18027  /* depending on whether the strong branching mode was started with propagation enabled or not, we end the strong
18028  * branching probing mode or the LP strong branching mode
18029  */
18030  if( SCIPtreeProbing(scip->tree) )
18031  {
18032  SCIP_NODE* node;
18033  SCIP_DOMCHG* domchg;
18034  SCIP_VAR** boundchgvars;
18035  SCIP_Real* bounds;
18036  SCIP_BOUNDTYPE* boundtypes;
18037  int nboundchgs;
18038  int nbnds;
18039  int i;
18040 
18041  /* collect all bound changes deducted during probing, which were applied at the probing root and apply them to the
18042  * focusnode
18043  */
18044  node = SCIPgetCurrentNode(scip);
18045  assert(SCIPnodeGetType(node) == SCIP_NODETYPE_PROBINGNODE);
18046  assert(SCIPgetProbingDepth(scip) == 0);
18047 
18048  domchg = SCIPnodeGetDomchg(node);
18049  nboundchgs = SCIPdomchgGetNBoundchgs(domchg);
18050 
18051  SCIP_CALL( SCIPallocBufferArray(scip, &boundchgvars, nboundchgs) );
18052  SCIP_CALL( SCIPallocBufferArray(scip, &bounds, nboundchgs) );
18053  SCIP_CALL( SCIPallocBufferArray(scip, &boundtypes, nboundchgs) );
18054 
18055  for( i = 0, nbnds = 0; i < nboundchgs; ++i )
18056  {
18057  SCIP_BOUNDCHG* boundchg;
18058 
18059  boundchg = SCIPdomchgGetBoundchg(domchg, i);
18060 
18061  /* ignore redundant bound changes */
18062  if( SCIPboundchgIsRedundant(boundchg) )
18063  continue;
18064 
18065  boundchgvars[nbnds] = SCIPboundchgGetVar(boundchg);
18066  bounds[nbnds] = SCIPboundchgGetNewbound(boundchg);
18067  boundtypes[nbnds] = SCIPboundchgGetBoundtype(boundchg);
18068  ++nbnds;
18069  }
18070 
18071  SCIPdebugMessage("ending strong branching with probing: %d bound changes collected\n", nbnds);
18072 
18073  /* inform the LP that the probing mode is not used for strong branching anymore */
18075 
18076  SCIP_CALL( SCIPendProbing(scip) );
18077 
18078  /* apply the collected bound changes */
18079  for( i = 0; i < nbnds; ++i )
18080  {
18081  if( boundtypes[i] == SCIP_BOUNDTYPE_LOWER )
18082  {
18083  SCIPdebugMessage("apply probing lower bound change <%s> >= %.9g\n", SCIPvarGetName(boundchgvars[i]), bounds[i]);
18084  SCIP_CALL( SCIPchgVarLb(scip, boundchgvars[i], bounds[i]) );
18085  }
18086  else
18087  {
18088  SCIPdebugMessage("apply probing upper bound change <%s> <= %.9g\n", SCIPvarGetName(boundchgvars[i]), bounds[i]);
18089  SCIP_CALL( SCIPchgVarUb(scip, boundchgvars[i], bounds[i]) );
18090  }
18091  }
18092 
18093  SCIPfreeBufferArray(scip, &boundchgvars);
18094  SCIPfreeBufferArray(scip, &bounds);
18095  SCIPfreeBufferArray(scip, &boundtypes);
18096  }
18097  else
18098  {
18099  SCIPdebugMessage("ending strong branching\n");
18100 
18102  }
18103 
18104  return SCIP_OKAY;
18105 }
18106 
18107 /** analyze the strong branching for the given variable; that includes conflict analysis for infeasible branches and
18108  * storing of root reduced cost information
18109  */
18110 static
18112  SCIP* scip, /**< SCIP data structure */
18113  SCIP_VAR* var, /**< variable to analyze */
18114  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
18115  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
18116  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
18117  * infeasible downwards branch, or NULL */
18118  SCIP_Bool* upconflict /**< pointer to store whether a conflict constraint was created for an
18119  * infeasible upwards branch, or NULL */
18120  )
18121 {
18122  SCIP_COL* col;
18123  SCIP_Bool downcutoff;
18124  SCIP_Bool upcutoff;
18125 
18126  col = SCIPvarGetCol(var);
18127  assert(col != NULL);
18128 
18129  downcutoff = col->sbdownvalid && SCIPsetIsGE(scip->set, col->sbdown, scip->lp->cutoffbound);
18130  upcutoff = col->sbupvalid && SCIPsetIsGE(scip->set, col->sbup, scip->lp->cutoffbound);
18131 
18132  if( downinf != NULL )
18133  *downinf = downcutoff;
18134  if( upinf != NULL )
18135  *upinf = upcutoff;
18136 
18137  /* analyze infeasible strong branching sub problems:
18138  * because the strong branching's bound change is necessary for infeasibility, it cannot be undone;
18139  * therefore, infeasible strong branchings on non-binary variables will not produce a valid conflict constraint
18140  */
18141  if( scip->set->conf_enable && scip->set->conf_usesb && scip->set->nconflicthdlrs > 0
18142  && SCIPvarIsBinary(var) && SCIPtreeGetCurrentDepth(scip->tree) > 0 )
18143  {
18144  if( (downcutoff && SCIPsetFeasCeil(scip->set, col->primsol-1.0) >= col->lb - 0.5)
18145  || (upcutoff && SCIPsetFeasFloor(scip->set, col->primsol+1.0) <= col->ub + 0.5) )
18146  {
18147  assert(downconflict != NULL);
18148  assert(upconflict != NULL);
18149  SCIP_CALL( SCIPconflictAnalyzeStrongbranch(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
18150  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, col, downconflict, upconflict) );
18151  }
18152  }
18153 
18154  /* the strong branching results can be used to strengthen the root reduced cost information which is used for example
18155  * to propagate against the cutoff bound
18156  *
18157  * @note Ignore the results if the LP solution of the down (up) branch LP is smaller which should not happened by
18158  * theory but can arise due to numerical issues.
18159  */
18160  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 && SCIPvarIsBinary(var) )
18161  {
18162  SCIP_Real lpobjval;
18163 
18164  assert(SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL);
18165 
18166  lpobjval = SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
18167 
18168  if( col->sbdownvalid && SCIPsetFeasCeil(scip->set, col->primsol-1.0) >= col->lb - 0.5 && lpobjval < col->sbdown )
18169  SCIPvarUpdateBestRootSol(var, scip->set, SCIPvarGetUbGlobal(var), -(col->sbdown - lpobjval), lpobjval);
18170  if( col->sbupvalid && SCIPsetFeasFloor(scip->set, col->primsol+1.0) <= col->ub + 0.5 && lpobjval < col->sbup )
18171  SCIPvarUpdateBestRootSol(var, scip->set, SCIPvarGetLbGlobal(var), col->sbup - lpobjval, lpobjval);
18172  }
18173 
18174  return SCIP_OKAY;
18175 }
18176 
18177 /** gets strong branching information on column variable with fractional value
18178  *
18179  * Before calling this method, the strong branching mode must have been activated by calling SCIPstartStrongbranch();
18180  * after strong branching was done for all candidate variables, the strong branching mode must be ended by
18181  * SCIPendStrongbranch(). Since this method does not apply domain propagation before strongbranching,
18182  * propagation should not be enabled in the SCIPstartStrongbranch() call.
18183  *
18184  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18185  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18186  *
18187  * @pre This method can be called if @p scip is in one of the following stages:
18188  * - \ref SCIP_STAGE_PRESOLVED
18189  * - \ref SCIP_STAGE_SOLVING
18190  */
18192  SCIP* scip, /**< SCIP data structure */
18193  SCIP_VAR* var, /**< variable to get strong branching values for */
18194  int itlim, /**< iteration limit for strong branchings */
18195  SCIP_Real* down, /**< stores dual bound after branching column down */
18196  SCIP_Real* up, /**< stores dual bound after branching column up */
18197  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
18198  * otherwise, it can only be used as an estimate value */
18199  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
18200  * otherwise, it can only be used as an estimate value */
18201  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
18202  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
18203  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
18204  * infeasible downwards branch, or NULL */
18205  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
18206  * infeasible upwards branch, or NULL */
18207  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
18208  * solving process should be stopped (e.g., due to a time limit) */
18209  )
18210 {
18211  SCIP_COL* col;
18212 
18213  assert(scip != NULL);
18214  assert(var != NULL);
18215  assert(lperror != NULL);
18216  assert(!SCIPtreeProbing(scip->tree)); /* we should not be in strong branching with propagation mode */
18217  assert(var->scip == scip);
18218 
18219  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchFrac", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18220 
18221  if( downvalid != NULL )
18222  *downvalid = FALSE;
18223  if( upvalid != NULL )
18224  *upvalid = FALSE;
18225  if( downinf != NULL )
18226  *downinf = FALSE;
18227  if( upinf != NULL )
18228  *upinf = FALSE;
18229  if( downconflict != NULL )
18230  *downconflict = FALSE;
18231  if( upconflict != NULL )
18232  *upconflict = FALSE;
18233 
18235  {
18236  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
18237  return SCIP_INVALIDDATA;
18238  }
18239 
18240  col = SCIPvarGetCol(var);
18241  assert(col != NULL);
18242 
18243  if( !SCIPcolIsInLP(col) )
18244  {
18245  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
18246  return SCIP_INVALIDDATA;
18247  }
18248 
18249  /* check if the solving process should be aborted */
18250  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
18251  {
18252  /* mark this as if the LP failed */
18253  *lperror = TRUE;
18254  return SCIP_OKAY;
18255  }
18256 
18257  /* call strong branching for column with fractional value */
18258  SCIP_CALL( SCIPcolGetStrongbranch(col, FALSE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
18259  down, up, downvalid, upvalid, lperror) );
18260 
18261  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
18262  * declare the sub nodes infeasible
18263  */
18264  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
18265  {
18266  SCIP_CALL( analyzeStrongbranch(scip, var, downinf, upinf, downconflict, upconflict) );
18267  }
18268 
18269  return SCIP_OKAY;
18270 }
18271 
18272 /** create, solve, and evaluate a single strong branching child (for strong branching with propagation) */
18273 static
18275  SCIP* scip, /**< SCIP data structure */
18276  SCIP_VAR* var, /**< variable to get strong branching values for */
18277  SCIP_Bool down, /**< do we regard the down child? */
18278  SCIP_Bool firstchild, /**< is this the first of the two strong branching children? */
18279  SCIP_Bool propagate, /**< should domain propagation be performed? */
18280  SCIP_Real newbound, /**< new bound to apply at the strong branching child */
18281  int itlim, /**< iteration limit for strong branchings */
18282  int maxproprounds, /**< maximum number of propagation rounds (-1: no limit, -2: parameter
18283  * settings) */
18284  SCIP_Real* value, /**< stores dual bound for strong branching child */
18285  SCIP_Bool* valid, /**< stores whether the returned value is a valid dual bound, or NULL;
18286  * otherwise, it can only be used as an estimate value */
18287  SCIP_Longint* ndomreductions, /**< pointer to store the number of domain reductions found, or NULL */
18288  SCIP_Bool* conflict, /**< pointer to store whether a conflict constraint was created for an
18289  * infeasible strong branching child, or NULL */
18290  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred or the
18291  * solving process should be stopped (e.g., due to a time limit) */
18292  SCIP_VAR** vars, /**< active problem variables */
18293  int nvars, /**< number of active problem variables */
18294  SCIP_Real* newlbs, /**< array to store valid lower bounds for all active variables, or NULL */
18295  SCIP_Real* newubs, /**< array to store valid upper bounds for all active variables, or NULL */
18296  SCIP_Bool* foundsol, /**< pointer to store whether a primal solution was found during strong branching */
18297  SCIP_Bool* cutoff /**< pointer to store whether the strong branching child is infeasible */
18298  )
18299 {
18300  SCIP_Longint ndomreds;
18301 
18302  assert(value != NULL);
18303  assert(foundsol != NULL);
18304  assert(cutoff != NULL);
18305  assert(valid != NULL ? !(*valid) : TRUE);
18306 
18307  *foundsol = FALSE;
18308 
18309  /* check whether the strong branching child is already infeasible due to the bound change */
18310  if( down )
18311  {
18312  /* the down branch is infeasible due to the branching bound change; since this means that solval is not within the
18313  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
18314  * are valid for and were already applied at the probing root
18315  */
18316  if( newbound < SCIPvarGetLbLocal(var) - 0.5 )
18317  {
18318  *value = SCIPinfinity(scip);
18319 
18320  if( valid != NULL )
18321  *valid = TRUE;
18322 
18323  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
18324  if( conflict != NULL )
18325  *conflict = TRUE;
18326 
18327  *cutoff = TRUE;
18328 
18329  return SCIP_OKAY;
18330  }
18331  }
18332  else
18333  {
18334  /* the up branch is infeasible due to the branching bound change; since this means that solval is not within the
18335  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
18336  * are valid for and were already applied at the probing root
18337  */
18338  if( newbound > SCIPvarGetUbLocal(var) + 0.5 )
18339  {
18340  *value = SCIPinfinity(scip);
18341 
18342  if( valid != NULL )
18343  *valid = TRUE;
18344 
18345  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
18346  if( conflict != NULL )
18347  *conflict = TRUE;
18348 
18349  *cutoff = TRUE;
18350 
18351  return SCIP_OKAY;
18352  }
18353  }
18354 
18355  /* we need to ensure that we can create at least one new probing node without exceeding the maximal tree depth */
18357  {
18358  /* create a new probing node for the strong branching child and apply the new bound for the variable */
18359  SCIP_CALL( SCIPnewProbingNode(scip) );
18360 
18361  if( down )
18362  {
18363  assert(SCIPisGE(scip, newbound, SCIPvarGetLbLocal(var)));
18364  if( SCIPisLT(scip, newbound, SCIPvarGetUbLocal(var)) )
18365  {
18366  SCIP_CALL( SCIPchgVarUbProbing(scip, var, newbound) );
18367  }
18368  }
18369  else
18370  {
18371  assert(SCIPisLE(scip, newbound, SCIPvarGetUbLocal(var)));
18372  if( SCIPisGT(scip, newbound, SCIPvarGetLbLocal(var)) )
18373  {
18374  SCIP_CALL( SCIPchgVarLbProbing(scip, var, newbound) );
18375  }
18376  }
18377  }
18378  else
18379  {
18380  if( valid != NULL )
18381  *valid = FALSE;
18382 
18383  if( cutoff != NULL ) /*lint !e774*/
18384  *cutoff = FALSE;
18385 
18386  if( conflict != NULL )
18387  *conflict = FALSE;
18388 
18389  return SCIP_OKAY;
18390  }
18391 
18392  /* propagate domains at the probing node */
18393  if( propagate )
18394  {
18395  /* start time measuring */
18396  SCIPclockStart(scip->stat->strongpropclock, scip->set);
18397 
18398  ndomreds = 0;
18399  SCIP_CALL( SCIPpropagateProbing(scip, maxproprounds, cutoff, &ndomreds) );
18400 
18401  /* store number of domain reductions in strong branching */
18402  if( down )
18403  scip->stat->nsbdowndomchgs += ndomreds;
18404  else
18405  scip->stat->nsbupdomchgs += ndomreds;
18406 
18407  if( ndomreductions != NULL )
18408  *ndomreductions = ndomreds;
18409 
18410  /* stop time measuring */
18411  SCIPclockStop(scip->stat->strongpropclock, scip->set);
18412 
18413  if( *cutoff )
18414  {
18415  *value = SCIPinfinity(scip);
18416 
18417  if( valid != NULL )
18418  *valid = TRUE;
18419 
18420  SCIPdebugMessage("%s branch of var <%s> detected infeasible during propagation\n",
18421  down ? "down" : "up", SCIPvarGetName(var));
18422  }
18423  }
18424 
18425  /* if propagation did not already detect infeasibility, solve the probing LP */
18426  if( !(*cutoff) )
18427  {
18428  SCIP_CALL( SCIPsolveProbingLP(scip, itlim, lperror, cutoff) );
18429  assert(SCIPisLPRelax(scip));
18430 
18431  if( *cutoff )
18432  {
18433  assert(!(*lperror));
18434 
18435  *value = SCIPinfinity(scip);
18436 
18437  if( valid != NULL )
18438  *valid = TRUE;
18439 
18440  SCIPdebugMessage("%s branch of var <%s> detected infeasible in LP solving: status=%d\n",
18441  down ? "down" : "up", SCIPvarGetName(var), SCIPgetLPSolstat(scip));
18442  }
18443  else if( !(*lperror) )
18444  {
18445  switch( SCIPgetLPSolstat(scip) )
18446  {
18448  {
18449  *value = SCIPgetLPObjval(scip);
18450  assert(SCIPisLT(scip, *value, SCIPgetCutoffbound(scip)));
18451 
18452  SCIPdebugMessage("probing LP solved to optimality, objective value: %16.9g\n", *value);
18453 
18454  if( valid != NULL )
18455  *valid = TRUE;
18456 
18457  /* check the strong branching LP solution for feasibility */
18458  if( scip->set->branch_checksbsol )
18459  {
18460  SCIP_SOL* sol;
18461  SCIP_Bool rounded = TRUE;
18462 
18463  /* start clock for strong branching solutions */
18464  SCIPclockStart(scip->stat->sbsoltime, scip->set);
18465 
18466  SCIP_CALL( SCIPcreateLPSol(scip, &sol, NULL) );
18467 
18468  /* try to round the strong branching solution */
18469  if( scip->set->branch_roundsbsol )
18470  {
18471  SCIP_CALL( SCIProundSol(scip, sol, &rounded) );
18472  }
18473 
18474  /* check the solution for feasibility if rounding worked well (or was not tried) */
18475  if( rounded )
18476  {
18477  SCIP_CALL( SCIPtrySolFree(scip, &sol, FALSE, FALSE, TRUE, FALSE, foundsol) );
18478  }
18479  else
18480  {
18481  SCIP_CALL( SCIPfreeSol(scip, &sol) );
18482  }
18483 
18484  if( *foundsol )
18485  {
18486  SCIPdebugMessage("found new solution in strong branching\n");
18487 
18488  scip->stat->nsbsolsfound++;
18489 
18490  if( SCIPisGE(scip, *value, SCIPgetCutoffbound(scip)) )
18491  *cutoff = TRUE;
18492  }
18493 
18494  /* stop clock for strong branching solutions */
18495  SCIPclockStop(scip->stat->sbsoltime, scip->set);
18496  }
18497 
18498  break;
18499  }
18502  {
18503  /* use LP value as estimate */
18504  SCIP_LPI* lpi;
18505  SCIP_Real objval;
18506  SCIP_Real looseobjval;
18507 
18508  SCIPdebugMessage("probing LP hit %s limit\n", SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_ITERLIMIT ? "iteration" : "time");
18509 
18510  /* we access the LPI directly, because when a time limit was hit, we cannot access objective value and dual
18511  * feasibility using the SCIPlp... methods; we should try to avoid direct calls to the LPI, but this is rather
18512  * uncritical here, because we are immediately after the SCIPsolveProbingLP() call, because we access the LPI
18513  * read-only, and we check SCIPlpiWasSolved() first
18514  */
18515  SCIP_CALL( SCIPgetLPI(scip, &lpi) );
18516 
18517  if( SCIPlpiWasSolved(lpi) )
18518  {
18519  SCIP_CALL( SCIPlpiGetObjval(lpi, &objval) );
18520  looseobjval = SCIPlpGetLooseObjval(scip->lp, scip->set, scip->transprob);
18521 
18522  /* the infinity value in the LPI should not be smaller than SCIP's infinity value */
18523  assert(!SCIPlpiIsInfinity(lpi, objval) || SCIPisInfinity(scip, objval));
18524 
18525  /* we use SCIP's infinity value here because a value larger than this is counted as infeasible by SCIP */
18526  if( SCIPisInfinity(scip, objval) )
18527  *value = SCIPinfinity(scip);
18528  else if( SCIPisInfinity(scip, -looseobjval) )
18529  *value = -SCIPinfinity(scip);
18530  else
18531  *value = objval + looseobjval;
18532 
18533  if( SCIPlpiIsDualFeasible(lpi) )
18534  {
18535  if( valid != NULL )
18536  *valid = TRUE;
18537 
18538  if( SCIPisGE(scip, *value, SCIPgetCutoffbound(scip)) )
18539  *cutoff = TRUE;
18540  }
18541  }
18542  break;
18543  }
18544  case SCIP_LPSOLSTAT_ERROR:
18546  *lperror = TRUE;
18547  break;
18548  case SCIP_LPSOLSTAT_NOTSOLVED: /* should only be the case for *cutoff = TRUE or *lperror = TRUE */
18549  case SCIP_LPSOLSTAT_OBJLIMIT: /* in this case, *cutoff should be TRUE and we should not get here */
18550  case SCIP_LPSOLSTAT_INFEASIBLE: /* in this case, *cutoff should be TRUE and we should not get here */
18551  default:
18552  SCIPerrorMessage("invalid LP solution status <%d>\n", SCIPgetLPSolstat(scip));
18553  return SCIP_INVALIDDATA;
18554  } /*lint !e788*/
18555  }
18556 
18557  /* If columns are missing in the LP, the cutoff flag may be wrong. Therefore, we need to set it and the valid pointer
18558  * to false here.
18559  */
18560  if( (*cutoff) && !SCIPallColsInLP(scip) )
18561  {
18562  *cutoff = FALSE;
18563  }
18564 
18565 #ifndef NDEBUG
18566  if( *lperror )
18567  {
18568  SCIPdebugMessage("error during strong branching probing LP solving: status=%d\n", SCIPgetLPSolstat(scip));
18569  }
18570 #endif
18571  }
18572 
18573 
18574  /* if the subproblem was feasible, we store the local bounds of the variables after propagation and (possibly)
18575  * conflict analysis
18576  * @todo do this after propagation? should be able to get valid bounds more often, but they might be weaker
18577  */
18578  if( !(*cutoff) && newlbs != NULL)
18579  {
18580  int v;
18581 
18582  assert(newubs != NULL);
18583 
18584  /* initialize the newlbs and newubs to the current local bounds */
18585  if( firstchild )
18586  {
18587  for( v = 0; v < nvars; ++v )
18588  {
18589  newlbs[v] = SCIPvarGetLbLocal(vars[v]);
18590  newubs[v] = SCIPvarGetUbLocal(vars[v]);
18591  }
18592  }
18593  /* update newlbs and newubs: take the weaker of the already stored bounds and the current local bounds */
18594  else
18595  {
18596  for( v = 0; v < nvars; ++v )
18597  {
18598  SCIP_Real lb = SCIPvarGetLbLocal(vars[v]);
18599  SCIP_Real ub = SCIPvarGetUbLocal(vars[v]);
18600 
18601  newlbs[v] = MIN(newlbs[v], lb);
18602  newubs[v] = MAX(newubs[v], ub);
18603  }
18604  }
18605  }
18606 
18607  /* revert all changes at the probing node */
18608  SCIP_CALL( SCIPbacktrackProbing(scip, 0) );
18609 
18610  return SCIP_OKAY;
18611 }
18612 
18613 /** gets strong branching information with previous domain propagation on column variable
18614  *
18615  * Before calling this method, the strong branching mode must have been activated by calling SCIPstartStrongbranch();
18616  * after strong branching was done for all candidate variables, the strong branching mode must be ended by
18617  * SCIPendStrongbranch(). Since this method applies domain propagation before strongbranching, propagation has to be be
18618  * enabled in the SCIPstartStrongbranch() call.
18619  *
18620  * Before solving the strong branching LP, domain propagation can be performed. The number of propagation rounds
18621  * can be specified by the parameter @p maxproprounds.
18622  *
18623  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18624  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18625  *
18626  * @pre This method can be called if @p scip is in one of the following stages:
18627  * - \ref SCIP_STAGE_PRESOLVED
18628  * - \ref SCIP_STAGE_SOLVING
18629  *
18630  * @warning When using this method, LP banching candidates and solution values must be copied beforehand, because
18631  * they are updated w.r.t. the strong branching LP solution.
18632  */
18634  SCIP* scip, /**< SCIP data structure */
18635  SCIP_VAR* var, /**< variable to get strong branching values for */
18636  SCIP_Real solval, /**< value of the variable in the current LP solution */
18637  SCIP_Real lpobjval, /**< LP objective value of the current LP solution */
18638  int itlim, /**< iteration limit for strong branchings */
18639  int maxproprounds, /**< maximum number of propagation rounds (-1: no limit, -2: parameter
18640  * settings) */
18641  SCIP_Real* down, /**< stores dual bound after branching column down */
18642  SCIP_Real* up, /**< stores dual bound after branching column up */
18643  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
18644  * otherwise, it can only be used as an estimate value */
18645  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
18646  * otherwise, it can only be used as an estimate value */
18647  SCIP_Longint* ndomredsdown, /**< pointer to store the number of domain reductions down, or NULL */
18648  SCIP_Longint* ndomredsup, /**< pointer to store the number of domain reductions up, or NULL */
18649  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
18650  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
18651  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
18652  * infeasible downwards branch, or NULL */
18653  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
18654  * infeasible upwards branch, or NULL */
18655  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred or the
18656  * solving process should be stopped (e.g., due to a time limit) */
18657  SCIP_Real* newlbs, /**< array to store valid lower bounds for all active variables, or NULL */
18658  SCIP_Real* newubs /**< array to store valid upper bounds for all active variables, or NULL */
18659  )
18660 {
18661  SCIP_COL* col;
18662  SCIP_VAR** vars;
18663  SCIP_Longint oldniters;
18664  SCIP_Real newub;
18665  SCIP_Real newlb;
18666  SCIP_Bool propagate;
18667  SCIP_Bool cutoff;
18668  SCIP_Bool downchild;
18669  SCIP_Bool firstchild;
18670  SCIP_Bool foundsol;
18671  SCIP_Bool downvalidlocal;
18672  SCIP_Bool upvalidlocal;
18673  SCIP_Bool allcolsinlp;
18674  int oldnconflicts;
18675  int nvars;
18676 
18677  assert(scip != NULL);
18678  assert(var != NULL);
18679  assert(SCIPvarIsIntegral(var));
18680  assert(down != NULL);
18681  assert(up != NULL);
18682  assert(lperror != NULL);
18683  assert((newlbs != NULL) == (newubs != NULL));
18684  assert(SCIPinProbing(scip));
18685  assert(var->scip == scip);
18686 
18687  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchWithPropagation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18688 
18689  /* check whether propagation should be performed */
18690  propagate = (maxproprounds != 0);
18691 
18692  /* Check, if all existing columns are in LP.
18693  * If this is not the case, we may still return that the up and down dual bounds are valid, because the branching
18694  * rule should not apply them otherwise.
18695  * However, we must not set the downinf or upinf pointers to TRUE based on the dual bound, because we cannot
18696  * guarantee that this node can be cut off.
18697  */
18698  allcolsinlp = SCIPallColsInLP(scip);
18699 
18700  /* if maxproprounds is -2, change it to 0, which for the following calls means using the parameter settings */
18701  if( maxproprounds == -2 )
18702  maxproprounds = 0;
18703 
18704  *down = lpobjval;
18705  *up = lpobjval;
18706  if( downvalid != NULL )
18707  *downvalid = FALSE;
18708  if( upvalid != NULL )
18709  *upvalid = FALSE;
18710  if( downinf != NULL )
18711  *downinf = FALSE;
18712  if( upinf != NULL )
18713  *upinf = FALSE;
18714  if( downconflict != NULL )
18715  *downconflict = FALSE;
18716  if( upconflict != NULL )
18717  *upconflict = FALSE;
18718  if( ndomredsdown != NULL )
18719  *ndomredsdown = 0;
18720  if( ndomredsup != NULL )
18721  *ndomredsup = 0;
18722 
18723  *lperror = FALSE;
18724 
18725  vars = SCIPgetVars(scip);
18726  nvars = SCIPgetNVars(scip);
18727 
18728  /* check if the solving process should be aborted */
18729  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
18730  {
18731  /* mark this as if the LP failed */
18732  *lperror = TRUE;
18733  return SCIP_OKAY;
18734  }
18735 
18737  {
18738  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
18739  return SCIP_INVALIDDATA;
18740  }
18741 
18742  col = SCIPvarGetCol(var);
18743  assert(col != NULL);
18744 
18745  if( !SCIPcolIsInLP(col) )
18746  {
18747  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
18748  return SCIP_INVALIDDATA;
18749  }
18750 
18751  newlb = SCIPfeasFloor(scip, solval + 1.0);
18752  newub = SCIPfeasCeil(scip, solval - 1.0);
18753 
18754  SCIPdebugMessage("strong branching on var <%s>: solval=%g, lb=%g, ub=%g\n", SCIPvarGetName(var), solval,
18756 
18757  /* the up branch is infeasible due to the branching bound change; since this means that solval is not within the
18758  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
18759  * are valid for and were already applied at the probing root
18760  */
18761  if( newlb > SCIPvarGetUbLocal(var) + 0.5 )
18762  {
18763  *up = SCIPinfinity(scip);
18764 
18765  if( upinf != NULL )
18766  *upinf = TRUE;
18767 
18768  if( upvalid != NULL )
18769  *upvalid = TRUE;
18770 
18771  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
18772  if( upconflict != NULL )
18773  *upconflict = TRUE;
18774 
18775  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
18776  *down, *up, FALSE, TRUE, 0LL, INT_MAX);
18777 
18778  /* we do not regard the down branch; its valid pointer stays set to FALSE */
18779  return SCIP_OKAY;
18780  }
18781 
18782  /* the down branch is infeasible due to the branching bound change; since this means that solval is not within the
18783  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
18784  * are valid for and were already applied at the probing root
18785  */
18786  if( newub < SCIPvarGetLbLocal(var) - 0.5 )
18787  {
18788  *down = SCIPinfinity(scip);
18789 
18790  if( downinf != NULL )
18791  *downinf = TRUE;
18792 
18793  if( downvalid != NULL )
18794  *downvalid = TRUE;
18795 
18796  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
18797  if( downconflict != NULL )
18798  *downconflict = TRUE;
18799 
18800  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
18801  *down, *up, TRUE, FALSE, 0LL, INT_MAX);
18802 
18803  /* we do not regard the up branch; its valid pointer stays set to FALSE */
18804  return SCIP_OKAY;
18805  }
18806 
18807  /* We now do strong branching by creating the two potential child nodes as probing nodes and solving them one after
18808  * the other. We will stop when the first child is detected infeasible, saving the effort we would need for the
18809  * second child. Since empirically, the up child tends to be infeasible more often, we do strongbranching first on
18810  * the up branch.
18811  */
18812  oldniters = scip->stat->nsbdivinglpiterations;
18813  firstchild = TRUE;
18814  cutoff = FALSE;
18815 
18816  /* @todo: decide the branch to look at first based on the cutoffs in previous calls? */
18817  if( scip->set->branch_firstsbchild == 'u' )
18818  downchild = FALSE;
18819  else if( scip->set->branch_firstsbchild == 'a' )
18820  downchild = SCIPvarGetNLocksDown(var) > SCIPvarGetNLocksUp(var);
18821  else
18822  {
18823  assert(scip->set->branch_firstsbchild == 'd');
18824  downchild = TRUE;
18825  }
18826 
18827  downvalidlocal = FALSE;
18828  upvalidlocal = FALSE;
18829 
18830  do
18831  {
18832  oldnconflicts = SCIPconflictGetNConflicts(scip->conflict);
18833 
18834  if( downchild )
18835  {
18836  SCIP_CALL( performStrongbranchWithPropagation(scip, var, downchild, firstchild, propagate, newub, itlim, maxproprounds,
18837  down, &downvalidlocal, ndomredsdown, downconflict, lperror, vars, nvars, newlbs, newubs, &foundsol, &cutoff) );
18838 
18839  /* check whether a new solutions rendered the previous child infeasible */
18840  if( foundsol && !firstchild && allcolsinlp )
18841  {
18842  if( SCIPisGE(scip, *up, SCIPgetCutoffbound(scip)) )
18843  {
18844  if( upinf != NULL )
18845  *upinf = TRUE;
18846  }
18847  }
18848 
18849  /* check for infeasibility */
18850  if( cutoff )
18851  {
18852  if( downinf != NULL )
18853  *downinf = TRUE;
18854 
18855  if( downconflict != NULL &&
18856  (SCIPvarGetLbLocal(var) > newub + 0.5 || SCIPconflictGetNConflicts(scip->conflict) > oldnconflicts) )
18857  {
18858  *downconflict = TRUE;
18859  }
18860 
18861  if( !scip->set->branch_forceall )
18862  {
18863  /* if this is the first call, we do not regard the up branch, its valid pointer is initially set to FALSE */
18864  break;
18865  }
18866  }
18867  }
18868  else
18869  {
18870  SCIP_CALL( performStrongbranchWithPropagation(scip, var, downchild, firstchild, propagate, newlb, itlim, maxproprounds,
18871  up, &upvalidlocal, ndomredsup, upconflict, lperror, vars, nvars, newlbs, newubs, &foundsol, &cutoff) );
18872 
18873  /* check whether a new solutions rendered the previous child infeasible */
18874  if( foundsol && !firstchild && allcolsinlp )
18875  {
18876  if( SCIPisGE(scip, *down, SCIPgetCutoffbound(scip)) )
18877  {
18878  if( downinf != NULL )
18879  *downinf = TRUE;
18880  }
18881  }
18882 
18883  /* check for infeasibility */
18884  if( cutoff )
18885  {
18886  if( upinf != NULL )
18887  *upinf = TRUE;
18888 
18889  assert(upinf == NULL || (*upinf) == TRUE);
18890 
18891  if( upconflict != NULL &&
18892  (SCIPvarGetUbLocal(var) < newlb - 0.5 || SCIPconflictGetNConflicts(scip->conflict) > oldnconflicts) )
18893  {
18894  *upconflict = TRUE;
18895  }
18896 
18897  if( !scip->set->branch_forceall )
18898  {
18899  /* if this is the first call, we do not regard the down branch, its valid pointer is initially set to FALSE */
18900  break;
18901  }
18902  }
18903  }
18904 
18905  downchild = !downchild;
18906  firstchild = !firstchild;
18907  }
18908  while( !firstchild );
18909 
18910 
18911  /* set strong branching information in column */
18912  if( *lperror )
18913  {
18914  SCIPcolInvalidateStrongbranchData(col, scip->set, scip->stat, scip->lp);
18915  }
18916  else
18917  {
18918  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
18919  *down, *up, downvalidlocal, upvalidlocal, scip->stat->nsbdivinglpiterations - oldniters, itlim);
18920  }
18921 
18922  if( downvalid != NULL )
18923  *downvalid = downvalidlocal;
18924  if( upvalid != NULL )
18925  *upvalid = upvalidlocal;
18926 
18927  return SCIP_OKAY;
18928 }
18929 
18930 /** gets strong branching information on column variable x with integral LP solution value (val); that is, the down branch
18931  * is (val -1.0) and the up brach ins (val +1.0)
18932  *
18933  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18934  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18935  *
18936  * @pre This method can be called if @p scip is in one of the following stages:
18937  * - \ref SCIP_STAGE_PRESOLVED
18938  * - \ref SCIP_STAGE_SOLVING
18939  *
18940  * @note If the integral LP solution value is the lower or upper bound of the variable, the corresponding branch will be
18941  * marked as infeasible. That is, the valid pointer and the infeasible pointer are set to TRUE.
18942  */
18944  SCIP* scip, /**< SCIP data structure */
18945  SCIP_VAR* var, /**< variable to get strong branching values for */
18946  int itlim, /**< iteration limit for strong branchings */
18947  SCIP_Real* down, /**< stores dual bound after branching column down */
18948  SCIP_Real* up, /**< stores dual bound after branching column up */
18949  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
18950  * otherwise, it can only be used as an estimate value */
18951  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
18952  * otherwise, it can only be used as an estimate value */
18953  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
18954  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
18955  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
18956  * infeasible downwards branch, or NULL */
18957  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
18958  * infeasible upwards branch, or NULL */
18959  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
18960  * solving process should be stopped (e.g., due to a time limit) */
18961  )
18962 {
18963  SCIP_COL* col;
18964 
18965  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchInt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18966 
18967  assert(lperror != NULL);
18968  assert(var->scip == scip);
18969 
18970  if( downvalid != NULL )
18971  *downvalid = FALSE;
18972  if( upvalid != NULL )
18973  *upvalid = FALSE;
18974  if( downinf != NULL )
18975  *downinf = FALSE;
18976  if( upinf != NULL )
18977  *upinf = FALSE;
18978  if( downconflict != NULL )
18979  *downconflict = FALSE;
18980  if( upconflict != NULL )
18981  *upconflict = FALSE;
18982 
18984  {
18985  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
18986  return SCIP_INVALIDDATA;
18987  }
18988 
18989  col = SCIPvarGetCol(var);
18990  assert(col != NULL);
18991 
18992  if( !SCIPcolIsInLP(col) )
18993  {
18994  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
18995  return SCIP_INVALIDDATA;
18996  }
18997 
18998  /* check if the solving process should be aborted */
18999  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
19000  {
19001  /* mark this as if the LP failed */
19002  *lperror = TRUE;
19003  return SCIP_OKAY;
19004  }
19005 
19006  /* call strong branching for column */
19007  SCIP_CALL( SCIPcolGetStrongbranch(col, TRUE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
19008  down, up, downvalid, upvalid, lperror) );
19009 
19010  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
19011  * declare the sub nodes infeasible
19012  */
19013  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
19014  {
19015  SCIP_CALL( analyzeStrongbranch(scip, var, downinf, upinf, downconflict, upconflict) );
19016  }
19017 
19018  return SCIP_OKAY;
19019 }
19020 
19021 /** gets strong branching information on column variables with fractional values
19022  *
19023  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19024  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19025  *
19026  * @pre This method can be called if @p scip is in one of the following stages:
19027  * - \ref SCIP_STAGE_PRESOLVED
19028  * - \ref SCIP_STAGE_SOLVING
19029  */
19031  SCIP* scip, /**< SCIP data structure */
19032  SCIP_VAR** vars, /**< variables to get strong branching values for */
19033  int nvars, /**< number of variables */
19034  int itlim, /**< iteration limit for strong branchings */
19035  SCIP_Real* down, /**< stores dual bounds after branching variables down */
19036  SCIP_Real* up, /**< stores dual bounds after branching variables up */
19037  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds, or NULL;
19038  * otherwise, they can only be used as an estimate value */
19039  SCIP_Bool* upvalid, /**< stores whether the returned up values are valid dual bounds, or NULL;
19040  * otherwise, they can only be used as an estimate value */
19041  SCIP_Bool* downinf, /**< array to store whether the downward branches are infeasible, or NULL */
19042  SCIP_Bool* upinf, /**< array to store whether the upward branches are infeasible, or NULL */
19043  SCIP_Bool* downconflict, /**< array to store whether conflict constraints were created for
19044  * infeasible downward branches, or NULL */
19045  SCIP_Bool* upconflict, /**< array to store whether conflict constraints were created for
19046  * infeasible upward branches, or NULL */
19047  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
19048  * solving process should be stopped (e.g., due to a time limit) */
19049  )
19050 {
19051  SCIP_COL** cols;
19052  int j;
19053 
19054  SCIP_CALL( checkStage(scip, "SCIPgetVarsStrongbranchesFrac", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19055 
19056  assert( lperror != NULL );
19057  assert( vars != NULL );
19058 
19059  /* set up data */
19060  cols = NULL;
19061  SCIP_CALL( SCIPallocBufferArray(scip, &cols, nvars) );
19062  assert(cols != NULL);
19063  for( j = 0; j < nvars; ++j )
19064  {
19065  SCIP_VAR* var;
19066  SCIP_COL* col;
19067 
19068  if( downvalid != NULL )
19069  downvalid[j] = FALSE;
19070  if( upvalid != NULL )
19071  upvalid[j] = FALSE;
19072  if( downinf != NULL )
19073  downinf[j] = FALSE;
19074  if( upinf != NULL )
19075  upinf[j] = FALSE;
19076  if( downconflict != NULL )
19077  downconflict[j] = FALSE;
19078  if( upconflict != NULL )
19079  upconflict[j] = FALSE;
19080 
19081  var = vars[j];
19082  assert( var != NULL );
19084  {
19085  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
19086  SCIPfreeBufferArray(scip, &cols);
19087  return SCIP_INVALIDDATA;
19088  }
19089 
19090  col = SCIPvarGetCol(var);
19091  assert(col != NULL);
19092  cols[j] = col;
19093 
19094  if( !SCIPcolIsInLP(col) )
19095  {
19096  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
19097  SCIPfreeBufferArray(scip, &cols);
19098  return SCIP_INVALIDDATA;
19099  }
19100  }
19101 
19102  /* check if the solving process should be aborted */
19103  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
19104  {
19105  /* mark this as if the LP failed */
19106  *lperror = TRUE;
19107  }
19108  else
19109  {
19110  /* call strong branching for columns with fractional value */
19111  SCIP_CALL( SCIPcolGetStrongbranches(cols, nvars, FALSE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
19112  down, up, downvalid, upvalid, lperror) );
19113 
19114  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
19115  * declare the sub nodes infeasible
19116  */
19117  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
19118  {
19119  for( j = 0; j < nvars; ++j )
19120  {
19121  SCIP_CALL( analyzeStrongbranch(scip, vars[j], (downinf != NULL) ? (&(downinf[j])) : NULL,
19122  (upinf != NULL) ? (&(upinf[j])) : NULL, (downconflict != NULL) ? (&(downconflict[j])) : NULL,
19123  (upconflict != NULL) ? (&(upconflict[j])) : NULL) );
19124  }
19125  }
19126  }
19127  SCIPfreeBufferArray(scip, &cols);
19128 
19129  return SCIP_OKAY;
19130 }
19131 
19132 /** gets strong branching information on column variables with integral values
19133  *
19134  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19135  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19136  *
19137  * @pre This method can be called if @p scip is in one of the following stages:
19138  * - \ref SCIP_STAGE_PRESOLVED
19139  * - \ref SCIP_STAGE_SOLVING
19140  */
19142  SCIP* scip, /**< SCIP data structure */
19143  SCIP_VAR** vars, /**< variables to get strong branching values for */
19144  int nvars, /**< number of variables */
19145  int itlim, /**< iteration limit for strong branchings */
19146  SCIP_Real* down, /**< stores dual bounds after branching variables down */
19147  SCIP_Real* up, /**< stores dual bounds after branching variables up */
19148  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds, or NULL;
19149  * otherwise, they can only be used as an estimate value */
19150  SCIP_Bool* upvalid, /**< stores whether the returned up values are valid dual bounds, or NULL;
19151  * otherwise, they can only be used as an estimate value */
19152  SCIP_Bool* downinf, /**< array to store whether the downward branches are infeasible, or NULL */
19153  SCIP_Bool* upinf, /**< array to store whether the upward branches are infeasible, or NULL */
19154  SCIP_Bool* downconflict, /**< array to store whether conflict constraints were created for
19155  * infeasible downward branches, or NULL */
19156  SCIP_Bool* upconflict, /**< array to store whether conflict constraints were created for
19157  * infeasible upward branches, or NULL */
19158  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
19159  * solving process should be stopped (e.g., due to a time limit) */
19160  )
19161 {
19162  SCIP_COL** cols;
19163  int j;
19164 
19165  assert(lperror != NULL);
19166 
19167  SCIP_CALL( checkStage(scip, "SCIPgetVarsStrongbranchesInt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19168 
19169  assert( vars != NULL );
19170 
19171  /* set up data */
19172  cols = NULL;
19173  SCIP_CALL( SCIPallocBufferArray(scip, &cols, nvars) );
19174  assert(cols != NULL);
19175  for( j = 0; j < nvars; ++j )
19176  {
19177  SCIP_VAR* var;
19178  SCIP_COL* col;
19179 
19180  if( downvalid != NULL )
19181  downvalid[j] = FALSE;
19182  if( upvalid != NULL )
19183  upvalid[j] = FALSE;
19184  if( downinf != NULL )
19185  downinf[j] = FALSE;
19186  if( upinf != NULL )
19187  upinf[j] = FALSE;
19188  if( downconflict != NULL )
19189  downconflict[j] = FALSE;
19190  if( upconflict != NULL )
19191  upconflict[j] = FALSE;
19192 
19193  var = vars[j];
19194  assert( var != NULL );
19196  {
19197  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
19198  SCIPfreeBufferArray(scip, &cols);
19199  return SCIP_INVALIDDATA;
19200  }
19201 
19202  col = SCIPvarGetCol(var);
19203  assert(col != NULL);
19204  cols[j] = col;
19205 
19206  if( !SCIPcolIsInLP(col) )
19207  {
19208  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
19209  SCIPfreeBufferArray(scip, &cols);
19210  return SCIP_INVALIDDATA;
19211  }
19212  }
19213 
19214  /* check if the solving process should be aborted */
19215  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
19216  {
19217  /* mark this as if the LP failed */
19218  *lperror = TRUE;
19219  }
19220  else
19221  {
19222  /* call strong branching for columns */
19223  SCIP_CALL( SCIPcolGetStrongbranches(cols, nvars, TRUE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
19224  down, up, downvalid, upvalid, lperror) );
19225 
19226  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
19227  * declare the sub nodes infeasible
19228  */
19229  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
19230  {
19231  for( j = 0; j < nvars; ++j )
19232  {
19233  SCIP_CALL( analyzeStrongbranch(scip, vars[j], (downinf != NULL) ? (&(downinf[j])) : NULL,
19234  (upinf != NULL) ? (&(upinf[j])) : NULL, (downconflict != NULL) ? (&(downconflict[j])) : NULL,
19235  (upconflict != NULL) ? (&(upconflict[j])) : NULL) );
19236 
19237  }
19238  }
19239  }
19240  SCIPfreeBufferArray(scip, &cols);
19241 
19242  return SCIP_OKAY;
19243 }
19244 
19245 /** gets strong branching information on COLUMN variable of the last SCIPgetVarStrongbranch() call;
19246  * returns values of SCIP_INVALID, if strong branching was not yet called on the given variable;
19247  * keep in mind, that the returned old values may have nothing to do with the current LP solution
19248  *
19249  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19250  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19251  *
19252  * @pre This method can be called if @p scip is in one of the following stages:
19253  * - \ref SCIP_STAGE_SOLVING
19254  * - \ref SCIP_STAGE_SOLVED
19255  */
19257  SCIP* scip, /**< SCIP data structure */
19258  SCIP_VAR* var, /**< variable to get last strong branching values for */
19259  SCIP_Real* down, /**< stores dual bound after branching column down */
19260  SCIP_Real* up, /**< stores dual bound after branching column up */
19261  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
19262  * otherwise, it can only be used as an estimate value */
19263  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
19264  * otherwise, it can only be used as an estimate value */
19265  SCIP_Real* solval, /**< stores LP solution value of variable at the last strong branching call, or NULL */
19266  SCIP_Real* lpobjval /**< stores LP objective value at last strong branching call, or NULL */
19267  )
19268 {
19269  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchLast", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
19270 
19272  {
19273  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable\n");
19274  return SCIP_INVALIDDATA;
19275  }
19276 
19277  SCIPcolGetStrongbranchLast(SCIPvarGetCol(var), down, up, downvalid, upvalid, solval, lpobjval);
19278 
19279  return SCIP_OKAY;
19280 }
19281 
19282 /** gets node number of the last node in current branch and bound run, where strong branching was used on the
19283  * given variable, or -1 if strong branching was never applied to the variable in current run
19284  *
19285  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19286  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19287  *
19288  * @pre This method can be called if @p scip is in one of the following stages:
19289  * - \ref SCIP_STAGE_TRANSFORMING
19290  * - \ref SCIP_STAGE_TRANSFORMED
19291  * - \ref SCIP_STAGE_INITPRESOLVE
19292  * - \ref SCIP_STAGE_PRESOLVING
19293  * - \ref SCIP_STAGE_EXITPRESOLVE
19294  * - \ref SCIP_STAGE_PRESOLVED
19295  * - \ref SCIP_STAGE_INITSOLVE
19296  * - \ref SCIP_STAGE_SOLVING
19297  * - \ref SCIP_STAGE_SOLVED
19298  * - \ref SCIP_STAGE_EXITSOLVE
19299  */
19301  SCIP* scip, /**< SCIP data structure */
19302  SCIP_VAR* var /**< variable to get last strong branching node for */
19303  )
19304 {
19305  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarStrongbranchNode", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
19306 
19307  assert( var->scip == scip );
19308 
19310  return -1;
19311 
19313 }
19314 
19315 /** if strong branching was already applied on the variable at the current node, returns the number of LPs solved after
19316  * the LP where the strong branching on this variable was applied;
19317  * if strong branching was not yet applied on the variable at the current node, returns INT_MAX
19318  *
19319  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19320  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19321  *
19322  * @pre This method can be called if @p scip is in one of the following stages:
19323  * - \ref SCIP_STAGE_TRANSFORMING
19324  * - \ref SCIP_STAGE_TRANSFORMED
19325  * - \ref SCIP_STAGE_INITPRESOLVE
19326  * - \ref SCIP_STAGE_PRESOLVING
19327  * - \ref SCIP_STAGE_EXITPRESOLVE
19328  * - \ref SCIP_STAGE_PRESOLVED
19329  * - \ref SCIP_STAGE_INITSOLVE
19330  * - \ref SCIP_STAGE_SOLVING
19331  * - \ref SCIP_STAGE_SOLVED
19332  * - \ref SCIP_STAGE_EXITSOLVE
19333  */
19335  SCIP* scip, /**< SCIP data structure */
19336  SCIP_VAR* var /**< variable to get strong branching LP age for */
19337  )
19338 {
19339  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarStrongbranchLPAge", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
19340 
19341  assert( var->scip == scip );
19342 
19344  return SCIP_LONGINT_MAX;
19345 
19346  return SCIPcolGetStrongbranchLPAge(SCIPvarGetCol(var), scip->stat);
19347 }
19348 
19349 /** gets number of times, strong branching was applied in current run on the given variable
19350  *
19351  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19352  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19353  *
19354  * @pre This method can be called if @p scip is in one of the following stages:
19355  * - \ref SCIP_STAGE_TRANSFORMING
19356  * - \ref SCIP_STAGE_TRANSFORMED
19357  * - \ref SCIP_STAGE_INITPRESOLVE
19358  * - \ref SCIP_STAGE_PRESOLVING
19359  * - \ref SCIP_STAGE_EXITPRESOLVE
19360  * - \ref SCIP_STAGE_PRESOLVED
19361  * - \ref SCIP_STAGE_INITSOLVE
19362  * - \ref SCIP_STAGE_SOLVING
19363  * - \ref SCIP_STAGE_SOLVED
19364  * - \ref SCIP_STAGE_EXITSOLVE
19365  */
19367  SCIP* scip, /**< SCIP data structure */
19368  SCIP_VAR* var /**< variable to get last strong branching node for */
19369  )
19370 {
19371  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarNStrongbranchs", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
19372 
19373  assert( var->scip == scip );
19374 
19376  return 0;
19377 
19379 }
19380 
19381 /** adds given values to lock numbers of variable for rounding
19382  *
19383  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19384  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19385  *
19386  * @pre This method can be called if @p scip is in one of the following stages:
19387  * - \ref SCIP_STAGE_PROBLEM
19388  * - \ref SCIP_STAGE_TRANSFORMING
19389  * - \ref SCIP_STAGE_TRANSFORMED
19390  * - \ref SCIP_STAGE_INITPRESOLVE
19391  * - \ref SCIP_STAGE_PRESOLVING
19392  * - \ref SCIP_STAGE_EXITPRESOLVE
19393  * - \ref SCIP_STAGE_PRESOLVED
19394  * - \ref SCIP_STAGE_INITSOLVE
19395  * - \ref SCIP_STAGE_SOLVING
19396  * - \ref SCIP_STAGE_EXITSOLVE
19397  * - \ref SCIP_STAGE_FREETRANS
19398  */
19400  SCIP* scip, /**< SCIP data structure */
19401  SCIP_VAR* var, /**< problem variable */
19402  int nlocksdown, /**< modification in number of rounding down locks */
19403  int nlocksup /**< modification in number of rounding up locks */
19404  )
19405 {
19406  SCIP_CALL( checkStage(scip, "SCIPaddVarLocks", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
19407 
19408  assert( var->scip == scip );
19409 
19410  switch( scip->set->stage )
19411  {
19412  case SCIP_STAGE_PROBLEM:
19413  assert(!SCIPvarIsTransformed(var));
19414  /*lint -fallthrough*/
19418  case SCIP_STAGE_PRESOLVING:
19420  case SCIP_STAGE_PRESOLVED:
19421  case SCIP_STAGE_INITSOLVE:
19422  case SCIP_STAGE_SOLVING:
19423  case SCIP_STAGE_EXITSOLVE:
19424  case SCIP_STAGE_FREETRANS:
19425  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, nlocksdown, nlocksup) );
19426  return SCIP_OKAY;
19427 
19428  default:
19429  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
19430  return SCIP_INVALIDCALL;
19431  } /*lint !e788*/
19432 }
19433 
19434 /** locks rounding of variable with respect to the lock status of the constraint and its negation;
19435  * this method should be called whenever the lock status of a variable in a constraint changes, for example if
19436  * the coefficient of the variable changed its sign or if the left or right hand sides of the constraint were
19437  * added or removed
19438  *
19439  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19440  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19441  *
19442  * @pre This method can be called if @p scip is in one of the following stages:
19443  * - \ref SCIP_STAGE_PROBLEM
19444  * - \ref SCIP_STAGE_TRANSFORMING
19445  * - \ref SCIP_STAGE_INITPRESOLVE
19446  * - \ref SCIP_STAGE_PRESOLVING
19447  * - \ref SCIP_STAGE_EXITPRESOLVE
19448  * - \ref SCIP_STAGE_INITSOLVE
19449  * - \ref SCIP_STAGE_SOLVING
19450  * - \ref SCIP_STAGE_EXITSOLVE
19451  * - \ref SCIP_STAGE_FREETRANS
19452  */
19454  SCIP* scip, /**< SCIP data structure */
19455  SCIP_VAR* var, /**< problem variable */
19456  SCIP_CONS* cons, /**< constraint */
19457  SCIP_Bool lockdown, /**< should the rounding be locked in downwards direction? */
19458  SCIP_Bool lockup /**< should the rounding be locked in upwards direction? */
19459  )
19460 {
19461  int nlocksdown;
19462  int nlocksup;
19463 
19464  SCIP_CALL( checkStage(scip, "SCIPlockVarCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
19465 
19466  assert( var->scip == scip );
19467 
19468  nlocksdown = 0;
19469  nlocksup = 0;
19470  if( SCIPconsIsLockedPos(cons) )
19471  {
19472  if( lockdown )
19473  nlocksdown++;
19474  if( lockup )
19475  nlocksup++;
19476  }
19477  if( SCIPconsIsLockedNeg(cons) )
19478  {
19479  if( lockdown )
19480  nlocksup++;
19481  if( lockup )
19482  nlocksdown++;
19483  }
19484 
19485  switch( scip->set->stage )
19486  {
19487  case SCIP_STAGE_PROBLEM:
19488  assert(!SCIPvarIsTransformed(var));
19489  /*lint -fallthrough*/
19492  case SCIP_STAGE_PRESOLVING:
19494  case SCIP_STAGE_INITSOLVE:
19495  case SCIP_STAGE_SOLVING:
19496  case SCIP_STAGE_EXITSOLVE:
19497  case SCIP_STAGE_FREETRANS:
19498  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, nlocksdown, nlocksup) );
19499  return SCIP_OKAY;
19500 
19501  default:
19502  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
19503  return SCIP_INVALIDCALL;
19504  } /*lint !e788*/
19505 }
19506 
19507 /** unlocks rounding of variable with respect to the lock status of the constraint and its negation;
19508  * this method should be called whenever the lock status of a variable in a constraint changes, for example if
19509  * the coefficient of the variable changed its sign or if the left or right hand sides of the constraint were
19510  * added or removed
19511  *
19512  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19513  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19514  *
19515  * @pre This method can be called if @p scip is in one of the following stages:
19516  * - \ref SCIP_STAGE_PROBLEM
19517  * - \ref SCIP_STAGE_TRANSFORMING
19518  * - \ref SCIP_STAGE_INITPRESOLVE
19519  * - \ref SCIP_STAGE_PRESOLVING
19520  * - \ref SCIP_STAGE_EXITPRESOLVE
19521  * - \ref SCIP_STAGE_INITSOLVE
19522  * - \ref SCIP_STAGE_SOLVING
19523  * - \ref SCIP_STAGE_EXITSOLVE
19524  * - \ref SCIP_STAGE_FREETRANS
19525  */
19527  SCIP* scip, /**< SCIP data structure */
19528  SCIP_VAR* var, /**< problem variable */
19529  SCIP_CONS* cons, /**< constraint */
19530  SCIP_Bool lockdown, /**< should the rounding be unlocked in downwards direction? */
19531  SCIP_Bool lockup /**< should the rounding be unlocked in upwards direction? */
19532  )
19533 {
19534  int nlocksdown;
19535  int nlocksup;
19536 
19537  SCIP_CALL( checkStage(scip, "SCIPunlockVarCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
19538 
19539  assert( var->scip == scip );
19540 
19541  nlocksdown = 0;
19542  nlocksup = 0;
19543  if( SCIPconsIsLockedPos(cons) )
19544  {
19545  if( lockdown )
19546  nlocksdown++;
19547  if( lockup )
19548  nlocksup++;
19549  }
19550  if( SCIPconsIsLockedNeg(cons) )
19551  {
19552  if( lockdown )
19553  nlocksup++;
19554  if( lockup )
19555  nlocksdown++;
19556  }
19557 
19558  switch( scip->set->stage )
19559  {
19560  case SCIP_STAGE_PROBLEM:
19561  assert(!SCIPvarIsTransformed(var));
19562  /*lint -fallthrough*/
19565  case SCIP_STAGE_PRESOLVING:
19567  case SCIP_STAGE_INITSOLVE:
19568  case SCIP_STAGE_SOLVING:
19569  case SCIP_STAGE_EXITSOLVE:
19570  case SCIP_STAGE_FREETRANS:
19571  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, -nlocksdown, -nlocksup) );
19572  return SCIP_OKAY;
19573 
19574  default:
19575  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
19576  return SCIP_INVALIDCALL;
19577  } /*lint !e788*/
19578 }
19579 
19580 /** changes variable's objective value
19581  *
19582  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19583  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19584  *
19585  * @pre This method can be called if @p scip is in one of the following stages:
19586  * - \ref SCIP_STAGE_PROBLEM
19587  * - \ref SCIP_STAGE_TRANSFORMING
19588  * - \ref SCIP_STAGE_PRESOLVING
19589  */
19591  SCIP* scip, /**< SCIP data structure */
19592  SCIP_VAR* var, /**< variable to change the objective value for */
19593  SCIP_Real newobj /**< new objective value */
19594  )
19595 {
19596  SCIP_CALL( checkStage(scip, "SCIPchgVarObj", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
19597 
19598  assert( var->scip == scip );
19599 
19600  /* forbid infinite objective values */
19601  if( SCIPisInfinity(scip, REALABS(newobj)) )
19602  {
19603  SCIPerrorMessage("invalid objective value: objective value is infinite\n");
19604  return SCIP_INVALIDDATA;
19605  }
19606 
19607  switch( scip->set->stage )
19608  {
19609  case SCIP_STAGE_PROBLEM:
19610  assert(!SCIPvarIsTransformed(var));
19611  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->origprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
19612  return SCIP_OKAY;
19613 
19615  case SCIP_STAGE_PRESOLVING:
19616  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
19617  return SCIP_OKAY;
19618 
19619  default:
19620  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
19621  return SCIP_INVALIDCALL;
19622  } /*lint !e788*/
19623 }
19624 
19625 /** adds value to variable's objective value
19626  *
19627  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19628  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19629  *
19630  * @pre This method can be called if @p scip is in one of the following stages:
19631  * - \ref SCIP_STAGE_PROBLEM
19632  * - \ref SCIP_STAGE_TRANSFORMING
19633  * - \ref SCIP_STAGE_PRESOLVING
19634  */
19636  SCIP* scip, /**< SCIP data structure */
19637  SCIP_VAR* var, /**< variable to change the objective value for */
19638  SCIP_Real addobj /**< additional objective value */
19639  )
19640 {
19641  SCIP_CALL( checkStage(scip, "SCIPaddVarObj", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
19642 
19643  assert( var->scip == scip );
19644 
19645  switch( scip->set->stage )
19646  {
19647  case SCIP_STAGE_PROBLEM:
19648  assert(!SCIPvarIsTransformed(var));
19649  SCIP_CALL( SCIPvarAddObj(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->primal,
19650  scip->tree, scip->reopt, scip->lp, scip->eventqueue, addobj) );
19651  return SCIP_OKAY;
19652 
19654  case SCIP_STAGE_PRESOLVING:
19656  SCIP_CALL( SCIPvarAddObj(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->primal,
19657  scip->tree, scip->reopt, scip->lp, scip->eventqueue, addobj) );
19658  return SCIP_OKAY;
19659 
19660  default:
19661  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
19662  return SCIP_INVALIDCALL;
19663  } /*lint !e788*/
19664 }
19665 
19666 /** returns the adjusted (i.e. rounded, if the given variable is of integral type) lower bound value;
19667  * does not change the bounds of the variable
19668  *
19669  * @return adjusted lower bound for the given variable; the bound of the variable is not changed
19670  *
19671  * @pre This method can be called if @p scip is in one of the following stages:
19672  * - \ref SCIP_STAGE_PROBLEM
19673  * - \ref SCIP_STAGE_TRANSFORMING
19674  * - \ref SCIP_STAGE_TRANSFORMED
19675  * - \ref SCIP_STAGE_INITPRESOLVE
19676  * - \ref SCIP_STAGE_PRESOLVING
19677  * - \ref SCIP_STAGE_EXITPRESOLVE
19678  * - \ref SCIP_STAGE_PRESOLVED
19679  * - \ref SCIP_STAGE_INITSOLVE
19680  * - \ref SCIP_STAGE_SOLVING
19681  * - \ref SCIP_STAGE_SOLVED
19682  * - \ref SCIP_STAGE_EXITSOLVE
19683  * - \ref SCIP_STAGE_FREETRANS
19684  */
19686  SCIP* scip, /**< SCIP data structure */
19687  SCIP_VAR* var, /**< variable to adjust the bound for */
19688  SCIP_Real lb /**< lower bound value to adjust */
19689  )
19690 {
19691  SCIP_CALL_ABORT( checkStage(scip, "SCIPadjustedVarLb", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19692 
19693  SCIPvarAdjustLb(var, scip->set, &lb);
19694 
19695  return lb;
19696 }
19697 
19698 /** returns the adjusted (i.e. rounded, if the given variable is of integral type) upper bound value;
19699  * does not change the bounds of the variable
19700  *
19701  * @return adjusted upper bound for the given variable; the bound of the variable is not changed
19702  *
19703  * @pre This method can be called if @p scip is in one of the following stages:
19704  * - \ref SCIP_STAGE_PROBLEM
19705  * - \ref SCIP_STAGE_TRANSFORMING
19706  * - \ref SCIP_STAGE_TRANSFORMED
19707  * - \ref SCIP_STAGE_INITPRESOLVE
19708  * - \ref SCIP_STAGE_PRESOLVING
19709  * - \ref SCIP_STAGE_EXITPRESOLVE
19710  * - \ref SCIP_STAGE_PRESOLVED
19711  * - \ref SCIP_STAGE_INITSOLVE
19712  * - \ref SCIP_STAGE_SOLVING
19713  * - \ref SCIP_STAGE_SOLVED
19714  * - \ref SCIP_STAGE_EXITSOLVE
19715  * - \ref SCIP_STAGE_FREETRANS
19716  */
19718  SCIP* scip, /**< SCIP data structure */
19719  SCIP_VAR* var, /**< variable to adjust the bound for */
19720  SCIP_Real ub /**< upper bound value to adjust */
19721  )
19722 {
19723  SCIP_CALL_ABORT( checkStage(scip, "SCIPadjustedVarUb", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19724 
19725  SCIPvarAdjustUb(var, scip->set, &ub);
19726 
19727  return ub;
19728 }
19729 
19730 /** depending on SCIP's stage, changes lower bound of variable in the problem, in preprocessing, or in current node;
19731  * if possible, adjusts bound to integral value; doesn't store any inference information in the bound change, such
19732  * that in conflict analysis, this change is treated like a branching decision
19733  *
19734  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
19735  * SCIPgetVars()) gets resorted.
19736  *
19737  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19738  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19739  *
19740  * @pre This method can be called if @p scip is in one of the following stages:
19741  * - \ref SCIP_STAGE_PROBLEM
19742  * - \ref SCIP_STAGE_TRANSFORMING
19743  * - \ref SCIP_STAGE_PRESOLVING
19744  * - \ref SCIP_STAGE_SOLVING
19745  *
19746  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
19747  */
19749  SCIP* scip, /**< SCIP data structure */
19750  SCIP_VAR* var, /**< variable to change the bound for */
19751  SCIP_Real newbound /**< new value for bound */
19752  )
19753 {
19754  SCIP_CALL( checkStage(scip, "SCIPchgVarLb", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19755 
19756  SCIPvarAdjustLb(var, scip->set, &newbound);
19757 
19758  switch( scip->set->stage )
19759  {
19760  case SCIP_STAGE_PROBLEM:
19761  assert(!SCIPvarIsTransformed(var));
19762  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
19763  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
19764  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
19765  scip->branchcand, scip->eventqueue, newbound) );
19766  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
19767  break;
19768 
19770  case SCIP_STAGE_PRESOLVED:
19771  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
19772  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
19773  break;
19774 
19775  case SCIP_STAGE_PRESOLVING:
19776  if( !SCIPinProbing(scip) )
19777  {
19778  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
19779  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
19780 
19781  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
19782  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
19783  var, newbound, SCIP_BOUNDTYPE_LOWER, FALSE) );
19784 
19786  {
19787  SCIP_Bool infeasible;
19788 
19789  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
19790  assert(!infeasible);
19791  }
19792  break;
19793  }
19794  /*lint -fallthrough*/
19795  case SCIP_STAGE_SOLVING:
19797  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
19798  scip->cliquetable, var, newbound,
19800  break;
19801 
19802  default:
19803  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
19804  return SCIP_INVALIDCALL;
19805  } /*lint !e788*/
19806 
19807  return SCIP_OKAY;
19808 }
19809 
19810 /** depending on SCIP's stage, changes upper bound of variable in the problem, in preprocessing, or in current node;
19811  * if possible, adjusts bound to integral value; doesn't store any inference information in the bound change, such
19812  * that in conflict analysis, this change is treated like a branching decision
19813  *
19814  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
19815  * SCIPgetVars()) gets resorted.
19816  *
19817  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19818  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19819  *
19820  * @pre This method can be called if @p scip is in one of the following stages:
19821  * - \ref SCIP_STAGE_PROBLEM
19822  * - \ref SCIP_STAGE_TRANSFORMING
19823  * - \ref SCIP_STAGE_PRESOLVING
19824  * - \ref SCIP_STAGE_SOLVING
19825  *
19826  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
19827  */
19829  SCIP* scip, /**< SCIP data structure */
19830  SCIP_VAR* var, /**< variable to change the bound for */
19831  SCIP_Real newbound /**< new value for bound */
19832  )
19833 {
19834  SCIP_CALL( checkStage(scip, "SCIPchgVarUb", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19835 
19836  SCIPvarAdjustUb(var, scip->set, &newbound);
19837 
19838  switch( scip->set->stage )
19839  {
19840  case SCIP_STAGE_PROBLEM:
19841  assert(!SCIPvarIsTransformed(var));
19842  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
19843  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
19844  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
19845  scip->branchcand, scip->eventqueue, newbound) );
19846  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
19847  break;
19848 
19850  case SCIP_STAGE_PRESOLVED:
19851  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
19852  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
19853  break;
19854 
19855  case SCIP_STAGE_PRESOLVING:
19856  if( !SCIPinProbing(scip) )
19857  {
19858  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
19859  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
19860 
19861  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
19862  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
19863  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
19864 
19866  {
19867  SCIP_Bool infeasible;
19868 
19869  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
19870  assert(!infeasible);
19871  }
19872  break;
19873  }
19874  /*lint -fallthrough*/
19875  case SCIP_STAGE_SOLVING:
19877  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
19878  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
19879  break;
19880 
19881  default:
19882  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
19883  return SCIP_INVALIDCALL;
19884  } /*lint !e788*/
19885 
19886  return SCIP_OKAY;
19887 }
19888 
19889 /** changes lower bound of variable in the given node; if possible, adjust bound to integral value; doesn't store any
19890  * inference information in the bound change, such that in conflict analysis, this change is treated like a branching
19891  * decision
19892  *
19893  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19894  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19895  *
19896  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
19897  */
19899  SCIP* scip, /**< SCIP data structure */
19900  SCIP_NODE* node, /**< node to change bound at, or NULL for current node */
19901  SCIP_VAR* var, /**< variable to change the bound for */
19902  SCIP_Real newbound /**< new value for bound */
19903  )
19904 {
19905  SCIP_CALL( checkStage(scip, "SCIPchgVarLbNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19906 
19907  if( node == NULL )
19908  {
19909  SCIP_CALL( SCIPchgVarLb(scip, var, newbound) );
19910  }
19911  else
19912  {
19913  SCIPvarAdjustLb(var, scip->set, &newbound);
19914  SCIP_CALL( SCIPnodeAddBoundchg(node, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
19915  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
19917  }
19918 
19919  return SCIP_OKAY;
19920 }
19921 
19922 /** changes upper bound of variable in the given node; if possible, adjust bound to integral value; doesn't store any
19923  * inference information in the bound change, such that in conflict analysis, this change is treated like a branching
19924  * decision
19925  *
19926  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19927  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19928  *
19929  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
19930  */
19932  SCIP* scip, /**< SCIP data structure */
19933  SCIP_NODE* node, /**< node to change bound at, or NULL for current node */
19934  SCIP_VAR* var, /**< variable to change the bound for */
19935  SCIP_Real newbound /**< new value for bound */
19936  )
19937 {
19938  SCIP_CALL( checkStage(scip, "SCIPchgVarUbNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19939 
19940  if( node == NULL )
19941  {
19942  SCIP_CALL( SCIPchgVarUb(scip, var, newbound) );
19943  }
19944  else
19945  {
19946  SCIPvarAdjustUb(var, scip->set, &newbound);
19947  SCIP_CALL( SCIPnodeAddBoundchg(node, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
19948  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
19950  }
19951 
19952  return SCIP_OKAY;
19953 }
19954 
19955 /** changes global lower bound of variable; if possible, adjust bound to integral value; also tightens the local bound,
19956  * if the global bound is better than the local bound
19957  *
19958  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
19959  * SCIPgetVars()) gets resorted.
19960  *
19961  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19962  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19963  *
19964  * @pre This method can be called if @p scip is in one of the following stages:
19965  * - \ref SCIP_STAGE_PROBLEM
19966  * - \ref SCIP_STAGE_TRANSFORMING
19967  * - \ref SCIP_STAGE_PRESOLVING
19968  * - \ref SCIP_STAGE_SOLVING
19969  *
19970  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
19971  */
19973  SCIP* scip, /**< SCIP data structure */
19974  SCIP_VAR* var, /**< variable to change the bound for */
19975  SCIP_Real newbound /**< new value for bound */
19976  )
19977 {
19978  SCIP_CALL( checkStage(scip, "SCIPchgVarLbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19979 
19980  SCIPvarAdjustLb(var, scip->set, &newbound);
19981 
19982  switch( scip->set->stage )
19983  {
19984  case SCIP_STAGE_PROBLEM:
19985  assert(!SCIPvarIsTransformed(var));
19986  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
19987  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
19988  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
19989  scip->branchcand, scip->eventqueue, newbound) );
19990  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
19991  break;
19992 
19994  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
19995  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
19996  break;
19997 
19998  case SCIP_STAGE_PRESOLVING:
19999  if( !SCIPinProbing(scip) )
20000  {
20001  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
20002  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
20003 
20004  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
20005  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
20007 
20009  {
20010  SCIP_Bool infeasible;
20011 
20012  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
20013  assert(!infeasible);
20014  }
20015  break;
20016  }
20017  /*lint -fallthrough*/
20018  case SCIP_STAGE_SOLVING:
20019  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
20020  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
20022  break;
20023 
20024  default:
20025  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
20026  return SCIP_INVALIDCALL;
20027  } /*lint !e788*/
20028 
20029  return SCIP_OKAY;
20030 }
20031 
20032 /** changes global upper bound of variable; if possible, adjust bound to integral value; also tightens the local bound,
20033  * if the global bound is better than the local bound
20034  *
20035  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
20036  * SCIPgetVars()) gets resorted.
20037  *
20038  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20039  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20040  *
20041  * @pre This method can be called if @p scip is in one of the following stages:
20042  * - \ref SCIP_STAGE_PROBLEM
20043  * - \ref SCIP_STAGE_TRANSFORMING
20044  * - \ref SCIP_STAGE_PRESOLVING
20045  * - \ref SCIP_STAGE_SOLVING
20046  *
20047  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
20048  */
20050  SCIP* scip, /**< SCIP data structure */
20051  SCIP_VAR* var, /**< variable to change the bound for */
20052  SCIP_Real newbound /**< new value for bound */
20053  )
20054 {
20055  SCIP_CALL( checkStage(scip, "SCIPchgVarUbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20056 
20057  SCIPvarAdjustUb(var, scip->set, &newbound);
20058 
20059  switch( scip->set->stage )
20060  {
20061  case SCIP_STAGE_PROBLEM:
20062  assert(!SCIPvarIsTransformed(var));
20063  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20064  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
20065  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20066  scip->branchcand, scip->eventqueue, newbound) );
20067  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
20068  break;
20069 
20071  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20072  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
20073  break;
20074 
20075  case SCIP_STAGE_PRESOLVING:
20076  if( !SCIPinProbing(scip) )
20077  {
20078  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
20079  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
20080 
20081  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
20082  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
20084 
20086  {
20087  SCIP_Bool infeasible;
20088 
20089  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
20090  assert(!infeasible);
20091  }
20092  break;
20093  }
20094  /*lint -fallthrough*/
20095  case SCIP_STAGE_SOLVING:
20096  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
20097  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
20099  break;
20100 
20101  default:
20102  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
20103  return SCIP_INVALIDCALL;
20104  } /*lint !e788*/
20105 
20106  return SCIP_OKAY;
20107 }
20108 
20109 /** changes lazy lower bound of the variable, this is only possible if the variable is not in the LP yet
20110  *
20111  * lazy bounds are bounds, that are enforced by constraints and the objective function; hence, these bounds do not need
20112  * to be put into the LP explicitly.
20113  *
20114  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20115  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20116  *
20117  * @pre This method can be called if @p scip is in one of the following stages:
20118  * - \ref SCIP_STAGE_PROBLEM
20119  * - \ref SCIP_STAGE_TRANSFORMING
20120  * - \ref SCIP_STAGE_TRANSFORMED
20121  * - \ref SCIP_STAGE_PRESOLVING
20122  * - \ref SCIP_STAGE_SOLVING
20123  *
20124  * @note lazy bounds are useful for branch-and-price since the corresponding variable bounds are not part of the LP
20125  */
20127  SCIP* scip, /**< SCIP data structure */
20128  SCIP_VAR* var, /**< problem variable */
20129  SCIP_Real lazylb /**< the lazy lower bound to be set */
20130  )
20131 {
20132  assert(scip != NULL);
20133  assert(var != NULL);
20134 
20135  SCIP_CALL( checkStage(scip, "SCIPchgVarLbLazy", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20136 
20137  SCIP_CALL( SCIPvarChgLbLazy(var, scip->set, lazylb) );
20138 
20139  return SCIP_OKAY;
20140 }
20141 
20142 /** changes lazy upper bound of the variable, this is only possible if the variable is not in the LP yet
20143  *
20144  * lazy bounds are bounds, that are enforced by constraints and the objective function; hence, these bounds do not need
20145  * to be put into the LP explicitly.
20146  *
20147  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20148  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20149  *
20150  * @pre This method can be called if @p scip is in one of the following stages:
20151  * - \ref SCIP_STAGE_PROBLEM
20152  * - \ref SCIP_STAGE_TRANSFORMING
20153  * - \ref SCIP_STAGE_TRANSFORMED
20154  * - \ref SCIP_STAGE_PRESOLVING
20155  * - \ref SCIP_STAGE_SOLVING
20156  *
20157  * @note lazy bounds are useful for branch-and-price since the corresponding variable bounds are not part of the LP
20158  */
20160  SCIP* scip, /**< SCIP data structure */
20161  SCIP_VAR* var, /**< problem variable */
20162  SCIP_Real lazyub /**< the lazy lower bound to be set */
20163  )
20164 {
20165  assert(scip != NULL);
20166  assert(var != NULL);
20167 
20168  SCIP_CALL( checkStage(scip, "SCIPchgVarUbLazy", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20169 
20170  SCIP_CALL( SCIPvarChgUbLazy(var, scip->set, lazyub) );
20171 
20172  return SCIP_OKAY;
20173 }
20174 
20175 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
20176  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
20177  * doesn't store any inference information in the bound change, such that in conflict analysis, this change
20178  * is treated like a branching decision
20179  *
20180  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
20181  * SCIPgetVars()) gets resorted.
20182  *
20183  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20184  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20185  *
20186  * @pre This method can be called if @p scip is in one of the following stages:
20187  * - \ref SCIP_STAGE_PROBLEM
20188  * - \ref SCIP_STAGE_PRESOLVING
20189  * - \ref SCIP_STAGE_SOLVING
20190  *
20191  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
20192  */
20194  SCIP* scip, /**< SCIP data structure */
20195  SCIP_VAR* var, /**< variable to change the bound for */
20196  SCIP_Real newbound, /**< new value for bound */
20197  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
20198  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
20199  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
20200  )
20201 {
20202  SCIP_Real lb;
20203  SCIP_Real ub;
20204 
20205  assert(infeasible != NULL);
20206  /** @todo if needed provide pending local/global bound changes that will be flushed after leaving diving mode (as in struct_tree.h) */
20207  assert(!SCIPinDive(scip));
20208 
20209  SCIP_CALL( checkStage(scip, "SCIPtightenVarLb", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20210 
20211  *infeasible = FALSE;
20212  if( tightened != NULL )
20213  *tightened = FALSE;
20214 
20215  SCIPvarAdjustLb(var, scip->set, &newbound);
20216 
20217  /* get current bounds */
20218  lb = SCIPcomputeVarLbLocal(scip, var);
20219  ub = SCIPcomputeVarUbLocal(scip, var);
20220  assert(SCIPsetIsLE(scip->set, lb, ub));
20221 
20222  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
20223  {
20224  *infeasible = TRUE;
20225  return SCIP_OKAY;
20226  }
20227  newbound = MIN(newbound, ub);
20228 
20229  if( (force && SCIPsetIsLE(scip->set, newbound, lb)) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
20230  return SCIP_OKAY;
20231 
20232  switch( scip->set->stage )
20233  {
20234  case SCIP_STAGE_PROBLEM:
20235  assert(!SCIPvarIsTransformed(var));
20236  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20237  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
20238  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20239  scip->branchcand, scip->eventqueue, newbound) );
20240  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
20241  break;
20243  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20244  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
20245  break;
20246  case SCIP_STAGE_PRESOLVING:
20247  if( !SCIPinProbing(scip) )
20248  {
20249  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
20250  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
20251 
20252  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
20253  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
20255 
20257  {
20258  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
20259  assert(!(*infeasible));
20260  }
20261  break;
20262  }
20263  /*lint -fallthrough*/
20264  case SCIP_STAGE_SOLVING:
20266  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
20267  var, newbound, SCIP_BOUNDTYPE_LOWER, FALSE) );
20268  break;
20269 
20270  default:
20271  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
20272  return SCIP_INVALIDCALL;
20273  } /*lint !e788*/
20274 
20275  if( tightened != NULL )
20276  *tightened = TRUE;
20277 
20278  return SCIP_OKAY;
20279 }
20280 
20281 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
20282  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
20283  * doesn't store any inference information in the bound change, such that in conflict analysis, this change
20284  * is treated like a branching decision
20285  *
20286  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
20287  * SCIPgetVars()) gets resorted.
20288  *
20289  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20290  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20291  *
20292  * @pre This method can be called if @p scip is in one of the following stages:
20293  * - \ref SCIP_STAGE_PROBLEM
20294  * - \ref SCIP_STAGE_PRESOLVING
20295  * - \ref SCIP_STAGE_SOLVING
20296  *
20297  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
20298  */
20300  SCIP* scip, /**< SCIP data structure */
20301  SCIP_VAR* var, /**< variable to change the bound for */
20302  SCIP_Real newbound, /**< new value for bound */
20303  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
20304  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
20305  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
20306  )
20307 {
20308  SCIP_Real lb;
20309  SCIP_Real ub;
20310 
20311  assert(infeasible != NULL);
20312  /** @todo if needed provide pending local/global bound changes that will be flushed after leaving diving mode (as in struct_tree.h) */
20313  assert(!SCIPinDive(scip));
20314 
20315  SCIP_CALL( checkStage(scip, "SCIPtightenVarUb", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20316 
20317  *infeasible = FALSE;
20318  if( tightened != NULL )
20319  *tightened = FALSE;
20320 
20321  SCIPvarAdjustUb(var, scip->set, &newbound);
20322 
20323  /* get current bounds */
20324  lb = SCIPcomputeVarLbLocal(scip, var);
20325  ub = SCIPcomputeVarUbLocal(scip, var);
20326  assert(SCIPsetIsLE(scip->set, lb, ub));
20327 
20328  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
20329  {
20330  *infeasible = TRUE;
20331  return SCIP_OKAY;
20332  }
20333  newbound = MAX(newbound, lb);
20334 
20335  if( (force && SCIPsetIsGE(scip->set, newbound, ub)) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
20336  return SCIP_OKAY;
20337 
20338  switch( scip->set->stage )
20339  {
20340  case SCIP_STAGE_PROBLEM:
20341  assert(!SCIPvarIsTransformed(var));
20342  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20343  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
20344  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20345  scip->branchcand, scip->eventqueue, newbound) );
20346  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
20347  break;
20349  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20350  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
20351  break;
20352  case SCIP_STAGE_PRESOLVING:
20353  if( !SCIPinProbing(scip) )
20354  {
20355  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
20356  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
20357 
20358  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
20359  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
20361 
20363  {
20364  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
20365  assert(!(*infeasible));
20366  }
20367  break;
20368  }
20369  /*lint -fallthrough*/
20370  case SCIP_STAGE_SOLVING:
20372  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
20373  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
20374  break;
20375 
20376  default:
20377  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
20378  return SCIP_INVALIDCALL;
20379  } /*lint !e788*/
20380 
20381  if( tightened != NULL )
20382  *tightened = TRUE;
20383 
20384  return SCIP_OKAY;
20385 }
20386 
20387 /** fixes variable in preprocessing or in the current node, if the new bound is tighter (w.r.t. bound strengthening
20388  * epsilon) than the current bound; if possible, adjusts bound to integral value; the given inference constraint is
20389  * stored, such that the conflict analysis is able to find out the reason for the deduction of the bound change
20390  *
20391  * @note In presolving stage when not in probing mode the variable will be fixed directly, otherwise this method
20392  * changes first the lowerbound by calling SCIPinferVarLbCons and second the upperbound by calling
20393  * SCIPinferVarUbCons
20394  *
20395  * @note If SCIP is in presolving stage, it can happen that the internal variable array (which get be accessed via
20396  * SCIPgetVars()) gets resorted.
20397  *
20398  * @note During presolving, an integer variable which bound changes to {0,1} is upgraded to a binary variable.
20399  */
20401  SCIP* scip, /**< SCIP data structure */
20402  SCIP_VAR* var, /**< variable to change the bound for */
20403  SCIP_Real fixedval, /**< new value for fixation */
20404  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
20405  int inferinfo, /**< user information for inference to help resolving the conflict */
20406  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
20407  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
20408  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
20409  )
20410 {
20411  assert(scip != NULL);
20412  assert(var != NULL);
20413  assert(infeasible != NULL);
20414 
20415  SCIP_CALL( checkStage(scip, "SCIPinferVarFixCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20416 
20417  if( tightened != NULL )
20418  *tightened = FALSE;
20419 
20420  /* in presolving case we take the shortcut to directly fix the variables */
20421  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVING && SCIPtreeGetCurrentDepth(scip->tree) == 0 )
20422  {
20423  SCIP_Bool fixed;
20424 
20425  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
20426  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
20427  fixedval, infeasible, &fixed) );
20428 
20429  if( tightened != NULL )
20430  *tightened = fixed;
20431  }
20432  /* otherwise we use the lb and ub methods */
20433  else
20434  {
20435  SCIP_Bool lbtightened;
20436 
20437  SCIP_CALL( SCIPinferVarLbCons(scip, var, fixedval, infercons, inferinfo, force, infeasible, &lbtightened) );
20438 
20439  if( ! (*infeasible) )
20440  {
20441  SCIP_CALL( SCIPinferVarUbCons(scip, var, fixedval, infercons, inferinfo, force, infeasible, tightened) );
20442 
20443  if( tightened != NULL )
20444  *tightened |= lbtightened;
20445  }
20446  }
20447 
20448  return SCIP_OKAY;
20449 }
20450 
20451 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
20452  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
20453  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason
20454  * for the deduction of the bound change
20455  *
20456  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
20457  * SCIPgetVars()) gets resorted.
20458  *
20459  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20460  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20461  *
20462  * @pre This method can be called if @p scip is in one of the following stages:
20463  * - \ref SCIP_STAGE_PROBLEM
20464  * - \ref SCIP_STAGE_PRESOLVING
20465  * - \ref SCIP_STAGE_SOLVING
20466  *
20467  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
20468  */
20470  SCIP* scip, /**< SCIP data structure */
20471  SCIP_VAR* var, /**< variable to change the bound for */
20472  SCIP_Real newbound, /**< new value for bound */
20473  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
20474  int inferinfo, /**< user information for inference to help resolving the conflict */
20475  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
20476  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
20477  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
20478  )
20479 {
20480  SCIP_Real lb;
20481  SCIP_Real ub;
20482 
20483  assert(infeasible != NULL);
20484 
20485  SCIP_CALL( checkStage(scip, "SCIPinferVarLbCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20486 
20487  *infeasible = FALSE;
20488  if( tightened != NULL )
20489  *tightened = FALSE;
20490 
20491  SCIPvarAdjustLb(var, scip->set, &newbound);
20492 
20493  /* get current bounds */
20494  lb = SCIPvarGetLbLocal(var);
20495  ub = SCIPvarGetUbLocal(var);
20496  assert(SCIPsetIsLE(scip->set, lb, ub));
20497 
20498  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
20499  {
20500  *infeasible = TRUE;
20501  return SCIP_OKAY;
20502  }
20503  newbound = MIN(newbound, ub);
20504 
20505  if( (force && SCIPsetIsLE(scip->set, newbound, lb)) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
20506  return SCIP_OKAY;
20507 
20508  switch( scip->set->stage )
20509  {
20510  case SCIP_STAGE_PROBLEM:
20511  assert(!SCIPvarIsTransformed(var));
20512  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20513  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
20514  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20515  scip->branchcand, scip->eventqueue, newbound) );
20516  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
20517  break;
20518 
20519  case SCIP_STAGE_PRESOLVING:
20520  if( !SCIPinProbing(scip) )
20521  {
20522  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
20523  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
20524 
20525  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
20526  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
20528 
20530  {
20531  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
20532  assert(!(*infeasible));
20533  }
20534  break;
20535  }
20536  /*lint -fallthrough*/
20537  case SCIP_STAGE_SOLVING:
20539  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
20540  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_LOWER, infercons, NULL, inferinfo, FALSE) );
20541  break;
20542 
20543  default:
20544  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
20545  return SCIP_INVALIDCALL;
20546  } /*lint !e788*/
20547 
20548  if( tightened != NULL )
20549  *tightened = TRUE;
20550 
20551  return SCIP_OKAY;
20552 }
20553 
20554 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
20555  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
20556  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason
20557  * for the deduction of the bound change
20558  *
20559  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
20560  * SCIPgetVars()) gets resorted.
20561  *
20562  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20563  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20564  *
20565  * @pre This method can be called if @p scip is in one of the following stages:
20566  * - \ref SCIP_STAGE_PROBLEM
20567  * - \ref SCIP_STAGE_PRESOLVING
20568  * - \ref SCIP_STAGE_SOLVING
20569  *
20570  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
20571  */
20573  SCIP* scip, /**< SCIP data structure */
20574  SCIP_VAR* var, /**< variable to change the bound for */
20575  SCIP_Real newbound, /**< new value for bound */
20576  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
20577  int inferinfo, /**< user information for inference to help resolving the conflict */
20578  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
20579  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
20580  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
20581  )
20582 {
20583  SCIP_Real lb;
20584  SCIP_Real ub;
20585 
20586  assert(infeasible != NULL);
20587 
20588  SCIP_CALL( checkStage(scip, "SCIPinferVarUbCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20589 
20590  *infeasible = FALSE;
20591  if( tightened != NULL )
20592  *tightened = FALSE;
20593 
20594  SCIPvarAdjustUb(var, scip->set, &newbound);
20595 
20596  /* get current bounds */
20597  lb = SCIPvarGetLbLocal(var);
20598  ub = SCIPvarGetUbLocal(var);
20599  assert(SCIPsetIsLE(scip->set, lb, ub));
20600 
20601  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
20602  {
20603  *infeasible = TRUE;
20604  return SCIP_OKAY;
20605  }
20606  newbound = MAX(newbound, lb);
20607 
20608  if( (force && SCIPsetIsGE(scip->set, newbound, ub)) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
20609  return SCIP_OKAY;
20610 
20611  switch( scip->set->stage )
20612  {
20613  case SCIP_STAGE_PROBLEM:
20614  assert(!SCIPvarIsTransformed(var));
20615  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20616  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
20617  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20618  scip->branchcand, scip->eventqueue, newbound) );
20619  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
20620  break;
20621 
20622  case SCIP_STAGE_PRESOLVING:
20623  if( !SCIPinProbing(scip) )
20624  {
20625  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
20626  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
20627 
20628  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
20629  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
20631 
20633  {
20634  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
20635  assert(!(*infeasible));
20636  }
20637  break;
20638  }
20639  /*lint -fallthrough*/
20640  case SCIP_STAGE_SOLVING:
20642  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
20643  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, infercons, NULL, inferinfo, FALSE) );
20644  break;
20645 
20646  default:
20647  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
20648  return SCIP_INVALIDCALL;
20649  } /*lint !e788*/
20650 
20651  if( tightened != NULL )
20652  *tightened = TRUE;
20653 
20654  return SCIP_OKAY;
20655 }
20656 
20657 /** depending on SCIP's stage, fixes binary variable in the problem, in preprocessing, or in current node;
20658  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason for the
20659  * deduction of the fixing
20660  *
20661  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20662  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20663  *
20664  * @pre This method can be called if @p scip is in one of the following stages:
20665  * - \ref SCIP_STAGE_PROBLEM
20666  * - \ref SCIP_STAGE_PRESOLVING
20667  * - \ref SCIP_STAGE_SOLVING
20668  */
20670  SCIP* scip, /**< SCIP data structure */
20671  SCIP_VAR* var, /**< binary variable to fix */
20672  SCIP_Bool fixedval, /**< value to fix binary variable to */
20673  SCIP_CONS* infercons, /**< constraint that deduced the fixing */
20674  int inferinfo, /**< user information for inference to help resolving the conflict */
20675  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
20676  SCIP_Bool* tightened /**< pointer to store whether the fixing tightened the local bounds, or NULL */
20677  )
20678 {
20679  SCIP_Real lb;
20680  SCIP_Real ub;
20681 
20682  assert(SCIPvarIsBinary(var));
20683  assert(fixedval == TRUE || fixedval == FALSE);
20684  assert(infeasible != NULL);
20685 
20686  SCIP_CALL( checkStage(scip, "SCIPinferBinvarCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20687 
20688  *infeasible = FALSE;
20689  if( tightened != NULL )
20690  *tightened = FALSE;
20691 
20692  /* get current bounds */
20693  lb = SCIPvarGetLbLocal(var);
20694  ub = SCIPvarGetUbLocal(var);
20695  assert(SCIPsetIsEQ(scip->set, lb, 0.0) || SCIPsetIsEQ(scip->set, lb, 1.0));
20696  assert(SCIPsetIsEQ(scip->set, ub, 0.0) || SCIPsetIsEQ(scip->set, ub, 1.0));
20697  assert(SCIPsetIsLE(scip->set, lb, ub));
20698 
20699  /* check, if variable is already fixed */
20700  if( (lb > 0.5) || (ub < 0.5) )
20701  {
20702  *infeasible = (fixedval == (lb < 0.5));
20703 
20704  return SCIP_OKAY;
20705  }
20706 
20707  /* apply the fixing */
20708  switch( scip->set->stage )
20709  {
20710  case SCIP_STAGE_PROBLEM:
20711  assert(!SCIPvarIsTransformed(var));
20712  if( fixedval == TRUE )
20713  {
20714  SCIP_CALL( SCIPchgVarLb(scip, var, 1.0) );
20715  }
20716  else
20717  {
20718  SCIP_CALL( SCIPchgVarUb(scip, var, 0.0) );
20719  }
20720  break;
20721 
20722  case SCIP_STAGE_PRESOLVING:
20723  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
20724  {
20725  SCIP_Bool fixed;
20726 
20727  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
20728  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
20729  (SCIP_Real)fixedval, infeasible, &fixed) );
20730  break;
20731  }
20732  /*lint -fallthrough*/
20733  case SCIP_STAGE_SOLVING:
20734  if( fixedval == TRUE )
20735  {
20737  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
20738  scip->cliquetable, var, 1.0, SCIP_BOUNDTYPE_LOWER, infercons, NULL, inferinfo, FALSE) );
20739  }
20740  else
20741  {
20743  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
20744  scip->cliquetable, var, 0.0, SCIP_BOUNDTYPE_UPPER, infercons, NULL, inferinfo, FALSE) );
20745  }
20746  break;
20747 
20748  default:
20749  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
20750  return SCIP_INVALIDCALL;
20751  } /*lint !e788*/
20752 
20753  if( tightened != NULL )
20754  *tightened = TRUE;
20755 
20756  return SCIP_OKAY;
20757 }
20758 
20759 /** fixes variable in preprocessing or in the current node, if the new bound is tighter (w.r.t. bound strengthening
20760  * epsilon) than the current bound; if possible, adjusts bound to integral value; the given inference constraint is
20761  * stored, such that the conflict analysis is able to find out the reason for the deduction of the bound change
20762  *
20763  * @note In presolving stage when not in probing mode the variable will be fixed directly, otherwise this method
20764  * changes first the lowerbound by calling SCIPinferVarLbProp and second the upperbound by calling
20765  * SCIPinferVarUbProp
20766  *
20767  * @note If SCIP is in presolving stage, it can happen that the internal variable array (which get be accessed via
20768  * SCIPgetVars()) gets resorted.
20769  *
20770  * @note During presolving, an integer variable which bound changes to {0,1} is upgraded to a binary variable.
20771  */
20773  SCIP* scip, /**< SCIP data structure */
20774  SCIP_VAR* var, /**< variable to change the bound for */
20775  SCIP_Real fixedval, /**< new value for fixation */
20776  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
20777  int inferinfo, /**< user information for inference to help resolving the conflict */
20778  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
20779  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
20780  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
20781  )
20782 {
20783  assert(scip != NULL);
20784  assert(var != NULL);
20785  assert(infeasible != NULL);
20786 
20787  SCIP_CALL( checkStage(scip, "SCIPinferVarFixProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20788 
20789  if( tightened != NULL )
20790  *tightened = FALSE;
20791 
20792  /* in presolving case we take the shortcut to directly fix the variables */
20793  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVING && SCIPtreeGetCurrentDepth(scip->tree) == 0 )
20794  {
20795  SCIP_Bool fixed;
20796 
20797  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
20798  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
20799  fixedval, infeasible, &fixed) );
20800 
20801  if( tightened != NULL )
20802  *tightened = fixed;
20803  }
20804  /* otherwise we use the lb and ub methods */
20805  else
20806  {
20807  SCIP_Bool lbtightened;
20808 
20809  SCIP_CALL( SCIPinferVarLbProp(scip, var, fixedval, inferprop, inferinfo, force, infeasible, &lbtightened) );
20810 
20811  if( ! (*infeasible) )
20812  {
20813  SCIP_CALL( SCIPinferVarUbProp(scip, var, fixedval, inferprop, inferinfo, force, infeasible, tightened) );
20814 
20815  if( tightened != NULL )
20816  *tightened |= lbtightened;
20817  }
20818  }
20819 
20820  return SCIP_OKAY;
20821 }
20822 
20823 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
20824  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
20825  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason
20826  * for the deduction of the bound change
20827  *
20828  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
20829  * SCIPgetVars()) gets resorted.
20830  *
20831  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20832  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20833  *
20834  * @pre This method can be called if @p scip is in one of the following stages:
20835  * - \ref SCIP_STAGE_PROBLEM
20836  * - \ref SCIP_STAGE_PRESOLVING
20837  * - \ref SCIP_STAGE_SOLVING
20838  *
20839  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
20840  */
20842  SCIP* scip, /**< SCIP data structure */
20843  SCIP_VAR* var, /**< variable to change the bound for */
20844  SCIP_Real newbound, /**< new value for bound */
20845  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
20846  int inferinfo, /**< user information for inference to help resolving the conflict */
20847  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
20848  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
20849  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
20850  )
20851 {
20852  SCIP_Real lb;
20853  SCIP_Real ub;
20854 
20855  assert(infeasible != NULL);
20856 
20857  SCIP_CALL( checkStage(scip, "SCIPinferVarLbProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20858 
20859  *infeasible = FALSE;
20860  if( tightened != NULL )
20861  *tightened = FALSE;
20862 
20863  SCIPvarAdjustLb(var, scip->set, &newbound);
20864 
20865  /* get current bounds */
20866  lb = SCIPvarGetLbLocal(var);
20867  ub = SCIPvarGetUbLocal(var);
20868  assert(SCIPsetIsLE(scip->set, lb, ub));
20869 
20870  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
20871  {
20872  *infeasible = TRUE;
20873  return SCIP_OKAY;
20874  }
20875  newbound = MIN(newbound, ub);
20876 
20877  if( !force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub) )
20878  return SCIP_OKAY;
20879 
20880  switch( scip->set->stage )
20881  {
20882  case SCIP_STAGE_PROBLEM:
20883  assert(!SCIPvarIsTransformed(var));
20884  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20885  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
20886  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20887  scip->branchcand, scip->eventqueue, newbound) );
20888  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
20889  break;
20890 
20891  case SCIP_STAGE_PRESOLVING:
20892  if( !SCIPinProbing(scip) )
20893  {
20894  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
20895  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
20896 
20897  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
20898  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
20900 
20902  {
20903  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
20904  assert(!(*infeasible));
20905  }
20906  break;
20907  }
20908  /*lint -fallthrough*/
20909  case SCIP_STAGE_SOLVING:
20911  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
20912  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_LOWER, NULL, inferprop, inferinfo, FALSE) );
20913  break;
20914 
20915  default:
20916  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
20917  return SCIP_INVALIDCALL;
20918  } /*lint !e788*/
20919 
20920  if( tightened != NULL )
20921  *tightened = TRUE;
20922 
20923  return SCIP_OKAY;
20924 }
20925 
20926 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
20927  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
20928  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason
20929  * for the deduction of the bound change
20930  *
20931  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
20932  * SCIPgetVars()) gets resorted.
20933  *
20934  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20935  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20936  *
20937  * @pre This method can be called if @p scip is in one of the following stages:
20938  * - \ref SCIP_STAGE_PROBLEM
20939  * - \ref SCIP_STAGE_PRESOLVING
20940  * - \ref SCIP_STAGE_SOLVING
20941  *
20942  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
20943  */
20945  SCIP* scip, /**< SCIP data structure */
20946  SCIP_VAR* var, /**< variable to change the bound for */
20947  SCIP_Real newbound, /**< new value for bound */
20948  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
20949  int inferinfo, /**< user information for inference to help resolving the conflict */
20950  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
20951  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
20952  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
20953  )
20954 {
20955  SCIP_Real lb;
20956  SCIP_Real ub;
20957 
20958  assert(infeasible != NULL);
20959 
20960  SCIP_CALL( checkStage(scip, "SCIPinferVarUbProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20961 
20962  *infeasible = FALSE;
20963  if( tightened != NULL )
20964  *tightened = FALSE;
20965 
20966  SCIPvarAdjustUb(var, scip->set, &newbound);
20967 
20968  /* get current bounds */
20969  lb = SCIPvarGetLbLocal(var);
20970  ub = SCIPvarGetUbLocal(var);
20971  assert(SCIPsetIsLE(scip->set, lb, ub));
20972 
20973  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
20974  {
20975  *infeasible = TRUE;
20976  return SCIP_OKAY;
20977  }
20978  newbound = MAX(newbound, lb);
20979 
20980  if( !force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub) )
20981  return SCIP_OKAY;
20982 
20983  switch( scip->set->stage )
20984  {
20985  case SCIP_STAGE_PROBLEM:
20986  assert(!SCIPvarIsTransformed(var));
20987  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20988  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
20989  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
20990  scip->branchcand, scip->eventqueue, newbound) );
20991  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
20992  break;
20993 
20994  case SCIP_STAGE_PRESOLVING:
20995  if( !SCIPinProbing(scip) )
20996  {
20997  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
20998  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
20999 
21000  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
21001  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
21003 
21005  {
21006  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
21007  assert(!(*infeasible));
21008  }
21009  break;
21010  }
21011  /*lint -fallthrough*/
21012  case SCIP_STAGE_SOLVING:
21014  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
21015  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, NULL, inferprop, inferinfo, FALSE) );
21016  break;
21017 
21018  default:
21019  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21020  return SCIP_INVALIDCALL;
21021  } /*lint !e788*/
21022 
21023  if( tightened != NULL )
21024  *tightened = TRUE;
21025 
21026  return SCIP_OKAY;
21027 }
21028 
21029 /** depending on SCIP's stage, fixes binary variable in the problem, in preprocessing, or in current node;
21030  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason for the
21031  * deduction of the fixing
21032  *
21033  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21034  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21035  *
21036  * @pre This method can be called if @p scip is in one of the following stages:
21037  * - \ref SCIP_STAGE_PROBLEM
21038  * - \ref SCIP_STAGE_PRESOLVING
21039  * - \ref SCIP_STAGE_PRESOLVED
21040  * - \ref SCIP_STAGE_SOLVING
21041  */
21043  SCIP* scip, /**< SCIP data structure */
21044  SCIP_VAR* var, /**< binary variable to fix */
21045  SCIP_Bool fixedval, /**< value to fix binary variable to */
21046  SCIP_PROP* inferprop, /**< propagator that deduced the fixing */
21047  int inferinfo, /**< user information for inference to help resolving the conflict */
21048  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
21049  SCIP_Bool* tightened /**< pointer to store whether the fixing tightened the local bounds, or NULL */
21050  )
21051 {
21052  SCIP_Real lb;
21053  SCIP_Real ub;
21054 
21055  assert(SCIPvarIsBinary(var));
21056  assert(fixedval == TRUE || fixedval == FALSE);
21057  assert(infeasible != NULL);
21058 
21059  SCIP_CALL( checkStage(scip, "SCIPinferBinvarProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21060 
21061  *infeasible = FALSE;
21062  if( tightened != NULL )
21063  *tightened = FALSE;
21064 
21065  /* get current bounds */
21066  lb = SCIPvarGetLbLocal(var);
21067  ub = SCIPvarGetUbLocal(var);
21068  assert(SCIPsetIsEQ(scip->set, lb, 0.0) || SCIPsetIsEQ(scip->set, lb, 1.0));
21069  assert(SCIPsetIsEQ(scip->set, ub, 0.0) || SCIPsetIsEQ(scip->set, ub, 1.0));
21070  assert(SCIPsetIsLE(scip->set, lb, ub));
21071 
21072  /* check, if variable is already fixed */
21073  if( (lb > 0.5) || (ub < 0.5) )
21074  {
21075  *infeasible = (fixedval == (lb < 0.5));
21076 
21077  return SCIP_OKAY;
21078  }
21079 
21080  /* apply the fixing */
21081  switch( scip->set->stage )
21082  {
21083  case SCIP_STAGE_PROBLEM:
21084  assert(!SCIPvarIsTransformed(var));
21085  if( fixedval == TRUE )
21086  {
21087  SCIP_CALL( SCIPchgVarLb(scip, var, 1.0) );
21088  }
21089  else
21090  {
21091  SCIP_CALL( SCIPchgVarUb(scip, var, 0.0) );
21092  }
21093  break;
21094 
21095  case SCIP_STAGE_PRESOLVING:
21096  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
21097  {
21098  SCIP_Bool fixed;
21099 
21100  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21101  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
21102  (SCIP_Real)fixedval, infeasible, &fixed) );
21103  break;
21104  }
21105  /*lint -fallthrough*/
21106  case SCIP_STAGE_SOLVING:
21107  if( fixedval == TRUE )
21108  {
21110  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, 1.0,
21111  SCIP_BOUNDTYPE_LOWER, NULL, inferprop, inferinfo, FALSE) );
21112  }
21113  else
21114  {
21116  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, 0.0,
21117  SCIP_BOUNDTYPE_UPPER, NULL, inferprop, inferinfo, FALSE) );
21118  }
21119  break;
21120 
21121  default:
21122  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21123  return SCIP_INVALIDCALL;
21124  } /*lint !e788*/
21125 
21126  if( tightened != NULL )
21127  *tightened = TRUE;
21128 
21129  return SCIP_OKAY;
21130 }
21131 
21132 /** changes global lower bound of variable in preprocessing or in the current node, if the new bound is tighter
21133  * (w.r.t. bound strengthening epsilon) than the current global bound; if possible, adjusts bound to integral value;
21134  * also tightens the local bound, if the global bound is better than the local bound
21135  *
21136  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
21137  * SCIPgetVars()) gets resorted.
21138  *
21139  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21140  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21141  *
21142  * @pre This method can be called if @p scip is in one of the following stages:
21143  * - \ref SCIP_STAGE_PROBLEM
21144  * - \ref SCIP_STAGE_TRANSFORMING
21145  * - \ref SCIP_STAGE_PRESOLVING
21146  * - \ref SCIP_STAGE_SOLVING
21147  *
21148  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
21149  */
21151  SCIP* scip, /**< SCIP data structure */
21152  SCIP_VAR* var, /**< variable to change the bound for */
21153  SCIP_Real newbound, /**< new value for bound */
21154  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
21155  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
21156  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
21157  )
21158 {
21159  SCIP_Real lb;
21160  SCIP_Real ub;
21161 
21162  assert(infeasible != NULL);
21163 
21164  SCIP_CALL( checkStage(scip, "SCIPtightenVarLbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21165 
21166  *infeasible = FALSE;
21167  if( tightened != NULL )
21168  *tightened = FALSE;
21169 
21170  SCIPvarAdjustLb(var, scip->set, &newbound);
21171 
21172  /* get current bounds */
21173  lb = SCIPvarGetLbGlobal(var);
21174  ub = SCIPvarGetUbGlobal(var);
21175  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPsetIsLE(scip->set, lb, ub));
21176 
21177  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
21178  {
21179  *infeasible = TRUE;
21180  return SCIP_OKAY;
21181  }
21182  newbound = MIN(newbound, ub);
21183 
21184  /* bound changes of less than epsilon are ignored by SCIPvarChgLb or raise an assert in SCIPnodeAddBoundinfer,
21185  * so don't apply them even if force is set
21186  */
21187  if( SCIPsetIsEQ(scip->set, lb, newbound) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
21188  return SCIP_OKAY;
21189 
21190  switch( scip->set->stage )
21191  {
21192  case SCIP_STAGE_PROBLEM:
21193  assert(!SCIPvarIsTransformed(var));
21194  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21195  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21196  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21197  scip->branchcand, scip->eventqueue, newbound) );
21198  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
21199  break;
21200 
21202  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21203  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21204  break;
21205 
21206  case SCIP_STAGE_PRESOLVING:
21207  if( !SCIPinProbing(scip) )
21208  {
21209  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
21210  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
21211 
21212  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
21213  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
21215 
21217  {
21218  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
21219  assert(!(*infeasible));
21220  }
21221  break;
21222  }
21223  /*lint -fallthrough*/
21224  case SCIP_STAGE_SOLVING:
21225  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
21226  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
21228  break;
21229 
21230  default:
21231  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21232  return SCIP_INVALIDCALL;
21233  } /*lint !e788*/
21234 
21235  /* coverity: unreachable code */
21236  if( tightened != NULL )
21237  *tightened = TRUE;
21238 
21239  return SCIP_OKAY;
21240 }
21241 
21242 /** changes global upper bound of variable in preprocessing or in the current node, if the new bound is tighter
21243  * (w.r.t. bound strengthening epsilon) than the current global bound; if possible, adjusts bound to integral value;
21244  * also tightens the local bound, if the global bound is better than the local bound
21245  *
21246  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
21247  * SCIPgetVars()) gets resorted.
21248  *
21249  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21250  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21251  *
21252  * @pre This method can be called if @p scip is in one of the following stages:
21253  * - \ref SCIP_STAGE_PROBLEM
21254  * - \ref SCIP_STAGE_TRANSFORMING
21255  * - \ref SCIP_STAGE_PRESOLVING
21256  * - \ref SCIP_STAGE_SOLVING
21257  *
21258  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
21259  */
21261  SCIP* scip, /**< SCIP data structure */
21262  SCIP_VAR* var, /**< variable to change the bound for */
21263  SCIP_Real newbound, /**< new value for bound */
21264  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
21265  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
21266  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
21267  )
21268 {
21269  SCIP_Real lb;
21270  SCIP_Real ub;
21271 
21272  assert(infeasible != NULL);
21273 
21274  SCIP_CALL( checkStage(scip, "SCIPtightenVarUbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21275 
21276  *infeasible = FALSE;
21277  if( tightened != NULL )
21278  *tightened = FALSE;
21279 
21280  SCIPvarAdjustUb(var, scip->set, &newbound);
21281 
21282  /* get current bounds */
21283  lb = SCIPvarGetLbGlobal(var);
21284  ub = SCIPvarGetUbGlobal(var);
21285  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPsetIsLE(scip->set, lb, ub));
21286 
21287  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
21288  {
21289  *infeasible = TRUE;
21290  return SCIP_OKAY;
21291  }
21292  newbound = MAX(newbound, lb);
21293 
21294  /* bound changes of less than epsilon are ignored by SCIPvarChgUb or raise an assert in SCIPnodeAddBoundinfer,
21295  * so don't apply them even if force is set
21296  */
21297  if( SCIPsetIsEQ(scip->set, ub, newbound) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
21298  return SCIP_OKAY;
21299 
21300  switch( scip->set->stage )
21301  {
21302  case SCIP_STAGE_PROBLEM:
21303  assert(!SCIPvarIsTransformed(var));
21304  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21305  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21306  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21307  scip->branchcand, scip->eventqueue, newbound) );
21308  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
21309  break;
21310 
21312  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21313  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21314  break;
21315 
21316  case SCIP_STAGE_PRESOLVING:
21317  if( !SCIPinProbing(scip) )
21318  {
21319  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
21320  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
21321 
21322  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
21323  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
21325 
21327  {
21328  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
21329  assert(!(*infeasible));
21330  }
21331  break;
21332  }
21333  /*lint -fallthrough*/
21334  case SCIP_STAGE_SOLVING:
21335  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
21336  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
21338  break;
21339 
21340  default:
21341  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21342  return SCIP_INVALIDCALL;
21343  } /*lint !e788*/
21344 
21345  /* coverity: unreachable code */
21346  if( tightened != NULL )
21347  *tightened = TRUE;
21348 
21349  return SCIP_OKAY;
21350 }
21351 
21352 /* some simple variable functions implemented as defines */
21353 #undef SCIPcomputeVarLbGlobal
21354 #undef SCIPcomputeVarUbGlobal
21355 #undef SCIPcomputeVarLbLocal
21356 #undef SCIPcomputeVarUbLocal
21357 
21358 /** for a multi-aggregated variable, returns the global lower bound computed by adding the global bounds from all aggregation variables
21359  *
21360  * This global bound may be tighter than the one given by SCIPvarGetLbGlobal, since the latter is not updated if bounds of aggregation variables are changing
21361  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetLbGlobal.
21362  *
21363  * @return the global lower bound computed by adding the global bounds from all aggregation variables
21364  */
21366  SCIP* scip, /**< SCIP data structure */
21367  SCIP_VAR* var /**< variable to compute the bound for */
21368  )
21369 {
21370  assert(scip != NULL);
21371  assert(var != NULL);
21372 
21374  return SCIPvarGetMultaggrLbGlobal(var, scip->set);
21375  else
21376  return SCIPvarGetLbGlobal(var);
21377 }
21378 
21379 /** for a multi-aggregated variable, returns the global upper bound computed by adding the global bounds from all aggregation variables
21380  *
21381  * This global bound may be tighter than the one given by SCIPvarGetUbGlobal, since the latter is not updated if bounds of aggregation variables are changing
21382  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetUbGlobal
21383  *
21384  * @return the global upper bound computed by adding the global bounds from all aggregation variables
21385  */
21387  SCIP* scip, /**< SCIP data structure */
21388  SCIP_VAR* var /**< variable to compute the bound for */
21389  )
21390 {
21391  assert(scip != NULL);
21392  assert(var != NULL);
21393 
21395  return SCIPvarGetMultaggrUbGlobal(var, scip->set);
21396  else
21397  return SCIPvarGetUbGlobal(var);
21398 }
21399 
21400 /** for a multi-aggregated variable, returns the local lower bound computed by adding the local bounds from all aggregation variables
21401  *
21402  * This local bound may be tighter than the one given by SCIPvarGetLbLocal, since the latter is not updated if bounds of aggregation variables are changing
21403  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetLbLocal.
21404  *
21405  * @return the local lower bound computed by adding the global bounds from all aggregation variables
21406  */
21408  SCIP* scip, /**< SCIP data structure */
21409  SCIP_VAR* var /**< variable to compute the bound for */
21410  )
21411 {
21412  assert(scip != NULL);
21413  assert(var != NULL);
21414 
21416  return SCIPvarGetMultaggrLbLocal(var, scip->set);
21417  else
21418  return SCIPvarGetLbLocal(var);
21419 }
21420 
21421 /** for a multi-aggregated variable, returns the local upper bound computed by adding the local bounds from all aggregation variables
21422  *
21423  * This local bound may be tighter than the one given by SCIPvarGetUbLocal, since the latter is not updated if bounds of aggregation variables are changing
21424  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetUbLocal.
21425  *
21426  * @return the local upper bound computed by adding the global bounds from all aggregation variables
21427  */
21429  SCIP* scip, /**< SCIP data structure */
21430  SCIP_VAR* var /**< variable to compute the bound for */
21431  )
21432 {
21433  assert(scip != NULL);
21434  assert(var != NULL);
21435 
21437  return SCIPvarGetMultaggrUbLocal(var, scip->set);
21438  else
21439  return SCIPvarGetUbLocal(var);
21440 }
21441 
21442 /** for a multi-aggregated variable, gives the global lower bound computed by adding the global bounds from all
21443  * aggregation variables, this global bound may be tighter than the one given by SCIPvarGetLbGlobal, since the latter is
21444  * not updated if bounds of aggregation variables are changing
21445  *
21446  * calling this function for a non-multi-aggregated variable is not allowed
21447  */
21449  SCIP* scip, /**< SCIP data structure */
21450  SCIP_VAR* var /**< variable to compute the bound for */
21451  )
21452 {
21453  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
21454  return SCIPvarGetMultaggrLbGlobal(var, scip->set);
21455 }
21456 
21457 /** for a multi-aggregated variable, gives the global upper bound computed by adding the global bounds from all
21458  * aggregation variables, this upper bound may be tighter than the one given by SCIPvarGetUbGlobal, since the latter is
21459  * not updated if bounds of aggregation variables are changing
21460  *
21461  * calling this function for a non-multi-aggregated variable is not allowed
21462  */
21464  SCIP* scip, /**< SCIP data structure */
21465  SCIP_VAR* var /**< variable to compute the bound for */
21466  )
21467 {
21468  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
21469  return SCIPvarGetMultaggrUbGlobal(var, scip->set);
21470 }
21471 
21472 /** for a multi-aggregated variable, gives the local lower bound computed by adding the local bounds from all
21473  * aggregation variables, this lower bound may be tighter than the one given by SCIPvarGetLbLocal, since the latter is
21474  * not updated if bounds of aggregation variables are changing
21475  *
21476  * calling this function for a non-multi-aggregated variable is not allowed
21477  */
21479  SCIP* scip, /**< SCIP data structure */
21480  SCIP_VAR* var /**< variable to compute the bound for */
21481  )
21482 {
21483  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
21484  return SCIPvarGetMultaggrLbLocal(var, scip->set);
21485 }
21486 
21487 /** for a multi-aggregated variable, gives the local upper bound computed by adding the local bounds from all
21488  * aggregation variables, this upper bound may be tighter than the one given by SCIPvarGetUbLocal, since the latter is
21489  * not updated if bounds of aggregation variables are changing
21490  *
21491  * calling this function for a non-multi-aggregated variable is not allowed
21492  */
21494  SCIP* scip, /**< SCIP data structure */
21495  SCIP_VAR* var /**< variable to compute the bound for */
21496  )
21497 {
21498  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
21499  return SCIPvarGetMultaggrUbLocal(var, scip->set);
21500 }
21501 
21502 /** returns solution value and index of variable lower bound that is closest to the variable's value in the given primal
21503  * solution or current LP solution if no primal solution is given; returns an index of -1 if no variable lower bound is
21504  * available
21505  *
21506  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21507  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21508  *
21509  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
21510  */
21512  SCIP* scip, /**< SCIP data structure */
21513  SCIP_VAR* var, /**< active problem variable */
21514  SCIP_SOL* sol, /**< primal solution, or NULL for LP solution */
21515  SCIP_Real* closestvlb, /**< pointer to store the value of the closest variable lower bound */
21516  int* closestvlbidx /**< pointer to store the index of the closest variable lower bound */
21517  )
21518 {
21519  SCIP_CALL( checkStage(scip, "SCIPgetVarClosestVlb", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21520 
21521  SCIPvarGetClosestVlb(var, sol, scip->set, scip->stat, closestvlb, closestvlbidx);
21522 
21523  return SCIP_OKAY;
21524 }
21525 
21526 /** returns solution value and index of variable upper bound that is closest to the variable's value in the given primal solution;
21527  * or current LP solution if no primal solution is given; returns an index of -1 if no variable upper bound is available
21528  *
21529  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21530  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21531  *
21532  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
21533  */
21535  SCIP* scip, /**< SCIP data structure */
21536  SCIP_VAR* var, /**< active problem variable */
21537  SCIP_SOL* sol, /**< primal solution, or NULL for LP solution */
21538  SCIP_Real* closestvub, /**< pointer to store the value of the closest variable lower bound */
21539  int* closestvubidx /**< pointer to store the index of the closest variable lower bound */
21540  )
21541 {
21542  SCIP_CALL( checkStage(scip, "SCIPgetVarClosestVub", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21543 
21544  SCIPvarGetClosestVub(var, sol, scip->set, scip->stat, closestvub, closestvubidx);
21545 
21546  return SCIP_OKAY;
21547 }
21548 
21549 /** informs variable x about a globally valid variable lower bound x >= b*z + d with integer variable z;
21550  * if z is binary, the corresponding valid implication for z is also added;
21551  * if z is non-continuous and 1/b not too small, the corresponding valid upper/lower bound
21552  * z <= (x-d)/b or z >= (x-d)/b (depending on the sign of of b) is added, too;
21553  * improves the global bounds of the variable and the vlb variable if possible
21554  *
21555  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21556  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21557  *
21558  * @pre This method can be called if @p scip is in one of the following stages:
21559  * - \ref SCIP_STAGE_PRESOLVING
21560  * - \ref SCIP_STAGE_PRESOLVED
21561  * - \ref SCIP_STAGE_SOLVING
21562  */
21564  SCIP* scip, /**< SCIP data structure */
21565  SCIP_VAR* var, /**< problem variable */
21566  SCIP_VAR* vlbvar, /**< variable z in x >= b*z + d */
21567  SCIP_Real vlbcoef, /**< coefficient b in x >= b*z + d */
21568  SCIP_Real vlbconstant, /**< constant d in x >= b*z + d */
21569  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
21570  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
21571  )
21572 {
21573  int nlocalbdchgs;
21574 
21575  SCIP_CALL( checkStage(scip, "SCIPaddVarVlb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21576 
21577  SCIP_CALL( SCIPvarAddVlb(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
21578  scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, vlbvar, vlbcoef, vlbconstant,
21579  TRUE, infeasible, &nlocalbdchgs) );
21580 
21581  *nbdchgs = nlocalbdchgs;
21582 
21583  /* if x is not continuous we add a variable bound for z; do not add it if cofficient would be too small or we already
21584  * detected infeasibility
21585  */
21586  if( !(*infeasible) && SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPisZero(scip, 1.0/vlbcoef) )
21587  {
21588  if( vlbcoef > 0.0 )
21589  {
21590  /* if b > 0, we have a variable upper bound: x >= b*z + d => z <= (x-d)/b */
21591  SCIP_CALL( SCIPvarAddVub(vlbvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21592  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vlbcoef,
21593  -vlbconstant/vlbcoef, TRUE, infeasible, &nlocalbdchgs) );
21594  }
21595  else
21596  {
21597  /* if b < 0, we have a variable lower bound: x >= b*z + d => z >= (x-d)/b */
21598  SCIP_CALL( SCIPvarAddVlb(vlbvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21599  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vlbcoef,
21600  -vlbconstant/vlbcoef, TRUE, infeasible, &nlocalbdchgs) );
21601  }
21602  *nbdchgs += nlocalbdchgs;
21603  }
21604 
21605  return SCIP_OKAY;
21606 }
21607 
21608 /** informs variable x about a globally valid variable upper bound x <= b*z + d with integer variable z;
21609  * if z is binary, the corresponding valid implication for z is also added;
21610  * if z is non-continuous and 1/b not too small, the corresponding valid lower/upper bound
21611  * z >= (x-d)/b or z <= (x-d)/b (depending on the sign of of b) is added, too;
21612  * improves the global bounds of the variable and the vlb variable if possible
21613  *
21614  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21615  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21616  *
21617  * @pre This method can be called if @p scip is in one of the following stages:
21618  * - \ref SCIP_STAGE_PRESOLVING
21619  * - \ref SCIP_STAGE_PRESOLVED
21620  * - \ref SCIP_STAGE_SOLVING
21621  */
21623  SCIP* scip, /**< SCIP data structure */
21624  SCIP_VAR* var, /**< problem variable */
21625  SCIP_VAR* vubvar, /**< variable z in x <= b*z + d */
21626  SCIP_Real vubcoef, /**< coefficient b in x <= b*z + d */
21627  SCIP_Real vubconstant, /**< constant d in x <= b*z + d */
21628  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
21629  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
21630  )
21631 {
21632  int nlocalbdchgs;
21633 
21634  SCIP_CALL( checkStage(scip, "SCIPaddVarVub", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21635 
21636  SCIP_CALL( SCIPvarAddVub(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
21637  scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, vubvar, vubcoef, vubconstant, TRUE,
21638  infeasible, &nlocalbdchgs) );
21639 
21640  *nbdchgs = nlocalbdchgs;
21641 
21642  /* if x is not continuous we add a variable bound for z; do not add it if cofficient would be too small or we already
21643  * detected infeasibility
21644  */
21645  if( !(*infeasible) && SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPisZero(scip, 1.0/vubcoef) )
21646  {
21647  if( vubcoef > 0.0 )
21648  {
21649  /* if b < 0, we have a variable lower bound: x >= b*z + d => z >= (x-d)/b */
21650  SCIP_CALL( SCIPvarAddVlb(vubvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21651  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vubcoef,
21652  -vubconstant/vubcoef, TRUE, infeasible, &nlocalbdchgs) );
21653  }
21654  else
21655  {
21656  /* if b > 0, we have a variable upper bound: x >= b*z + d => z <= (x-d)/b */
21657  SCIP_CALL( SCIPvarAddVub(vubvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21658  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vubcoef,
21659  -vubconstant/vubcoef, TRUE, infeasible, &nlocalbdchgs) );
21660  }
21661  *nbdchgs += nlocalbdchgs;
21662  }
21663 
21664  return SCIP_OKAY;
21665 }
21666 
21667 /** informs binary variable x about a globally valid implication: x == 0 or x == 1 ==> y <= b or y >= b;
21668  * also adds the corresponding implication or variable bound to the implied variable;
21669  * if the implication is conflicting, the variable is fixed to the opposite value;
21670  * if the variable is already fixed to the given value, the implication is performed immediately;
21671  * if the implication is redundant with respect to the variables' global bounds, it is ignored
21672  *
21673  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21674  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21675  *
21676  * @pre This method can be called if @p scip is in one of the following stages:
21677  * - \ref SCIP_STAGE_TRANSFORMED
21678  * - \ref SCIP_STAGE_PRESOLVING
21679  * - \ref SCIP_STAGE_PRESOLVED
21680  * - \ref SCIP_STAGE_SOLVING
21681  */
21683  SCIP* scip, /**< SCIP data structure */
21684  SCIP_VAR* var, /**< problem variable */
21685  SCIP_Bool varfixing, /**< FALSE if y should be added in implications for x == 0, TRUE for x == 1 */
21686  SCIP_VAR* implvar, /**< variable y in implication y <= b or y >= b */
21687  SCIP_BOUNDTYPE impltype, /**< type of implication y <= b (SCIP_BOUNDTYPE_UPPER)
21688  * or y >= b (SCIP_BOUNDTYPE_LOWER) */
21689  SCIP_Real implbound, /**< bound b in implication y <= b or y >= b */
21690  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
21691  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
21692  )
21693 {
21694  SCIP_CALL( checkStage(scip, "SCIPaddVarImplication", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21695 
21696  if ( nbdchgs != NULL )
21697  *nbdchgs = 0;
21698 
21699  if( !SCIPvarIsBinary(var) )
21700  {
21701  SCIPerrorMessage("can't add implication for nonbinary variable\n");
21702  return SCIP_INVALIDDATA;
21703  }
21704 
21705  /* transform implication containing two binary variables to clique */
21706  if( SCIPvarIsBinary(implvar) )
21707  {
21708  SCIP_VAR* vars[2];
21709  SCIP_Bool vals[2];
21710 
21711  assert(SCIPisFeasEQ(scip, implbound, 1.0) || SCIPisFeasZero(scip, implbound));
21712  assert((impltype == SCIP_BOUNDTYPE_UPPER) == SCIPisFeasZero(scip, implbound));
21713 
21714  vars[0] = var;
21715  vars[1] = implvar;
21716  vals[0] = varfixing;
21717  vals[1] = (impltype == SCIP_BOUNDTYPE_UPPER);
21718 
21719  SCIP_CALL( SCIPaddClique(scip, vars, vals, 2, FALSE, infeasible, nbdchgs) );
21720 
21721  return SCIP_OKAY;
21722  }
21723 
21724  /* the implication graph can only handle 'real' binary (SCIP_VARTYPE_BINARY) variables, therefore we transform the
21725  * implication in variable bounds, (lowerbound of y will be abbreviated by lby, upperbound equivlaent) the follwing
21726  * four cases are:
21727  *
21728  * 1. (x >= 1 => y >= b) => y >= (b - lby) * x + lby
21729  * 2. (x >= 1 => y <= b) => y <= (b - uby) * x + uby
21730  * 3. (x <= 0 => y >= b) => y >= (lby - b) * x + b
21731  * 4. (x <= 0 => y <= b) => y <= (uby - b) * x + b
21732  */
21733  if( SCIPvarGetType(var) != SCIP_VARTYPE_BINARY )
21734  {
21735  SCIP_Real lby;
21736  SCIP_Real uby;
21737 
21738  lby = SCIPvarGetLbGlobal(implvar);
21739  uby = SCIPvarGetUbGlobal(implvar);
21740 
21741  if( varfixing == TRUE )
21742  {
21743  if( impltype == SCIP_BOUNDTYPE_LOWER )
21744  {
21745  /* we return if the lower bound is infinity */
21746  if( SCIPisInfinity(scip, -lby) )
21747  return SCIP_OKAY;
21748 
21749  SCIP_CALL( SCIPvarAddVlb(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21750  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
21751  implbound - lby, lby, TRUE, infeasible, nbdchgs) );
21752  }
21753  else
21754  {
21755  /* we return if the upper bound is infinity */
21756  if( SCIPisInfinity(scip, uby) )
21757  return SCIP_OKAY;
21758 
21759  SCIP_CALL( SCIPvarAddVub(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21760  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
21761  implbound - uby, uby, TRUE, infeasible, nbdchgs) );
21762  }
21763  }
21764  else
21765  {
21766  if( impltype == SCIP_BOUNDTYPE_LOWER )
21767  {
21768  /* we return if the lower bound is infinity */
21769  if( SCIPisInfinity(scip, -lby) )
21770  return SCIP_OKAY;
21771 
21772  SCIP_CALL( SCIPvarAddVlb(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21773  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
21774  lby - implbound, implbound, TRUE, infeasible, nbdchgs) );
21775  }
21776  else
21777  {
21778  /* we return if the upper bound is infinity */
21779  if( SCIPisInfinity(scip, uby) )
21780  return SCIP_OKAY;
21781 
21782  SCIP_CALL( SCIPvarAddVub(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21783  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
21784  uby - implbound, implbound, TRUE, infeasible, nbdchgs) );
21785  }
21786  }
21787  }
21788  else
21789  {
21790  SCIP_CALL( SCIPvarAddImplic(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21791  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, varfixing, implvar, impltype,
21792  implbound, TRUE, infeasible, nbdchgs) );
21793  }
21794 
21795  return SCIP_OKAY;
21796 }
21797 
21798 /** adds a clique information to SCIP, stating that at most one of the given binary variables can be set to 1;
21799  * if a variable appears twice in the same clique, the corresponding implications are performed
21800  *
21801  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21802  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21803  *
21804  * @pre This method can be called if @p scip is in one of the following stages:
21805  * - \ref SCIP_STAGE_TRANSFORMED
21806  * - \ref SCIP_STAGE_PRESOLVING
21807  * - \ref SCIP_STAGE_PRESOLVED
21808  * - \ref SCIP_STAGE_SOLVING
21809  */
21811  SCIP* scip, /**< SCIP data structure */
21812  SCIP_VAR** vars, /**< binary variables in the clique from which at most one can be set to 1 */
21813  SCIP_Bool* values, /**< values of the variables in the clique; NULL to use TRUE for all vars */
21814  int nvars, /**< number of variables in the clique */
21815  SCIP_Bool isequation, /**< is the clique an equation or an inequality? */
21816  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
21817  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
21818  )
21819 {
21820  SCIP_CALL( checkStage(scip, "SCIPaddClique", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21821 
21822  *infeasible = FALSE;
21823  if( nbdchgs != NULL )
21824  *nbdchgs = 0;
21825 
21826  if( nvars > 1 )
21827  {
21828  /* add the clique to the clique table */
21829  SCIP_CALL( SCIPcliquetableAdd(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
21830  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, vars, values, nvars, isequation,
21831  infeasible, nbdchgs) );
21832  }
21833 
21834  return SCIP_OKAY;
21835 }
21836 
21837 /* calculate clique partition for a maximal amount of comparisons on variables due to expensive algorithm
21838  * @todo: check for a good value, maybe it's better to check parts of variables
21839  */
21840 #define MAXNCLIQUEVARSCOMP 1000000
21841 
21842 /** calculates a partition of the given set of binary variables into cliques;
21843  * afterwards the output array contains one value for each variable, such that two variables got the same value iff they
21844  * were assigned to the same clique;
21845  * the first variable is always assigned to clique 0, and a variable can only be assigned to clique i if at least one of
21846  * the preceding variables was assigned to clique i-1;
21847  * for each clique at most 1 variables can be set to TRUE in a feasible solution;
21848  *
21849  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21850  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21851  *
21852  * @pre This method can be called if @p scip is in one of the following stages:
21853  * - \ref SCIP_STAGE_INITPRESOLVE
21854  * - \ref SCIP_STAGE_PRESOLVING
21855  * - \ref SCIP_STAGE_EXITPRESOLVE
21856  * - \ref SCIP_STAGE_PRESOLVED
21857  * - \ref SCIP_STAGE_SOLVING
21858  */
21860  SCIP*const scip, /**< SCIP data structure */
21861  SCIP_VAR**const vars, /**< binary variables in the clique from which at most one can be set to 1 */
21862  int const nvars, /**< number of variables in the clique */
21863  int*const cliquepartition, /**< array of length nvars to store the clique partition */
21864  int*const ncliques /**< pointer to store the number of cliques actually contained in the partition */
21865  )
21866 {
21867  SCIP_VAR** tmpvars;
21868  SCIP_VAR** cliquevars;
21869  SCIP_Bool* cliquevalues;
21870  SCIP_Bool* tmpvalues;
21871  int ncliquevars;
21872  int i;
21873  int maxncliquevarscomp;
21874 
21875  assert(scip != NULL);
21876  assert(nvars == 0 || vars != NULL);
21877  assert(nvars == 0 || cliquepartition != NULL);
21878  assert(ncliques != NULL);
21879 
21880  SCIP_CALL( checkStage(scip, "SCIPcalcCliquePartition", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21881 
21882  if( nvars == 0 )
21883  {
21884  *ncliques = 0;
21885  return SCIP_OKAY;
21886  }
21887 
21888  /* early abort when no clique and implications are existing */
21889  if( SCIPgetNCliques(scip) == 0 && SCIPgetNImplications(scip) == 0 )
21890  {
21891  for( i = nvars - 1; i >= 0; --i )
21892  cliquepartition[i] = i;
21893 
21894  *ncliques = nvars;
21895 
21896  return SCIP_OKAY;
21897  }
21898 
21899  /* allocate temporary memory for storing the variables of the current clique */
21900  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &cliquevars, nvars) );
21901  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &cliquevalues, nvars) );
21902  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &tmpvalues, nvars) );
21903  SCIP_CALL( SCIPsetDuplicateBufferArray(scip->set, &tmpvars, vars, nvars) );
21904  ncliquevars = 0;
21905 
21906  /* initialize the cliquepartition array with -1 */
21907  /* initialize the tmpvalues array */
21908  for( i = nvars - 1; i >= 0; --i )
21909  {
21910  tmpvalues[i] = TRUE;
21911  cliquepartition[i] = -1;
21912  }
21913 
21914  /* get corresponding active problem variables */
21915  SCIP_CALL( SCIPvarsGetProbvarBinary(&tmpvars, &tmpvalues, nvars) );
21916 
21917  maxncliquevarscomp = MIN(nvars*nvars, MAXNCLIQUEVARSCOMP);
21918 
21919  /* calculate the clique partition */
21920  *ncliques = 0;
21921  for( i = 0; i < nvars; ++i )
21922  {
21923  if( cliquepartition[i] == -1 )
21924  {
21925  int j;
21926 
21927  /* variable starts a new clique */
21928  cliquepartition[i] = *ncliques;
21929  cliquevars[0] = tmpvars[i];
21930  cliquevalues[0] = tmpvalues[i];
21931  ncliquevars = 1;
21932 
21933  /* if variable is not active (multi-aggregated or fixed), it cannot be in any clique */
21934  if( SCIPvarIsActive(tmpvars[i]) && SCIPvarGetNCliques(tmpvars[i], tmpvalues[i]) > 0 )
21935  {
21936  /* greedily fill up the clique */
21937  for( j = i+1; j < nvars; ++j )
21938  {
21939  /* if variable is not active (multi-aggregated or fixed), it cannot be in any clique */
21940  if( cliquepartition[j] == -1 && SCIPvarIsActive(tmpvars[j]) )
21941  {
21942  int k;
21943 
21944  /* check if every variable in the current clique can be extended by tmpvars[j] */
21945  for( k = ncliquevars - 1; k >= 0; --k )
21946  {
21947  if( !SCIPvarsHaveCommonClique(tmpvars[j], tmpvalues[j], cliquevars[k], cliquevalues[k], TRUE) )
21948  break;
21949  }
21950 
21951  if( k == -1 )
21952  {
21953  /* put the variable into the same clique */
21954  cliquepartition[j] = cliquepartition[i];
21955  cliquevars[ncliquevars] = tmpvars[j];
21956  cliquevalues[ncliquevars] = tmpvalues[j];
21957  ++ncliquevars;
21958  }
21959  }
21960  }
21961  }
21962 
21963  /* this clique is finished */
21964  ++(*ncliques);
21965  }
21966  assert(cliquepartition[i] >= 0 && cliquepartition[i] < i+1);
21967 
21968  /* break if we reached the maximal number of comparisons */
21969  if( i * nvars > maxncliquevarscomp )
21970  break;
21971  }
21972  /* if we had to much variables fill up the cliquepartition and put each variable in a separate clique */
21973  for( ; i < nvars; ++i )
21974  {
21975  if( cliquepartition[i] == -1 )
21976  {
21977  cliquepartition[i] = *ncliques;
21978  ++(*ncliques);
21979  }
21980  }
21981 
21982  /* free temporary memory */
21983  SCIPsetFreeBufferArray(scip->set, &tmpvars);
21984  SCIPsetFreeBufferArray(scip->set, &tmpvalues);
21985  SCIPsetFreeBufferArray(scip->set, &cliquevalues);
21986  SCIPsetFreeBufferArray(scip->set, &cliquevars);
21987 
21988  return SCIP_OKAY;
21989 }
21990 
21991 /** calculates a partition of the given set of binary variables into negated cliques;
21992  * afterwards the output array contains one value for each variable, such that two variables got the same value iff they
21993  * were assigned to the same negated clique;
21994  * the first variable is always assigned to clique 0 and a variable can only be assigned to clique i if at least one of
21995  * the preceding variables was assigned to clique i-1;
21996  * for each clique with n_c variables at least n_c-1 variables can be set to TRUE in a feasible solution;
21997  *
21998  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21999  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22000  *
22001  * @pre This method can be called if @p scip is in one of the following stages:
22002  * - \ref SCIP_STAGE_INITPRESOLVE
22003  * - \ref SCIP_STAGE_PRESOLVING
22004  * - \ref SCIP_STAGE_EXITPRESOLVE
22005  * - \ref SCIP_STAGE_PRESOLVED
22006  * - \ref SCIP_STAGE_SOLVING
22007  */
22009  SCIP*const scip, /**< SCIP data structure */
22010  SCIP_VAR**const vars, /**< binary variables in the clique from which at most one can be set to 1 */
22011  int const nvars, /**< number of variables in the clique */
22012  int*const cliquepartition, /**< array of length nvars to store the clique partition */
22013  int*const ncliques /**< pointer to store the number of cliques actually contained in the partition */
22014  )
22015 {
22016  SCIP_VAR** negvars;
22017  int v;
22018 
22019  assert(scip != NULL);
22020  assert(cliquepartition != NULL || nvars == 0);
22021  assert(ncliques != NULL);
22022 
22023  if( nvars == 0 )
22024  {
22025  *ncliques = 0;
22026  return SCIP_OKAY;
22027  }
22028  assert(vars != NULL);
22029 
22030  /* allocate temporary memory */
22031  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &negvars, nvars) );
22032 
22033  /* get all negated variables */
22034  for( v = nvars - 1; v >= 0; --v )
22035  {
22036  SCIP_CALL( SCIPgetNegatedVar(scip, vars[v], &(negvars[v])) );
22037  }
22038 
22039  /* calculate cliques on negated variables, which are "negated" cliques on normal variables array */
22040  SCIP_CALL( SCIPcalcCliquePartition( scip, negvars, nvars, cliquepartition, ncliques) );
22041 
22042  /* free temporary memory */
22043  SCIPsetFreeBufferArray(scip->set, &negvars);
22044 
22045  return SCIP_OKAY;
22046 }
22047 
22048 
22049 /** force SCIP to clean up all cliques; cliques do not get automatically cleaned up after presolving. Use
22050  * this method to prevent inactive variables in cliques when retrieved via SCIPgetCliques()
22051  *
22052  * @return SCIP_OKAY if everything worked, otherwise a suitable error code is passed
22053  *
22054  * @pre This method can be called if @p scip is in one of the following stages:
22055  * - \ref SCIP_STAGE_TRANSFORMED
22056  * - \ref SCIP_STAGE_INITPRESOLVE
22057  * - \ref SCIP_STAGE_PRESOLVING
22058  * - \ref SCIP_STAGE_EXITPRESOLVE
22059  * - \ref SCIP_STAGE_PRESOLVED
22060  * - \ref SCIP_STAGE_INITSOLVE
22061  * - \ref SCIP_STAGE_SOLVING
22062  * - \ref SCIP_STAGE_SOLVED
22063  * - \ref SCIP_STAGE_EXITSOLVE
22064  */
22066  SCIP* scip, /**< SCIP data structure */
22067  SCIP_Bool* infeasible /**< pointer to store if cleanup detected infeasibility */
22068  )
22069 {
22070  int nlocalbdchgs;
22071  SCIP_Bool globalinfeasibility;
22072 
22073  SCIP_CALL_ABORT( checkStage(scip, "SCIPcleanupCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
22074 
22075  globalinfeasibility = FALSE;
22076  nlocalbdchgs = 0;
22077  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22078  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
22079  &globalinfeasibility) );
22080 
22081  if( infeasible != NULL )
22082  *infeasible = globalinfeasibility;
22083 
22084  if( globalinfeasibility )
22086 
22087  return SCIP_OKAY;
22088 }
22089 
22090 /** gets the number of cliques in the clique table
22091  *
22092  * @return number of cliques in the clique table
22093  *
22094  * @note cliques do not get automatically cleaned up after presolving. Use SCIPcleanupCliques()
22095  * to prevent inactive variables in cliques when retrieved via SCIPgetCliques(). This might reduce the number of cliques
22096  *
22097  * @pre This method can be called if @p scip is in one of the following stages:
22098  * - \ref SCIP_STAGE_TRANSFORMED
22099  * - \ref SCIP_STAGE_INITPRESOLVE
22100  * - \ref SCIP_STAGE_PRESOLVING
22101  * - \ref SCIP_STAGE_EXITPRESOLVE
22102  * - \ref SCIP_STAGE_PRESOLVED
22103  * - \ref SCIP_STAGE_INITSOLVE
22104  * - \ref SCIP_STAGE_SOLVING
22105  * - \ref SCIP_STAGE_SOLVED
22106  * - \ref SCIP_STAGE_EXITSOLVE
22107  */
22109  SCIP* scip /**< SCIP data structure */
22110  )
22111 {
22112  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
22113 
22115 }
22116 
22117 /** gets the array of cliques in the clique table
22118  *
22119  * @return array of cliques in the clique table
22120  *
22121  * @note cliques do not get automatically cleaned up after presolving. Use SCIPcleanupCliques()
22122  * to prevent inactive variables in cliques when retrieved via SCIPgetCliques(). This might reduce the number of cliques
22123  *
22124  * @pre This method can be called if @p scip is in one of the following stages:
22125  * - \ref SCIP_STAGE_TRANSFORMED
22126  * - \ref SCIP_STAGE_INITPRESOLVE
22127  * - \ref SCIP_STAGE_PRESOLVING
22128  * - \ref SCIP_STAGE_EXITPRESOLVE
22129  * - \ref SCIP_STAGE_PRESOLVED
22130  * - \ref SCIP_STAGE_INITSOLVE
22131  * - \ref SCIP_STAGE_SOLVING
22132  * - \ref SCIP_STAGE_SOLVED
22133  * - \ref SCIP_STAGE_EXITSOLVE
22134  */
22136  SCIP* scip /**< SCIP data structure */
22137  )
22138 {
22139  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
22140 
22141  return SCIPcliquetableGetCliques(scip->cliquetable);
22142 }
22143 
22144 /** returns whether there is a clique that contains both given variable/value pairs;
22145  * the variables must be active binary variables;
22146  * if regardimplics is FALSE, only the cliques in the clique table are looked at;
22147  * if regardimplics is TRUE, both the cliques and the implications of the implication graph are regarded
22148  *
22149  * @return TRUE, if there is a clique that contains both variable/clique pairs; FALSE, otherwise
22150  *
22151  * @pre This method can be called if @p scip is in one of the following stages:
22152  * - \ref SCIP_STAGE_TRANSFORMED
22153  * - \ref SCIP_STAGE_INITPRESOLVE
22154  * - \ref SCIP_STAGE_PRESOLVING
22155  * - \ref SCIP_STAGE_EXITPRESOLVE
22156  * - \ref SCIP_STAGE_PRESOLVED
22157  * - \ref SCIP_STAGE_INITSOLVE
22158  * - \ref SCIP_STAGE_SOLVING
22159  * - \ref SCIP_STAGE_SOLVED
22160  * - \ref SCIP_STAGE_EXITSOLVE
22161  *
22162  * @note a variable with it's negated variable are NOT! in a clique
22163  * @note a variable with itself are in a clique
22164  */
22166  SCIP* scip, /**< SCIP data structure */
22167  SCIP_VAR* var1, /**< first variable */
22168  SCIP_Bool value1, /**< value of first variable */
22169  SCIP_VAR* var2, /**< second variable */
22170  SCIP_Bool value2, /**< value of second variable */
22171  SCIP_Bool regardimplics /**< should the implication graph also be searched for a clique? */
22172  )
22173 {
22174  assert(scip != NULL);
22175  assert(var1 != NULL);
22176  assert(var2 != NULL);
22177  assert(SCIPvarIsActive(var1));
22178  assert(SCIPvarIsActive(var2));
22179  assert(SCIPvarIsBinary(var1));
22180  assert(SCIPvarIsBinary(var2));
22181 
22182  SCIP_CALL_ABORT( checkStage(scip, "SCIPhaveVarsCommonClique", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
22183 
22184  /* if both variables together have more cliques then actual cliques exist, then they have a common clique (in debug
22185  * mode we check this for correctness), otherwise we need to call the pairwise comparison method for these variables
22186  */
22187 #ifndef NDEBUG
22188  assert((SCIPvarGetNCliques(var1, value1) + SCIPvarGetNCliques(var2, value2) > SCIPcliquetableGetNCliques(scip->cliquetable)) ? SCIPvarsHaveCommonClique(var1, value1, var2, value2, FALSE) : TRUE);
22189 #endif
22190 
22191  return (SCIPvarGetNCliques(var1, value1) + SCIPvarGetNCliques(var2, value2) > SCIPcliquetableGetNCliques(scip->cliquetable)
22192  || SCIPvarsHaveCommonClique(var1, value1, var2, value2, regardimplics));
22193 }
22194 
22195 
22196 /** writes the clique graph to a gml file
22197  *
22198  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22199  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22200  *
22201  * @pre This method can be called if @p scip is in one of the following stages:
22202  * - \ref SCIP_STAGE_TRANSFORMED
22203  * - \ref SCIP_STAGE_INITPRESOLVE
22204  * - \ref SCIP_STAGE_PRESOLVING
22205  * - \ref SCIP_STAGE_EXITPRESOLVE
22206  * - \ref SCIP_STAGE_PRESOLVED
22207  * - \ref SCIP_STAGE_INITSOLVE
22208  * - \ref SCIP_STAGE_SOLVING
22209  * - \ref SCIP_STAGE_SOLVED
22210  * - \ref SCIP_STAGE_EXITSOLVE
22211  *
22212  * @note there can be duplicated arcs in the output file
22213  *
22214  * If @p writenodeweights is true, only nodes corresponding to variables that have a fractional value and only edges
22215  * between such nodes are written.
22216  */
22218  SCIP* scip, /**< SCIP data structure */
22219  const char* fname, /**< name of file */
22220  SCIP_Bool writenodeweights /**< should we write weights of nodes? */
22221  )
22222 {
22223  FILE* gmlfile;
22224  SCIP_HASHMAP* nodehashmap;
22225  SCIP_CLIQUE** cliques;
22226  SCIP_VAR** clqvars;
22227  SCIP_VAR** allvars;
22228  SCIP_Bool* clqvalues;
22229  char nodename[SCIP_MAXSTRLEN];
22230  int nallvars;
22231  int nbinvars;
22232  int nintvars;
22233  int nimplvars;
22234  int ncliques;
22235  int c;
22236  int v1;
22237  int v2;
22238  int id1;
22239  int id2;
22240 
22241  assert(scip != NULL);
22242  assert(fname != NULL);
22243 
22244  SCIP_CALL_ABORT( checkStage(scip, "SCIPwriteCliqueGraph", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
22245 
22246  /* get all active variables */
22247  SCIP_CALL( SCIPgetVarsData(scip, &allvars, &nallvars, &nbinvars, &nintvars, &nimplvars, NULL) );
22248 
22249  /* no possible variables for cliques exist */
22250  if( nbinvars + nimplvars == 0 )
22251  return SCIP_OKAY;
22252 
22253  ncliques = SCIPgetNCliques(scip);
22254 
22255  /* no cliques and do not wont to check for binary implications */
22256  if( ncliques == 0 )
22257  return SCIP_OKAY;
22258 
22259  /* open gml file */
22260  gmlfile = fopen(fname, "w");
22261 
22262  if( gmlfile == NULL )
22263  {
22264  SCIPerrorMessage("cannot open graph file <%s>\n", fname);
22265  SCIPABORT();
22266  return SCIP_INVALIDDATA; /*lint !e527*/
22267  }
22268 
22269  /* create the hash map */
22270  SCIP_CALL( SCIPhashmapCreate(&nodehashmap, SCIPblkmem(scip), SCIPcalcHashtableSize(HASHTABLESIZE_FACTOR * 2 * (nbinvars+nimplvars))) );
22271 
22272  /* write starting of gml file */
22273  SCIPgmlWriteOpening(gmlfile, TRUE);
22274 
22275  cliques = SCIPgetCliques(scip);
22276 
22277  /* write nodes and arcs for all cliques */
22278  for( c = ncliques - 1; c >= 0; --c )
22279  {
22280  clqvalues = SCIPcliqueGetValues(cliques[c]);
22281  clqvars = SCIPcliqueGetVars(cliques[c]);
22282 
22283  for( v1 = SCIPcliqueGetNVars(cliques[c]) - 1; v1 >= 0; --v1 )
22284  {
22285  id1 = clqvalues[v1] ? SCIPvarGetProbindex(clqvars[v1]) : (nallvars + SCIPvarGetProbindex(clqvars[v1]));
22286 
22287  /* if corresponding node was not added yet, add it */
22288  if( !SCIPhashmapExists(nodehashmap, (void*)(size_t)id1) )
22289  {
22290  assert(id1 >= 0);
22291  SCIP_CALL( SCIPhashmapInsert(nodehashmap, (void*)(size_t)id1, (void*)(size_t) 1) );
22292 
22293  (void) SCIPsnprintf(nodename, SCIP_MAXSTRLEN, "%s%s", (id1 >= nallvars ? "~" : ""), SCIPvarGetName(clqvars[v1]));
22294 
22295  /* write new gml node for new variable */
22296  if ( writenodeweights )
22297  {
22298  if ( ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v1])) )
22299  SCIPgmlWriteNodeWeight(gmlfile, (unsigned int)id1, nodename, NULL, NULL, NULL, SCIPgetSolVal(scip, NULL, clqvars[v1]));
22300  }
22301  else
22302  {
22303  SCIPgmlWriteNode(gmlfile, (unsigned int)id1, nodename, NULL, NULL, NULL);
22304  }
22305  }
22306 
22307  for( v2 = SCIPcliqueGetNVars(cliques[c]) - 1; v2 >= 0; --v2 )
22308  {
22309  if( v1 == v2 )
22310  continue;
22311 
22312  id2 = clqvalues[v2] ? SCIPvarGetProbindex(clqvars[v2]) : (nallvars + SCIPvarGetProbindex(clqvars[v2]));
22313 
22314  /* if corresponding node was not added yet, add it */
22315  if( !SCIPhashmapExists(nodehashmap, (void*)(size_t)id2) )
22316  {
22317  assert(id2 >= 0);
22318  SCIP_CALL( SCIPhashmapInsert(nodehashmap, (void*)(size_t)id2, (void*)(size_t) 1) );
22319 
22320  (void) SCIPsnprintf(nodename, SCIP_MAXSTRLEN, "%s%s", (id2 >= nallvars ? "~" : ""), SCIPvarGetName(clqvars[v2]));
22321 
22322  /* write new gml node for new variable */
22323  if ( writenodeweights )
22324  {
22325  if ( ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v2])) )
22326  SCIPgmlWriteNodeWeight(gmlfile, (unsigned int)id2, nodename, NULL, NULL, NULL, SCIPgetSolVal(scip, NULL, clqvars[v2]));
22327  }
22328  else
22329  {
22330  SCIPgmlWriteNode(gmlfile, (unsigned int)id2, nodename, NULL, NULL, NULL);
22331  }
22332  }
22333 
22334  /* write gml arc between resultant and operand */
22335  if ( ! writenodeweights || ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v2])) )
22336  SCIPgmlWriteArc(gmlfile, (unsigned int)id1, (unsigned int)id2, NULL, NULL);
22337  }
22338  }
22339  }
22340 
22341  /* free the hash map */
22342  SCIPhashmapFree(&nodehashmap);
22343 
22344  SCIPgmlWriteClosing(gmlfile);
22345  fclose(gmlfile);
22346 
22347  return SCIP_OKAY;
22348 }
22349 
22350 /** Removes (irrelevant) variable from all its global structures, i.e. cliques, implications and variable bounds.
22351  * This is an advanced method which should be used with care.
22352  *
22353  * @return SCIP_OKAY if everything worked, otherwise a suitable error code is passed
22354  *
22355  * @pre This method can be called if @p scip is in one of the following stages:
22356  * - \ref SCIP_STAGE_TRANSFORMED
22357  * - \ref SCIP_STAGE_INITPRESOLVE
22358  * - \ref SCIP_STAGE_PRESOLVING
22359  * - \ref SCIP_STAGE_EXITPRESOLVE
22360  * - \ref SCIP_STAGE_PRESOLVED
22361  * - \ref SCIP_STAGE_INITSOLVE
22362  * - \ref SCIP_STAGE_SOLVING
22363  * - \ref SCIP_STAGE_SOLVED
22364  * - \ref SCIP_STAGE_EXITSOLVE
22365  */
22367  SCIP* scip, /**< SCIP data structure */
22368  SCIP_VAR* var /**< variable to remove from global structures */
22369  )
22370 {
22371  assert(scip != NULL);
22372 
22373  SCIP_CALL_ABORT( checkStage(scip, "SCIPremoveVarFromGlobalStructures", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
22374 
22375  /* mark the variable as deletable from global structures - This is necessary for the delayed clean up of cliques */
22377 
22378  /* remove variable from all its cliques, implications, and variable bounds */
22380 
22381  return SCIP_OKAY;
22382 }
22383 
22384 /** sets the branch factor of the variable; this value can be used in the branching methods to scale the score
22385  * values of the variables; higher factor leads to a higher probability that this variable is chosen for branching
22386  *
22387  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22388  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22389  *
22390  * @pre This method can be called if @p scip is in one of the following stages:
22391  * - \ref SCIP_STAGE_PROBLEM
22392  * - \ref SCIP_STAGE_TRANSFORMING
22393  * - \ref SCIP_STAGE_TRANSFORMED
22394  * - \ref SCIP_STAGE_INITPRESOLVE
22395  * - \ref SCIP_STAGE_PRESOLVING
22396  * - \ref SCIP_STAGE_EXITPRESOLVE
22397  * - \ref SCIP_STAGE_PRESOLVED
22398  * - \ref SCIP_STAGE_SOLVING
22399  */
22401  SCIP* scip, /**< SCIP data structure */
22402  SCIP_VAR* var, /**< problem variable */
22403  SCIP_Real branchfactor /**< factor to weigh variable's branching score with */
22404  )
22405 {
22406  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22407 
22408  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, branchfactor) );
22409 
22410  return SCIP_OKAY;
22411 }
22412 
22413 /** scales the branch factor of the variable with the given value
22414  *
22415  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22416  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22417  *
22418  * @pre This method can be called if @p scip is in one of the following stages:
22419  * - \ref SCIP_STAGE_PROBLEM
22420  * - \ref SCIP_STAGE_TRANSFORMING
22421  * - \ref SCIP_STAGE_TRANSFORMED
22422  * - \ref SCIP_STAGE_INITPRESOLVE
22423  * - \ref SCIP_STAGE_PRESOLVING
22424  * - \ref SCIP_STAGE_EXITPRESOLVE
22425  * - \ref SCIP_STAGE_PRESOLVED
22426  * - \ref SCIP_STAGE_SOLVING
22427  */
22429  SCIP* scip, /**< SCIP data structure */
22430  SCIP_VAR* var, /**< problem variable */
22431  SCIP_Real scale /**< factor to scale variable's branching factor with */
22432  )
22433 {
22434  SCIP_CALL( checkStage(scip, "SCIPscaleVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22435 
22436  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, scale * SCIPvarGetBranchFactor(var)) );
22437 
22438  return SCIP_OKAY;
22439 }
22440 
22441 /** adds the given value to the branch factor of the variable
22442  *
22443  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22444  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22445  *
22446  * @pre This method can be called if @p scip is in one of the following stages:
22447  * - \ref SCIP_STAGE_PROBLEM
22448  * - \ref SCIP_STAGE_TRANSFORMING
22449  * - \ref SCIP_STAGE_TRANSFORMED
22450  * - \ref SCIP_STAGE_INITPRESOLVE
22451  * - \ref SCIP_STAGE_PRESOLVING
22452  * - \ref SCIP_STAGE_EXITPRESOLVE
22453  * - \ref SCIP_STAGE_PRESOLVED
22454  * - \ref SCIP_STAGE_SOLVING
22455  */
22457  SCIP* scip, /**< SCIP data structure */
22458  SCIP_VAR* var, /**< problem variable */
22459  SCIP_Real addfactor /**< value to add to the branch factor of the variable */
22460  )
22461 {
22462  SCIP_CALL( checkStage(scip, "SCIPaddVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22463 
22464  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, addfactor + SCIPvarGetBranchFactor(var)) );
22465 
22466  return SCIP_OKAY;
22467 }
22468 
22469 /** sets the branch priority of the variable; variables with higher branch priority are always preferred to variables
22470  * with lower priority in selection of branching variable
22471  *
22472  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22473  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22474  *
22475  * @pre This method can be called if @p scip is in one of the following stages:
22476  * - \ref SCIP_STAGE_PROBLEM
22477  * - \ref SCIP_STAGE_TRANSFORMING
22478  * - \ref SCIP_STAGE_TRANSFORMED
22479  * - \ref SCIP_STAGE_INITPRESOLVE
22480  * - \ref SCIP_STAGE_PRESOLVING
22481  * - \ref SCIP_STAGE_EXITPRESOLVE
22482  * - \ref SCIP_STAGE_PRESOLVED
22483  * - \ref SCIP_STAGE_SOLVING
22484  *
22485  * @note the default branching priority is 0
22486  */
22488  SCIP* scip, /**< SCIP data structure */
22489  SCIP_VAR* var, /**< problem variable */
22490  int branchpriority /**< branch priority of the variable */
22491  )
22492 {
22493  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22494 
22495  assert( var->scip == scip );
22496 
22497  if( SCIPisTransformed(scip) )
22498  {
22499  assert(scip->branchcand != NULL);
22500 
22501  /* inform the pseudo branch candidates that the branch priority changes and change the branch priority */
22502  SCIP_CALL( SCIPbranchcandUpdateVarBranchPriority(scip->branchcand, scip->set, var, branchpriority) );
22503  }
22504  else
22505  {
22506  /* change the branching priority of the variable */
22507  SCIP_CALL( SCIPvarChgBranchPriority(var, branchpriority) );
22508  }
22509 
22510  return SCIP_OKAY;
22511 }
22512 
22513 /** changes the branch priority of the variable to the given value, if it is larger than the current priority
22514  *
22515  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22516  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22517  *
22518  * @pre This method can be called if @p scip is in one of the following stages:
22519  * - \ref SCIP_STAGE_PROBLEM
22520  * - \ref SCIP_STAGE_TRANSFORMING
22521  * - \ref SCIP_STAGE_TRANSFORMED
22522  * - \ref SCIP_STAGE_INITPRESOLVE
22523  * - \ref SCIP_STAGE_PRESOLVING
22524  * - \ref SCIP_STAGE_EXITPRESOLVE
22525  * - \ref SCIP_STAGE_PRESOLVED
22526  * - \ref SCIP_STAGE_SOLVING
22527  */
22529  SCIP* scip, /**< SCIP data structure */
22530  SCIP_VAR* var, /**< problem variable */
22531  int branchpriority /**< new branch priority of the variable, if it is larger than current priority */
22532  )
22533 {
22534  SCIP_CALL( checkStage(scip, "SCIPupdateVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22535 
22536  assert( var->scip == scip );
22537 
22538  if( branchpriority > SCIPvarGetBranchPriority(var) )
22539  {
22540  SCIP_CALL( SCIPvarChgBranchPriority(var, branchpriority) );
22541  }
22542 
22543  return SCIP_OKAY;
22544 }
22545 
22546 /** adds the given value to the branch priority of the variable
22547  *
22548  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22549  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22550  *
22551  * @pre This method can be called if @p scip is in one of the following stages:
22552  * - \ref SCIP_STAGE_PROBLEM
22553  * - \ref SCIP_STAGE_TRANSFORMING
22554  * - \ref SCIP_STAGE_TRANSFORMED
22555  * - \ref SCIP_STAGE_INITPRESOLVE
22556  * - \ref SCIP_STAGE_PRESOLVING
22557  * - \ref SCIP_STAGE_EXITPRESOLVE
22558  * - \ref SCIP_STAGE_PRESOLVED
22559  * - \ref SCIP_STAGE_SOLVING
22560  */
22562  SCIP* scip, /**< SCIP data structure */
22563  SCIP_VAR* var, /**< problem variable */
22564  int addpriority /**< value to add to the branch priority of the variable */
22565  )
22566 {
22567  SCIP_CALL( checkStage(scip, "SCIPaddVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22568 
22569  assert( var->scip == scip );
22570 
22571  SCIP_CALL( SCIPvarChgBranchPriority(var, addpriority + SCIPvarGetBranchPriority(var)) );
22572 
22573  return SCIP_OKAY;
22574 }
22575 
22576 /** sets the branch direction of the variable (-1: prefer downwards branch, 0: automatic selection, +1: prefer upwards
22577  * branch)
22578  *
22579  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22580  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22581  *
22582  * @pre This method can be called if @p scip is in one of the following stages:
22583  * - \ref SCIP_STAGE_PROBLEM
22584  * - \ref SCIP_STAGE_TRANSFORMING
22585  * - \ref SCIP_STAGE_TRANSFORMED
22586  * - \ref SCIP_STAGE_INITPRESOLVE
22587  * - \ref SCIP_STAGE_PRESOLVING
22588  * - \ref SCIP_STAGE_EXITPRESOLVE
22589  * - \ref SCIP_STAGE_PRESOLVED
22590  * - \ref SCIP_STAGE_SOLVING
22591  */
22593  SCIP* scip, /**< SCIP data structure */
22594  SCIP_VAR* var, /**< problem variable */
22595  SCIP_BRANCHDIR branchdirection /**< preferred branch direction of the variable (downwards, upwards, auto) */
22596  )
22597 {
22598  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchDirection", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22599 
22600  assert( var->scip == scip );
22601 
22602  SCIP_CALL( SCIPvarChgBranchDirection(var, branchdirection) );
22603 
22604  return SCIP_OKAY;
22605 }
22606 
22607 /** tightens the variable bounds due a new variable type */
22608 static
22610  SCIP* scip, /**< SCIP data structure */
22611  SCIP_VAR* var, /**< variable to change the bound for */
22612  SCIP_VARTYPE vartype, /**< new type of variable */
22613  SCIP_Bool* infeasible /**< pointer to store whether an infeasibility was detected (, due to
22614  * integrality condition of the new variable type) */
22615  )
22616 {
22617  assert(scip != NULL);
22619  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPvarIsTransformed(var));
22620  assert(var->scip == scip);
22621 
22622  *infeasible = FALSE;
22623 
22624  /* adjusts bounds if the variable type changed form continuous to non-continuous (integral) */
22626  {
22627  SCIP_Bool tightened;
22628 
22629  /* we adjust variable bounds to integers first, since otherwise a later bound tightening with a fractional old
22630  * bound may give an assert because SCIP expects non-continuous variables to have non-fractional bounds
22631  *
22632  * we adjust bounds with a fractionality within [eps,feastol] only if the resulting bound change is a bound
22633  * tightening, because relaxing bounds may not be allowed
22634  */
22635  if( !SCIPisFeasIntegral(scip, SCIPvarGetLbGlobal(var)) ||
22637  )
22638  {
22639  SCIP_CALL( SCIPtightenVarLbGlobal(scip, var, SCIPfeasCeil(scip, SCIPvarGetLbGlobal(var)), TRUE, infeasible, &tightened) );
22640  if( *infeasible )
22641  return SCIP_OKAY;
22642 
22643  /* the only reason for not applying a forced boundchange is when the new bound is reduced because the variables upper bound is below the new bound
22644  * in a concrete case, lb == ub == 100.99999001; even though within feastol of 101, the lower bound cannot be tighented to 101 due to the upper bound
22645  */
22646  assert(tightened || SCIPisFeasLE(scip, SCIPvarGetUbGlobal(var), SCIPfeasCeil(scip, SCIPvarGetLbGlobal(var))));
22647  }
22648  if( !SCIPisFeasIntegral(scip, SCIPvarGetUbGlobal(var)) ||
22650  )
22651  {
22652  SCIP_CALL( SCIPtightenVarUbGlobal(scip, var, SCIPfeasFloor(scip, SCIPvarGetUbGlobal(var)), TRUE, infeasible, &tightened) );
22653  if( *infeasible )
22654  return SCIP_OKAY;
22655 
22656  assert(tightened || SCIPisFeasGE(scip, SCIPvarGetLbGlobal(var), SCIPfeasFloor(scip, SCIPvarGetUbGlobal(var))));
22657  }
22658  }
22659 
22660  return SCIP_OKAY;
22661 }
22662 
22663 /** changes type of variable in the problem;
22664  *
22665  * @warning This type change might change the variable array returned from SCIPgetVars() and SCIPgetVarsData();
22666  *
22667  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22668  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22669  *
22670  * @pre This method can be called if @p scip is in one of the following stages:
22671  * - \ref SCIP_STAGE_PROBLEM
22672  * - \ref SCIP_STAGE_TRANSFORMING
22673  * - \ref SCIP_STAGE_PRESOLVING
22674  *
22675  * @note If SCIP is already beyond the SCIP_STAGE_PROBLEM and a original variable is passed, the variable type of the
22676  * corresponding transformed variable is changed; the type of the original variable does not change
22677  *
22678  * @note If the type changes from a continuous variable to a non-continuous variable the bounds of the variable get
22679  * adjusted w.r.t. to integrality information
22680  */
22682  SCIP* scip, /**< SCIP data structure */
22683  SCIP_VAR* var, /**< variable to change the bound for */
22684  SCIP_VARTYPE vartype, /**< new type of variable */
22685  SCIP_Bool* infeasible /**< pointer to store whether an infeasibility was detected (, due to
22686  * integrality condition of the new variable type) */
22687  )
22688 {
22689  SCIP_CALL( checkStage(scip, "SCIPchgVarType", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
22690 
22691  assert(var != NULL);
22692  assert(var->scip == scip);
22693 
22694  if( SCIPvarIsNegated(var) )
22695  {
22696  SCIPdebugMessage("upgrading type of negated variable <%s> from %d to %d\n", SCIPvarGetName(var), SCIPvarGetType(var), vartype);
22697  var = SCIPvarGetNegationVar(var);
22698  }
22699 #ifndef NDEBUG
22700  else
22701  {
22702  if( SCIPgetStage(scip) > SCIP_STAGE_PROBLEM )
22703  {
22704  SCIPdebugMessage("upgrading type of variable <%s> from %d to %d\n", SCIPvarGetName(var), SCIPvarGetType(var), vartype);
22705  }
22706  }
22707 #endif
22708 
22709  /* change variable type */
22710  switch( scip->set->stage )
22711  {
22712  case SCIP_STAGE_PROBLEM:
22713  assert(!SCIPvarIsTransformed(var));
22714 
22715  /* first adjust the variable due to new integrality information */
22716  SCIP_CALL( tightenBounds(scip, var, vartype, infeasible) );
22717 
22718  /* second change variable type */
22719  if( SCIPvarGetProbindex(var) >= 0 )
22720  {
22721  SCIP_CALL( SCIPprobChgVarType(scip->origprob, scip->mem->probmem, scip->set, scip->branchcand, scip->cliquetable, var, vartype) );
22722  }
22723  else
22724  {
22725  SCIP_CALL( SCIPvarChgType(var, vartype) );
22726  }
22727  break;
22728 
22729  case SCIP_STAGE_PRESOLVING:
22730  if( !SCIPvarIsTransformed(var) )
22731  {
22732  SCIP_VAR* transvar;
22733 
22734  SCIP_CALL( SCIPgetTransformedVar(scip, var, &transvar) );
22735  assert(transvar != NULL);
22736 
22737  /* recall method with transformed variable */
22738  SCIP_CALL( SCIPchgVarType(scip, transvar, vartype, infeasible) );
22739  return SCIP_OKAY;
22740  }
22741 
22742  /* first adjust the variable due to new integrality information */
22743  SCIP_CALL( tightenBounds(scip, var, vartype, infeasible) );
22744 
22745  /* second change variable type */
22746  if( SCIPvarGetProbindex(var) >= 0 )
22747  {
22748  SCIP_CALL( SCIPprobChgVarType(scip->transprob, scip->mem->probmem, scip->set, scip->branchcand, scip->cliquetable, var, vartype) );
22749  }
22750  else
22751  {
22752  SCIP_CALL( SCIPvarChgType(var, vartype) );
22753  }
22754  break;
22755 
22756  default:
22757  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22758  return SCIP_INVALIDCALL;
22759  } /*lint !e788*/
22760 
22761  return SCIP_OKAY;
22762 }
22763 
22764 /** in problem creation and solving stage, both bounds of the variable are set to the given value;
22765  * in presolving stage, the variable is converted into a fixed variable, and bounds are changed respectively;
22766  * conversion into a fixed variable changes the vars array returned from SCIPgetVars() and SCIPgetVarsData(),
22767  * and also renders arrays returned from the SCIPvarGetImpl...() methods invalid
22768  *
22769  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22770  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22771  *
22772  * @pre This method can be called if @p scip is in one of the following stages:
22773  * - \ref SCIP_STAGE_PROBLEM
22774  * - \ref SCIP_STAGE_PRESOLVING
22775  * - \ref SCIP_STAGE_SOLVING
22776  */
22778  SCIP* scip, /**< SCIP data structure */
22779  SCIP_VAR* var, /**< variable to fix */
22780  SCIP_Real fixedval, /**< value to fix variable to */
22781  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
22782  SCIP_Bool* fixed /**< pointer to store whether the fixing was performed (variable was unfixed) */
22783  )
22784 {
22785  assert(var != NULL);
22786  assert(infeasible != NULL);
22787  assert(fixed != NULL);
22788 
22789  SCIP_CALL( checkStage(scip, "SCIPfixVar", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22790 
22791  *infeasible = FALSE;
22792  *fixed = FALSE;
22793 
22794  /* in the problem creation stage, modify the bounds as requested, independently from the current bounds */
22795  if( scip->set->stage != SCIP_STAGE_PROBLEM )
22796  {
22797  if( (SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPsetIsFeasIntegral(scip->set, fixedval))
22798  || SCIPsetIsFeasLT(scip->set, fixedval, SCIPvarGetLbLocal(var))
22799  || SCIPsetIsFeasGT(scip->set, fixedval, SCIPvarGetUbLocal(var)) )
22800  {
22801  *infeasible = TRUE;
22802  return SCIP_OKAY;
22803  }
22804  else if( SCIPvarGetStatus(var) == SCIP_VARSTATUS_FIXED )
22805  {
22806  *infeasible = !SCIPsetIsFeasEQ(scip->set, fixedval, SCIPvarGetLbLocal(var));
22807  return SCIP_OKAY;
22808  }
22809  }
22810  else
22811  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_ORIGINAL);
22812 
22813  switch( scip->set->stage )
22814  {
22815  case SCIP_STAGE_PROBLEM:
22816  /* in the problem creation stage, modify the bounds as requested, independently from the current bounds;
22817  * we have to make sure, that the order of the bound changes does not intermediately produce an invalid
22818  * interval lb > ub
22819  */
22820  if( fixedval <= SCIPvarGetLbLocal(var) )
22821  {
22822  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
22823  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
22824  *fixed = TRUE;
22825  }
22826  else
22827  {
22828  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
22829  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
22830  *fixed = TRUE;
22831  }
22832  return SCIP_OKAY;
22833 
22834  case SCIP_STAGE_PRESOLVING:
22835  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
22836  {
22837  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22838  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22839  fixedval, infeasible, fixed) );
22840  return SCIP_OKAY;
22841  }
22842  /*lint -fallthrough*/
22843  case SCIP_STAGE_SOLVING:
22844  if( SCIPsetIsFeasGT(scip->set, fixedval, SCIPvarGetLbLocal(var)) )
22845  {
22846  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
22847  *fixed = TRUE;
22848  }
22849  if( SCIPsetIsFeasLT(scip->set, fixedval, SCIPvarGetUbLocal(var)) )
22850  {
22851  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
22852  *fixed = TRUE;
22853  }
22854  return SCIP_OKAY;
22855 
22856  default:
22857  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22858  return SCIP_INVALIDCALL;
22859  } /*lint !e788*/
22860 }
22861 
22862 /** From a given equality a*x + b*y == c, aggregates one of the variables and removes it from the set of
22863  * active problem variables. This changes the vars array returned from SCIPgetVars() and SCIPgetVarsData(),
22864  * and also renders the arrays returned from the SCIPvarGetImpl...() methods for the two variables invalid.
22865  * In the first step, the equality is transformed into an equality with active problem variables
22866  * a'*x' + b'*y' == c'. If x' == y', this leads to the detection of redundancy if a' == -b' and c' == 0,
22867  * of infeasibility, if a' == -b' and c' != 0, or to a variable fixing x' == c'/(a'+b') (and possible
22868  * infeasibility) otherwise.
22869  * In the second step, the variable to be aggregated is chosen among x' and y', prefering a less strict variable
22870  * type as aggregation variable (i.e. continuous variables are preferred over implicit integers, implicit integers
22871  * over integers, and integers over binaries). If none of the variables is continuous, it is tried to find an integer
22872  * aggregation (i.e. integral coefficients a'' and b'', such that a''*x' + b''*y' == c''). This can lead to
22873  * the detection of infeasibility (e.g. if c'' is fractional), or to a rejection of the aggregation (denoted by
22874  * aggregated == FALSE), if the resulting integer coefficients are too large and thus numerically instable.
22875  *
22876  * The output flags have the following meaning:
22877  * - infeasible: the problem is infeasible
22878  * - redundant: the equality can be deleted from the constraint set
22879  * - aggregated: the aggregation was successfully performed (the variables were not aggregated before)
22880  *
22881  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22882  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22883  *
22884  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PRESOLVING
22885  */
22887  SCIP* scip, /**< SCIP data structure */
22888  SCIP_VAR* varx, /**< variable x in equality a*x + b*y == c */
22889  SCIP_VAR* vary, /**< variable y in equality a*x + b*y == c */
22890  SCIP_Real scalarx, /**< multiplier a in equality a*x + b*y == c */
22891  SCIP_Real scalary, /**< multiplier b in equality a*x + b*y == c */
22892  SCIP_Real rhs, /**< right hand side c in equality a*x + b*y == c */
22893  SCIP_Bool* infeasible, /**< pointer to store whether the aggregation is infeasible */
22894  SCIP_Bool* redundant, /**< pointer to store whether the equality is (now) redundant */
22895  SCIP_Bool* aggregated /**< pointer to store whether the aggregation was successful */
22896  )
22897 {
22898  SCIP_Real constantx;
22899  SCIP_Real constanty;
22900 
22901  assert(infeasible != NULL);
22902  assert(redundant != NULL);
22903  assert(aggregated != NULL);
22904 
22905  SCIP_CALL( checkStage(scip, "SCIPaggregateVars", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
22906 
22907  *infeasible = FALSE;
22908  *redundant = FALSE;
22909  *aggregated = FALSE;
22910 
22911  if( SCIPtreeProbing(scip->tree) )
22912  {
22913  SCIPerrorMessage("cannot aggregate variables during probing\n");
22914  return SCIP_INVALIDCALL;
22915  }
22916  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22917 
22918  /* do not perform aggregation if it is globally deactivated */
22919  if( scip->set->presol_donotaggr )
22920  return SCIP_OKAY;
22921 
22922  /* get the corresponding equality in active problem variable space:
22923  * transform both expressions "a*x + 0" and "b*y + 0" into problem variable space
22924  */
22925  constantx = 0.0;
22926  constanty = 0.0;
22927  SCIP_CALL( SCIPvarGetProbvarSum(&varx, scip->set, &scalarx, &constantx) );
22928  SCIP_CALL( SCIPvarGetProbvarSum(&vary, scip->set, &scalary, &constanty) );
22929 
22930  /* we cannot aggregate multi-aggregated variables */
22932  return SCIP_OKAY;
22933 
22934  /* move the constant to the right hand side to acquire the form "a'*x' + b'*y' == c'" */
22935  rhs -= (constantx + constanty);
22936 
22937  /* if a scalar is zero, treat the variable as fixed-to-zero variable */
22938  if( SCIPsetIsZero(scip->set, scalarx) )
22939  varx = NULL;
22940  if( SCIPsetIsZero(scip->set, scalary) )
22941  vary = NULL;
22942 
22943  /* capture the special cases that less than two variables are left, due to resolutions to a fixed variable or
22944  * to the same active variable
22945  */
22946  if( varx == NULL && vary == NULL )
22947  {
22948  /* both variables were resolved to fixed variables */
22949  *infeasible = !SCIPsetIsZero(scip->set, rhs);
22950  *redundant = TRUE;
22951  }
22952  else if( varx == NULL )
22953  {
22954  assert(SCIPsetIsZero(scip->set, scalarx));
22955  assert(!SCIPsetIsZero(scip->set, scalary));
22956 
22957  /* variable x was resolved to fixed variable: variable y can be fixed to c'/b' */
22958  SCIP_CALL( SCIPvarFix(vary, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22959  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22960  rhs/scalary, infeasible, aggregated) );
22961  *redundant = TRUE;
22962  }
22963  else if( vary == NULL )
22964  {
22965  assert(SCIPsetIsZero(scip->set, scalary));
22966  assert(!SCIPsetIsZero(scip->set, scalarx));
22967 
22968  /* variable y was resolved to fixed variable: variable x can be fixed to c'/a' */
22969  SCIP_CALL( SCIPvarFix(varx, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22970  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22971  rhs/scalarx, infeasible, aggregated) );
22972  *redundant = TRUE;
22973  }
22974  else if( varx == vary )
22975  {
22976  /* both variables were resolved to the same active problem variable: this variable can be fixed */
22977  scalarx += scalary;
22978  if( SCIPsetIsZero(scip->set, scalarx) )
22979  {
22980  /* left hand side of equality is zero: equality is potentially infeasible */
22981  *infeasible = !SCIPsetIsZero(scip->set, rhs);
22982  }
22983  else
22984  {
22985  /* sum of scalars is not zero: fix variable x' == y' to c'/(a'+b') */
22986  SCIP_CALL( SCIPvarFix(varx, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22987  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22988  rhs/scalarx, infeasible, aggregated) );
22989  }
22990  *redundant = TRUE;
22991  }
22992  else
22993  {
22994  /* both variables are different active problem variables, and both scalars are non-zero: try to aggregate them */
22995  SCIP_CALL( SCIPvarTryAggregateVars(scip->set, scip->mem->probmem, scip->stat, scip->transprob, scip->origprob,
22996  scip->primal, scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventfilter,
22997  scip->eventqueue, varx, vary, scalarx, scalary, rhs, infeasible, aggregated) );
22998  *redundant = *aggregated;
22999  }
23000 
23001  return SCIP_OKAY;
23002 }
23003 
23004 /** converts variable into multi-aggregated variable; this changes the variable array returned from
23005  * SCIPgetVars() and SCIPgetVarsData();
23006  *
23007  * @warning The integrality condition is not checked anymore on the multi-aggregated variable. You must not
23008  * multi-aggregate an integer variable without being sure, that integrality on the aggregation variables
23009  * implies integrality on the aggregated variable.
23010  *
23011  * The output flags have the following meaning:
23012  * - infeasible: the problem is infeasible
23013  * - aggregated: the aggregation was successfully performed (the variables were not aggregated before)
23014  *
23015  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23016  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23017  *
23018  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PRESOLVING
23019  */
23021  SCIP* scip, /**< SCIP data structure */
23022  SCIP_VAR* var, /**< variable x to aggregate */
23023  int naggvars, /**< number n of variables in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
23024  SCIP_VAR** aggvars, /**< variables y_i in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
23025  SCIP_Real* scalars, /**< multipliers a_i in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
23026  SCIP_Real constant, /**< constant shift c in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
23027  SCIP_Bool* infeasible, /**< pointer to store whether the aggregation is infeasible */
23028  SCIP_Bool* aggregated /**< pointer to store whether the aggregation was successful */
23029  )
23030 {
23031  SCIP_CALL( checkStage(scip, "SCIPmultiaggregateVar", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
23032 
23033  assert(var->scip == scip);
23034 
23035  if( SCIPtreeProbing(scip->tree) )
23036  {
23037  SCIPerrorMessage("cannot multi-aggregate variables during probing\n");
23038  return SCIP_INVALIDCALL;
23039  }
23040  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
23041 
23042  SCIP_CALL( SCIPvarMultiaggregate(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23043  scip->primal, scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventfilter,
23044  scip->eventqueue, naggvars, aggvars, scalars, constant, infeasible, aggregated) );
23045 
23046  return SCIP_OKAY;
23047 }
23048 
23049 /** returns whether aggregation of variables is not allowed */
23051  SCIP* scip /**< SCIP data structure */
23052  )
23053 {
23054  assert(scip != NULL);
23055 
23056  return scip->set->presol_donotaggr;
23057 }
23058 
23059 /** returns whether multi-aggregation is disabled */
23061  SCIP* scip /**< SCIP data structure */
23062  )
23063 {
23064  assert(scip != NULL);
23065 
23066  return scip->set->presol_donotmultaggr;
23067 }
23068 
23069 /** returns whether variable is not allowed to be multi-aggregated */
23071  SCIP* scip, /**< SCIP data structure */
23072  SCIP_VAR* var /**< variable x to aggregate */
23073  )
23074 {
23075  assert(scip != NULL);
23076  assert(var != NULL);
23077  assert(var->scip == scip);
23078 
23079  return scip->set->presol_donotmultaggr || SCIPvarDoNotMultaggr(var);
23080 }
23081 
23082 /** returns whether dual reductions propagation methods and presolvers is allowed */
23084  SCIP* scip /**< SCIP data structure */
23085  )
23086 {
23087  assert(scip != NULL);
23088 
23089  return !scip->set->reopt_enable && scip->set->misc_allowdualreds;
23090 }
23091 
23092 /** returns whether propagation w.r.t. current objective is allowed */
23094  SCIP* scip /**< SCIP data structure */
23095  )
23096 {
23097  assert(scip != NULL);
23098 
23099  return !scip->set->reopt_enable && scip->set->misc_allowobjprop;
23100 }
23101 
23102 /** marks the variable that it must not be multi-aggregated
23103  *
23104  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23105  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23106  *
23107  * @pre This method can be called if @p scip is in one of the following stages:
23108  * - \ref SCIP_STAGE_INIT
23109  * - \ref SCIP_STAGE_PROBLEM
23110  * - \ref SCIP_STAGE_TRANSFORMING
23111  * - \ref SCIP_STAGE_TRANSFORMED
23112  * - \ref SCIP_STAGE_INITPRESOLVE
23113  * - \ref SCIP_STAGE_PRESOLVING
23114  * - \ref SCIP_STAGE_EXITPRESOLVE
23115  *
23116  * @note There exists no "unmark" method since it has to be ensured that if a plugin requires that a variable is not
23117  * multi-aggregated that this is will be the case.
23118  */
23120  SCIP* scip, /**< SCIP data structure */
23121  SCIP_VAR* var /**< variable to delete */
23122  )
23123 {
23124  assert(scip != NULL);
23125  assert(var != NULL);
23126  assert(var->scip == scip);
23127 
23128  SCIP_CALL( checkStage(scip, "SCIPmarkDoNotMultaggrVar", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE) );
23129 
23131 
23132  return SCIP_OKAY;
23133 }
23134 
23135 /** enables the collection of statistics for a variable
23136  *
23137  * @pre This method can be called if @p scip is in one of the following stages:
23138  * - \ref SCIP_STAGE_PROBLEM
23139  * - \ref SCIP_STAGE_INITPRESOLVE
23140  * - \ref SCIP_STAGE_PRESOLVING
23141  * - \ref SCIP_STAGE_EXITPRESOLVE
23142  * - \ref SCIP_STAGE_SOLVING
23143  * - \ref SCIP_STAGE_SOLVED
23144  */
23146  SCIP* scip /**< SCIP data structure */
23147  )
23148 {
23149  SCIP_CALL_ABORT( checkStage(scip, "SCIPenableVarHistory", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23150 
23152 }
23153 
23154 /** disables the collection of any statistic for a variable
23155  *
23156  * @pre This method can be called if @p scip is in one of the following stages:
23157  * - \ref SCIP_STAGE_PROBLEM
23158  * - \ref SCIP_STAGE_INITPRESOLVE
23159  * - \ref SCIP_STAGE_PRESOLVING
23160  * - \ref SCIP_STAGE_EXITPRESOLVE
23161  * - \ref SCIP_STAGE_SOLVING
23162  * - \ref SCIP_STAGE_SOLVED
23163  */
23165  SCIP* scip /**< SCIP data structure */
23166  )
23167 {
23168  SCIP_CALL_ABORT( checkStage(scip, "SCIPdisableVarHistory", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23169 
23171 }
23172 
23173 /** updates the pseudo costs of the given variable and the global pseudo costs after a change of "solvaldelta" in the
23174  * variable's solution value and resulting change of "objdelta" in the in the LP's objective value;
23175  * the update is ignored, if the objective value difference is infinite
23176  *
23177  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23178  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23179  *
23180  * @pre This method can be called if @p scip is in one of the following stages:
23181  * - \ref SCIP_STAGE_SOLVING
23182  * - \ref SCIP_STAGE_SOLVED
23183  */
23185  SCIP* scip, /**< SCIP data structure */
23186  SCIP_VAR* var, /**< problem variable */
23187  SCIP_Real solvaldelta, /**< difference of variable's new LP value - old LP value */
23188  SCIP_Real objdelta, /**< difference of new LP's objective value - old LP's objective value */
23189  SCIP_Real weight /**< weight in (0,1] of this update in pseudo cost sum */
23190  )
23191 {
23192  SCIP_CALL( checkStage(scip, "SCIPupdateVarPseudocost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23193 
23194  if( !SCIPsetIsInfinity(scip->set, 2*objdelta) ) /* differences infinity - eps should also be treated as infinity */
23195  {
23196  if( scip->set->branch_divingpscost || (!scip->lp->diving && !SCIPtreeProbing(scip->tree)) )
23197  {
23198  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, solvaldelta, objdelta, weight) );
23199  }
23200  }
23201 
23202  return SCIP_OKAY;
23203 }
23204 
23205 /** gets the variable's pseudo cost value for the given change of the variable's LP value
23206  *
23207  * @return the variable's pseudo cost value for the given change of the variable's LP value
23208  *
23209  * @pre This method can be called if @p scip is in one of the following stages:
23210  * - \ref SCIP_STAGE_INITPRESOLVE
23211  * - \ref SCIP_STAGE_PRESOLVING
23212  * - \ref SCIP_STAGE_EXITPRESOLVE
23213  * - \ref SCIP_STAGE_PRESOLVED
23214  * - \ref SCIP_STAGE_INITSOLVE
23215  * - \ref SCIP_STAGE_SOLVING
23216  * - \ref SCIP_STAGE_SOLVED
23217  */
23219  SCIP* scip, /**< SCIP data structure */
23220  SCIP_VAR* var, /**< problem variable */
23221  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
23222  )
23223 {
23224  assert( var->scip == scip );
23225 
23226  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostVal", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23227 
23228  return SCIPvarGetPseudocost(var, scip->stat, solvaldelta);
23229 }
23230 
23231 /** gets the variable's pseudo cost value for the given change of the variable's LP value,
23232  * only using the pseudo cost information of the current run
23233  *
23234  * @return the variable's pseudo cost value for the given change of the variable's LP value,
23235  * only using the pseudo cost information of the current run
23236  *
23237  * @pre This method can be called if @p scip is in one of the following stages:
23238  * - \ref SCIP_STAGE_INITPRESOLVE
23239  * - \ref SCIP_STAGE_PRESOLVING
23240  * - \ref SCIP_STAGE_EXITPRESOLVE
23241  * - \ref SCIP_STAGE_PRESOLVED
23242  * - \ref SCIP_STAGE_INITSOLVE
23243  * - \ref SCIP_STAGE_SOLVING
23244  * - \ref SCIP_STAGE_SOLVED
23245  */
23247  SCIP* scip, /**< SCIP data structure */
23248  SCIP_VAR* var, /**< problem variable */
23249  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
23250  )
23251 {
23252  assert( var->scip == scip );
23253 
23254  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostValCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23255 
23256  return SCIPvarGetPseudocostCurrentRun(var, scip->stat, solvaldelta);
23257 }
23258 
23259 /** gets the variable's pseudo cost value for the given direction
23260  *
23261  * @return the variable's pseudo cost value for the given direction
23262  *
23263  * @pre This method can be called if @p scip is in one of the following stages:
23264  * - \ref SCIP_STAGE_INITPRESOLVE
23265  * - \ref SCIP_STAGE_PRESOLVING
23266  * - \ref SCIP_STAGE_EXITPRESOLVE
23267  * - \ref SCIP_STAGE_PRESOLVED
23268  * - \ref SCIP_STAGE_INITSOLVE
23269  * - \ref SCIP_STAGE_SOLVING
23270  * - \ref SCIP_STAGE_SOLVED
23271  */
23273  SCIP* scip, /**< SCIP data structure */
23274  SCIP_VAR* var, /**< problem variable */
23275  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
23276  )
23277 {
23278  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocost", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23279  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
23280  assert(var->scip == scip);
23281 
23282  return SCIPvarGetPseudocost(var, scip->stat, dir == SCIP_BRANCHDIR_DOWNWARDS ? -1.0 : 1.0);
23283 }
23284 
23285 /** gets the variable's pseudo cost value for the given direction,
23286  * only using the pseudo cost information of the current run
23287  *
23288  * @return the variable's pseudo cost value for the given direction,
23289  * only using the pseudo cost information of the current run
23290  *
23291  * @pre This method can be called if @p scip is in one of the following stages:
23292  * - \ref SCIP_STAGE_INITPRESOLVE
23293  * - \ref SCIP_STAGE_PRESOLVING
23294  * - \ref SCIP_STAGE_EXITPRESOLVE
23295  * - \ref SCIP_STAGE_PRESOLVED
23296  * - \ref SCIP_STAGE_INITSOLVE
23297  * - \ref SCIP_STAGE_SOLVING
23298  * - \ref SCIP_STAGE_SOLVED
23299  */
23301  SCIP* scip, /**< SCIP data structure */
23302  SCIP_VAR* var, /**< problem variable */
23303  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
23304  )
23305 {
23306  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23307  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
23308  assert(var->scip == scip);
23309 
23310  return SCIPvarGetPseudocostCurrentRun(var, scip->stat, dir == SCIP_BRANCHDIR_DOWNWARDS ? -1.0 : 1.0);
23311 }
23312 
23313 /** gets the variable's (possible fractional) number of pseudo cost updates for the given direction
23314  *
23315  * @return the variable's (possible fractional) number of pseudo cost updates for the given direction
23316  *
23317  * @pre This method can be called if @p scip is in one of the following stages:
23318  * - \ref SCIP_STAGE_INITPRESOLVE
23319  * - \ref SCIP_STAGE_PRESOLVING
23320  * - \ref SCIP_STAGE_EXITPRESOLVE
23321  * - \ref SCIP_STAGE_PRESOLVED
23322  * - \ref SCIP_STAGE_INITSOLVE
23323  * - \ref SCIP_STAGE_SOLVING
23324  * - \ref SCIP_STAGE_SOLVED
23325  */
23327  SCIP* scip, /**< SCIP data structure */
23328  SCIP_VAR* var, /**< problem variable */
23329  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
23330  )
23331 {
23332  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCount", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23333  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
23334  assert(var->scip == scip);
23335 
23336  return SCIPvarGetPseudocostCount(var, dir);
23337 }
23338 
23339 /** gets the variable's (possible fractional) number of pseudo cost updates for the given direction,
23340  * only using the pseudo cost information of the current run
23341  *
23342  * @return the variable's (possible fractional) number of pseudo cost updates for the given direction,
23343  * only using the pseudo cost information of the current run
23344  *
23345  * @pre This method can be called if @p scip is in one of the following stages:
23346  * - \ref SCIP_STAGE_INITPRESOLVE
23347  * - \ref SCIP_STAGE_PRESOLVING
23348  * - \ref SCIP_STAGE_EXITPRESOLVE
23349  * - \ref SCIP_STAGE_PRESOLVED
23350  * - \ref SCIP_STAGE_INITSOLVE
23351  * - \ref SCIP_STAGE_SOLVING
23352  * - \ref SCIP_STAGE_SOLVED
23353  */
23355  SCIP* scip, /**< SCIP data structure */
23356  SCIP_VAR* var, /**< problem variable */
23357  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
23358  )
23359 {
23360  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCountCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23361  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
23362  assert(var->scip == scip);
23363 
23364  return SCIPvarGetPseudocostCountCurrentRun(var, dir);
23365 }
23366 
23367 /** get pseudo cost variance of the variable, either for entire solve or only for current branch and bound run
23368  *
23369  * @return returns the (corrected) variance of pseudo code information collected so far.
23370  *
23371  * @pre This method can be called if @p scip is in one of the following stages:
23372  * - \ref SCIP_STAGE_INITPRESOLVE
23373  * - \ref SCIP_STAGE_PRESOLVING
23374  * - \ref SCIP_STAGE_EXITPRESOLVE
23375  * - \ref SCIP_STAGE_PRESOLVED
23376  * - \ref SCIP_STAGE_INITSOLVE
23377  * - \ref SCIP_STAGE_SOLVING
23378  * - \ref SCIP_STAGE_SOLVED
23379  */
23381  SCIP* scip, /**< SCIP data structure */
23382  SCIP_VAR* var, /**< problem variable */
23383  SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
23384  SCIP_Bool onlycurrentrun /**< only for pseudo costs of current branch and bound run */
23385  )
23386 {
23387  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostVariance", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23388  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
23389  assert(var->scip == scip);
23390 
23391  return SCIPvarGetPseudocostVariance(var, dir, onlycurrentrun);
23392 }
23393 
23394 /** calculates a confidence bound for this variable under the assumption of normally distributed pseudo costs
23395  *
23396  * The confidence bound \f$ \theta \geq 0\f$ denotes the interval borders \f$ [X - \theta, \ X + \theta]\f$, which contains
23397  * the true pseudo costs of the variable, i.e., the expected value of the normal distribution, with a probability
23398  * of 2 * clevel - 1.
23399  *
23400  * @return value of confidence bound for this variable
23401  */
23403  SCIP* scip, /**< SCIP data structure */
23404  SCIP_VAR* var, /**< variable in question */
23405  SCIP_BRANCHDIR dir, /**< the branching direction for the confidence bound */
23406  SCIP_Bool onlycurrentrun, /**< should only the current run be taken into account */
23407  SCIP_CONFIDENCELEVEL clevel /**< confidence level for the interval */
23408  )
23409 {
23410  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalculatePscostConfidenceBound", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23411 
23412  return SCIPvarCalcPscostConfidenceBound(var, scip->set, dir, onlycurrentrun, clevel);
23413 }
23414 
23415 /** check if variable pseudo-costs have a significant difference in location. The significance depends on
23416  * the choice of \p clevel and on the kind of tested hypothesis. The one-sided hypothesis, which
23417  * should be rejected, is that fracy * mu_y >= fracx * mu_x, where mu_y and mu_x denote the
23418  * unknown location means of the underlying pseudo-cost distributions of x and y.
23419  *
23420  * This method is applied best if variable x has a better pseudo-cost score than y. The method hypothesizes that y were actually
23421  * better than x (despite the current information), meaning that y can be expected to yield branching
23422  * decisions as least as good as x in the long run. If the method returns TRUE, the current history information is
23423  * sufficient to safely rely on the alternative hypothesis that x yields indeed a better branching score (on average)
23424  * than y.
23425  *
23426  * @note The order of x and y matters for the one-sided hypothesis
23427  *
23428  * @note set \p onesided to FALSE if you are not sure which variable is better. The hypothesis tested then reads
23429  * fracy * mu_y == fracx * mu_x vs the alternative hypothesis fracy * mu_y != fracx * mu_x.
23430  *
23431  * @return TRUE if the hypothesis can be safely rejected at the given confidence level
23432  */
23434  SCIP* scip, /**< SCIP data structure */
23435  SCIP_VAR* varx, /**< variable x */
23436  SCIP_Real fracx, /**< the fractionality of variable x */
23437  SCIP_VAR* vary, /**< variable y */
23438  SCIP_Real fracy, /**< the fractionality of variable y */
23439  SCIP_BRANCHDIR dir, /**< branching direction */
23440  SCIP_CONFIDENCELEVEL clevel, /**< confidence level for rejecting hypothesis */
23441  SCIP_Bool onesided /**< should a one-sided hypothesis y >= x be tested? */
23442  )
23443 {
23444  SCIP_CALL_ABORT( checkStage(scip, "SCIPsignificantVarPscostDifference", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23445 
23446  return SCIPvarSignificantPscostDifference(scip->set, scip->stat, varx, fracx, vary, fracy, dir, clevel, onesided);
23447 }
23448 
23449 /** tests at a given confidence level whether the variable pseudo-costs only have a small probability to
23450  * exceed a \p threshold. This is useful to determine if past observations provide enough evidence
23451  * to skip an expensive strong-branching step if there is already a candidate that has been proven to yield an improvement
23452  * of at least \p threshold.
23453  *
23454  * @note use \p clevel to adjust the level of confidence. For SCIP_CONFIDENCELEVEL_MIN, the method returns TRUE if
23455  * the estimated probability to exceed \p threshold is less than 25 %.
23456  *
23457  * @see SCIP_Confidencelevel for a list of available levels. The used probability limits refer to the one-sided levels
23458  * of confidence.
23459  *
23460  * @return TRUE if the variable pseudo-cost probabilistic model is likely to be smaller than \p threshold
23461  * at the given confidence level \p clevel.
23462  */
23464  SCIP* scip, /**< SCIP data structure */
23465  SCIP_VAR* var, /**< variable x */
23466  SCIP_Real frac, /**< the fractionality of variable x */
23467  SCIP_Real threshold, /**< the threshold to test against */
23468  SCIP_BRANCHDIR dir, /**< branching direction */
23469  SCIP_CONFIDENCELEVEL clevel /**< confidence level for rejecting hypothesis */
23470  )
23471 {
23472  SCIP_CALL_ABORT( checkStage(scip, "SCIPpscostThresholdProbabilityTest", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23473 
23474  return SCIPvarPscostThresholdProbabilityTest(scip->set, scip->stat, var, frac, threshold, dir, clevel);
23475 }
23476 
23477 /** check if the current pseudo cost relative error in a direction violates the given threshold. The Relative
23478  * Error is calculated at a specific confidence level
23479  *
23480  * @return TRUE if relative error in variable pseudo costs is smaller than \p threshold
23481  */
23483  SCIP* scip, /**< SCIP data structure */
23484  SCIP_VAR* var, /**< variable in question */
23485  SCIP_Real threshold, /**< threshold for relative errors to be considered reliable (enough) */
23486  SCIP_CONFIDENCELEVEL clevel /**< a given confidence level */
23487  )
23488 {
23489  SCIP_CALL_ABORT( checkStage(scip, "SCIPisVarPscostRelerrorReliable", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23490 
23491  return SCIPvarIsPscostRelerrorReliable(var, scip->set, scip->stat, threshold, clevel);
23492 }
23493 
23494 /** gets the variable's pseudo cost score value for the given LP solution value
23495  *
23496  * @return the variable's pseudo cost score value for the given LP solution value
23497  *
23498  * @pre This method can be called if @p scip is in one of the following stages:
23499  * - \ref SCIP_STAGE_INITPRESOLVE
23500  * - \ref SCIP_STAGE_PRESOLVING
23501  * - \ref SCIP_STAGE_EXITPRESOLVE
23502  * - \ref SCIP_STAGE_PRESOLVED
23503  * - \ref SCIP_STAGE_INITSOLVE
23504  * - \ref SCIP_STAGE_SOLVING
23505  * - \ref SCIP_STAGE_SOLVED
23506  */
23508  SCIP* scip, /**< SCIP data structure */
23509  SCIP_VAR* var, /**< problem variable */
23510  SCIP_Real solval /**< variable's LP solution value */
23511  )
23512 {
23513  SCIP_Real downsol;
23514  SCIP_Real upsol;
23515  SCIP_Real pscostdown;
23516  SCIP_Real pscostup;
23517 
23518  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23519 
23520  assert( var->scip == scip );
23521 
23522  downsol = SCIPsetFeasCeil(scip->set, solval-1.0);
23523  upsol = SCIPsetFeasFloor(scip->set, solval+1.0);
23524  pscostdown = SCIPvarGetPseudocost(var, scip->stat, downsol-solval);
23525  pscostup = SCIPvarGetPseudocost(var, scip->stat, upsol-solval);
23526 
23527  return SCIPbranchGetScore(scip->set, var, pscostdown, pscostup);
23528 }
23529 
23530 /** gets the variable's pseudo cost score value for the given LP solution value,
23531  * only using the pseudo cost information of the current run
23532  *
23533  * @return the variable's pseudo cost score value for the given LP solution value,
23534  * only using the pseudo cost information of the current run
23535  *
23536  * @pre This method can be called if @p scip is in one of the following stages:
23537  * - \ref SCIP_STAGE_INITPRESOLVE
23538  * - \ref SCIP_STAGE_PRESOLVING
23539  * - \ref SCIP_STAGE_EXITPRESOLVE
23540  * - \ref SCIP_STAGE_PRESOLVED
23541  * - \ref SCIP_STAGE_INITSOLVE
23542  * - \ref SCIP_STAGE_SOLVING
23543  * - \ref SCIP_STAGE_SOLVED
23544  */
23546  SCIP* scip, /**< SCIP data structure */
23547  SCIP_VAR* var, /**< problem variable */
23548  SCIP_Real solval /**< variable's LP solution value */
23549  )
23550 {
23551  SCIP_Real downsol;
23552  SCIP_Real upsol;
23553  SCIP_Real pscostdown;
23554  SCIP_Real pscostup;
23555 
23556  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23557 
23558  assert( var->scip == scip );
23559 
23560  downsol = SCIPsetFeasCeil(scip->set, solval-1.0);
23561  upsol = SCIPsetFeasFloor(scip->set, solval+1.0);
23562  pscostdown = SCIPvarGetPseudocostCurrentRun(var, scip->stat, downsol-solval);
23563  pscostup = SCIPvarGetPseudocostCurrentRun(var, scip->stat, upsol-solval);
23564 
23565  return SCIPbranchGetScore(scip->set, var, pscostdown, pscostup);
23566 }
23567 
23568 /** returns the variable's VSIDS value
23569  *
23570  * @return the variable's VSIDS value
23571  *
23572  * @pre This method can be called if @p scip is in one of the following stages:
23573  * - \ref SCIP_STAGE_INITPRESOLVE
23574  * - \ref SCIP_STAGE_PRESOLVING
23575  * - \ref SCIP_STAGE_EXITPRESOLVE
23576  * - \ref SCIP_STAGE_PRESOLVED
23577  * - \ref SCIP_STAGE_INITSOLVE
23578  * - \ref SCIP_STAGE_SOLVING
23579  * - \ref SCIP_STAGE_SOLVED
23580  */
23582  SCIP* scip, /**< SCIP data structure */
23583  SCIP_VAR* var, /**< problem variable */
23584  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
23585  )
23586 {
23587  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarVSIDS", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23588 
23589  assert( var->scip == scip );
23590 
23591  if( dir != SCIP_BRANCHDIR_DOWNWARDS && dir != SCIP_BRANCHDIR_UPWARDS )
23592  {
23593  SCIPerrorMessage("invalid branching direction %d when asking for VSIDS value\n", dir);
23594  return SCIP_INVALID;
23595  }
23596 
23597  return SCIPvarGetVSIDS(var, scip->stat, dir);
23598 }
23599 
23600 /** returns the variable's VSIDS value only using conflicts of the current run
23601  *
23602  * @return the variable's VSIDS value only using conflicts of the current run
23603  *
23604  * @pre This method can be called if @p scip is in one of the following stages:
23605  * - \ref SCIP_STAGE_INITPRESOLVE
23606  * - \ref SCIP_STAGE_PRESOLVING
23607  * - \ref SCIP_STAGE_EXITPRESOLVE
23608  * - \ref SCIP_STAGE_PRESOLVED
23609  * - \ref SCIP_STAGE_INITSOLVE
23610  * - \ref SCIP_STAGE_SOLVING
23611  * - \ref SCIP_STAGE_SOLVED
23612  */
23614  SCIP* scip, /**< SCIP data structure */
23615  SCIP_VAR* var, /**< problem variable */
23616  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
23617  )
23618 {
23619  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarVSIDSCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23620 
23621  assert( var->scip == scip );
23622 
23623  if( dir != SCIP_BRANCHDIR_DOWNWARDS && dir != SCIP_BRANCHDIR_UPWARDS )
23624  {
23625  SCIPerrorMessage("invalid branching direction %d when asking for VSIDS value\n", dir);
23626  return SCIP_INVALID;
23627  }
23628 
23629  return SCIPvarGetVSIDSCurrentRun(var, scip->stat, dir);
23630 }
23631 
23632 /** returns the variable's conflict score value
23633  *
23634  * @return the variable's conflict score value
23635  *
23636  * @pre This method can be called if @p scip is in one of the following stages:
23637  * - \ref SCIP_STAGE_INITPRESOLVE
23638  * - \ref SCIP_STAGE_PRESOLVING
23639  * - \ref SCIP_STAGE_EXITPRESOLVE
23640  * - \ref SCIP_STAGE_PRESOLVED
23641  * - \ref SCIP_STAGE_INITSOLVE
23642  * - \ref SCIP_STAGE_SOLVING
23643  * - \ref SCIP_STAGE_SOLVED
23644  */
23646  SCIP* scip, /**< SCIP data structure */
23647  SCIP_VAR* var /**< problem variable */
23648  )
23649 {
23650  SCIP_Real downscore;
23651  SCIP_Real upscore;
23652 
23653  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23654 
23655  assert( var->scip == scip );
23656 
23657  downscore = SCIPvarGetVSIDS(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
23658  upscore = SCIPvarGetVSIDS(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
23659 
23660  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
23661 }
23662 
23663 /** returns the variable's conflict score value only using conflicts of the current run
23664  *
23665  * @return the variable's conflict score value only using conflicts of the current run
23666  *
23667  * @pre This method can be called if @p scip is in one of the following stages:
23668  * - \ref SCIP_STAGE_INITPRESOLVE
23669  * - \ref SCIP_STAGE_PRESOLVING
23670  * - \ref SCIP_STAGE_EXITPRESOLVE
23671  * - \ref SCIP_STAGE_PRESOLVED
23672  * - \ref SCIP_STAGE_INITSOLVE
23673  * - \ref SCIP_STAGE_SOLVING
23674  * - \ref SCIP_STAGE_SOLVED
23675  */
23677  SCIP* scip, /**< SCIP data structure */
23678  SCIP_VAR* var /**< problem variable */
23679  )
23680 {
23681  SCIP_Real downscore;
23682  SCIP_Real upscore;
23683 
23684  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23685 
23686  assert( var->scip == scip );
23687 
23688  downscore = SCIPvarGetVSIDSCurrentRun(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
23689  upscore = SCIPvarGetVSIDSCurrentRun(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
23690 
23691  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
23692 }
23693 
23694 /** returns the variable's conflict length score
23695  *
23696  * @return the variable's conflict length score
23697  *
23698  * @pre This method can be called if @p scip is in one of the following stages:
23699  * - \ref SCIP_STAGE_INITPRESOLVE
23700  * - \ref SCIP_STAGE_PRESOLVING
23701  * - \ref SCIP_STAGE_EXITPRESOLVE
23702  * - \ref SCIP_STAGE_PRESOLVED
23703  * - \ref SCIP_STAGE_INITSOLVE
23704  * - \ref SCIP_STAGE_SOLVING
23705  * - \ref SCIP_STAGE_SOLVED
23706  */
23708  SCIP* scip, /**< SCIP data structure */
23709  SCIP_VAR* var /**< problem variable */
23710  )
23711 {
23712  SCIP_Real downscore;
23713  SCIP_Real upscore;
23714 
23715  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictlengthScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23716 
23717  assert( var->scip == scip );
23718 
23721 
23722  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
23723 }
23724 
23725 /** returns the variable's conflict length score only using conflicts of the current run
23726  *
23727  * @return the variable's conflict length score only using conflicts of the current run
23728  *
23729  * @pre This method can be called if @p scip is in one of the following stages:
23730  * - \ref SCIP_STAGE_INITPRESOLVE
23731  * - \ref SCIP_STAGE_PRESOLVING
23732  * - \ref SCIP_STAGE_EXITPRESOLVE
23733  * - \ref SCIP_STAGE_PRESOLVED
23734  * - \ref SCIP_STAGE_INITSOLVE
23735  * - \ref SCIP_STAGE_SOLVING
23736  * - \ref SCIP_STAGE_SOLVED
23737  */
23739  SCIP* scip, /**< SCIP data structure */
23740  SCIP_VAR* var /**< problem variable */
23741  )
23742 {
23743  SCIP_Real downscore;
23744  SCIP_Real upscore;
23745 
23746  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictlengthScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23747 
23748  assert( var->scip == scip );
23749 
23752 
23753  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
23754 }
23755 
23756 /** returns the variable's average conflict length
23757  *
23758  * @return the variable's average conflict length
23759  *
23760  * @pre This method can be called if @p scip is in one of the following stages:
23761  * - \ref SCIP_STAGE_INITPRESOLVE
23762  * - \ref SCIP_STAGE_PRESOLVING
23763  * - \ref SCIP_STAGE_EXITPRESOLVE
23764  * - \ref SCIP_STAGE_PRESOLVED
23765  * - \ref SCIP_STAGE_INITSOLVE
23766  * - \ref SCIP_STAGE_SOLVING
23767  * - \ref SCIP_STAGE_SOLVED
23768  */
23770  SCIP* scip, /**< SCIP data structure */
23771  SCIP_VAR* var, /**< problem variable */
23772  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
23773  )
23774 {
23775  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgConflictlength", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23776 
23777  assert( var->scip == scip );
23778 
23779  return SCIPvarGetAvgConflictlength(var, dir);
23780 }
23781 
23782 /** returns the variable's average conflict length only using conflicts of the current run
23783  *
23784  * @return the variable's average conflict length only using conflicts of the current run
23785  *
23786  * @pre This method can be called if @p scip is in one of the following stages:
23787  * - \ref SCIP_STAGE_INITPRESOLVE
23788  * - \ref SCIP_STAGE_PRESOLVING
23789  * - \ref SCIP_STAGE_EXITPRESOLVE
23790  * - \ref SCIP_STAGE_PRESOLVED
23791  * - \ref SCIP_STAGE_INITSOLVE
23792  * - \ref SCIP_STAGE_SOLVING
23793  * - \ref SCIP_STAGE_SOLVED
23794  */
23796  SCIP* scip, /**< SCIP data structure */
23797  SCIP_VAR* var, /**< problem variable */
23798  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
23799  )
23800 {
23801  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgConflictlengthCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23802 
23803  assert( var->scip == scip );
23804 
23805  return SCIPvarGetAvgConflictlengthCurrentRun(var, dir);
23806 }
23807 
23808 /** returns the average number of inferences found after branching on the variable in given direction;
23809  * if branching on the variable in the given direction was yet evaluated, the average number of inferences
23810  * over all variables for branching in the given direction is returned
23811  *
23812  * @return the average number of inferences found after branching on the variable in given direction
23813  *
23814  * @pre This method can be called if @p scip is in one of the following stages:
23815  * - \ref SCIP_STAGE_INITPRESOLVE
23816  * - \ref SCIP_STAGE_PRESOLVING
23817  * - \ref SCIP_STAGE_EXITPRESOLVE
23818  * - \ref SCIP_STAGE_PRESOLVED
23819  * - \ref SCIP_STAGE_INITSOLVE
23820  * - \ref SCIP_STAGE_SOLVING
23821  * - \ref SCIP_STAGE_SOLVED
23822  */
23824  SCIP* scip, /**< SCIP data structure */
23825  SCIP_VAR* var, /**< problem variable */
23826  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
23827  )
23828 {
23829  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferences", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23830 
23831  assert( var->scip == scip );
23832 
23833  return SCIPvarGetAvgInferences(var, scip->stat, dir);
23834 }
23835 
23836 /** returns the average number of inferences found after branching on the variable in given direction in the current run;
23837  * if branching on the variable in the given direction was yet evaluated, the average number of inferences
23838  * over all variables for branching in the given direction is returned
23839  *
23840  * @return the average number of inferences found after branching on the variable in given direction in the current run
23841  *
23842  * @pre This method can be called if @p scip is in one of the following stages:
23843  * - \ref SCIP_STAGE_INITPRESOLVE
23844  * - \ref SCIP_STAGE_PRESOLVING
23845  * - \ref SCIP_STAGE_EXITPRESOLVE
23846  * - \ref SCIP_STAGE_PRESOLVED
23847  * - \ref SCIP_STAGE_INITSOLVE
23848  * - \ref SCIP_STAGE_SOLVING
23849  * - \ref SCIP_STAGE_SOLVED
23850  */
23852  SCIP* scip, /**< SCIP data structure */
23853  SCIP_VAR* var, /**< problem variable */
23854  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
23855  )
23856 {
23857  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferencesCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23858 
23859  assert( var->scip == scip );
23860 
23861  return SCIPvarGetAvgInferencesCurrentRun(var, scip->stat, dir);
23862 }
23863 
23864 /** returns the variable's average inference score value
23865  *
23866  * @return the variable's average inference score value
23867  *
23868  * @pre This method can be called if @p scip is in one of the following stages:
23869  * - \ref SCIP_STAGE_INITPRESOLVE
23870  * - \ref SCIP_STAGE_PRESOLVING
23871  * - \ref SCIP_STAGE_EXITPRESOLVE
23872  * - \ref SCIP_STAGE_PRESOLVED
23873  * - \ref SCIP_STAGE_INITSOLVE
23874  * - \ref SCIP_STAGE_SOLVING
23875  * - \ref SCIP_STAGE_SOLVED
23876  */
23878  SCIP* scip, /**< SCIP data structure */
23879  SCIP_VAR* var /**< problem variable */
23880  )
23881 {
23882  SCIP_Real inferdown;
23883  SCIP_Real inferup;
23884 
23885  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23886 
23887  assert( var->scip == scip );
23888 
23889  inferdown = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
23890  inferup = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
23891 
23892  return SCIPbranchGetScore(scip->set, var, inferdown, inferup);
23893 }
23894 
23895 /** returns the variable's average inference score value only using inferences of the current run
23896  *
23897  * @return the variable's average inference score value only using inferences of the current run
23898  *
23899  * @pre This method can be called if @p scip is in one of the following stages:
23900  * - \ref SCIP_STAGE_INITPRESOLVE
23901  * - \ref SCIP_STAGE_PRESOLVING
23902  * - \ref SCIP_STAGE_EXITPRESOLVE
23903  * - \ref SCIP_STAGE_PRESOLVED
23904  * - \ref SCIP_STAGE_INITSOLVE
23905  * - \ref SCIP_STAGE_SOLVING
23906  * - \ref SCIP_STAGE_SOLVED
23907  */
23909  SCIP* scip, /**< SCIP data structure */
23910  SCIP_VAR* var /**< problem variable */
23911  )
23912 {
23913  SCIP_Real inferdown;
23914  SCIP_Real inferup;
23915 
23916  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
23917 
23918  assert( var->scip == scip );
23919 
23922 
23923  return SCIPbranchGetScore(scip->set, var, inferdown, inferup);
23924 }
23925 
23926 /** initializes the upwards and downwards pseudocosts, conflict scores, conflict lengths, inference scores, cutoff scores
23927  * of a variable to the given values
23928  *
23929  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23930  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23931  *
23932  * @pre This method can be called if @p scip is in one of the following stages:
23933  * - \ref SCIP_STAGE_TRANSFORMED
23934  * - \ref SCIP_STAGE_INITPRESOLVE
23935  * - \ref SCIP_STAGE_PRESOLVING
23936  * - \ref SCIP_STAGE_EXITPRESOLVE
23937  * - \ref SCIP_STAGE_PRESOLVED
23938  * - \ref SCIP_STAGE_INITSOLVE
23939  * - \ref SCIP_STAGE_SOLVING
23940  */
23942  SCIP* scip, /**< SCIP data structure */
23943  SCIP_VAR* var, /**< variable which should be initialized */
23944  SCIP_Real downpscost, /**< value to which pseudocosts for downwards branching should be initialized */
23945  SCIP_Real uppscost, /**< value to which pseudocosts for upwards branching should be initialized */
23946  SCIP_Real downvsids, /**< value to which VSIDS score for downwards branching should be initialized */
23947  SCIP_Real upvsids, /**< value to which VSIDS score for upwards branching should be initialized */
23948  SCIP_Real downconflen, /**< value to which conflict length score for downwards branching should be initialized */
23949  SCIP_Real upconflen, /**< value to which conflict length score for upwards branching should be initialized */
23950  SCIP_Real downinfer, /**< value to which inference counter for downwards branching should be initialized */
23951  SCIP_Real upinfer, /**< value to which inference counter for upwards branching should be initialized */
23952  SCIP_Real downcutoff, /**< value to which cutoff counter for downwards branching should be initialized */
23953  SCIP_Real upcutoff /**< value to which cutoff counter for upwards branching should be initialized */
23954  )
23955 {
23956  SCIP_CALL( checkStage(scip, "SCIPinitVarBranchStats", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23957 
23958  assert(downpscost >= 0.0 && uppscost >= 0.0);
23959  assert(downvsids >= 0.0 && upvsids >= 0.0);
23960  assert(downconflen >= 0.0 && upconflen >= 0.0);
23961  assert(downinfer >= 0.0 && upinfer >= 0.0);
23962  assert(downcutoff >= 0.0 && upcutoff >= 0.0);
23963 
23964  if( !SCIPisFeasZero(scip, downpscost) || !SCIPisFeasZero(scip, downvsids)
23965  || !SCIPisFeasZero(scip, downinfer) || !SCIPisFeasZero(scip, downcutoff) )
23966  {
23968  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, -1.0, downpscost, 1.0) );
23970  SCIP_CALL( SCIPvarIncVSIDS(var, NULL, scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, SCIP_UNKNOWN, downvsids) );
23972  }
23973 
23974  if( !SCIPisFeasZero(scip, downconflen) )
23975  {
23977  }
23978 
23979  if( !SCIPisFeasZero(scip, uppscost) || !SCIPisFeasZero(scip, upvsids)
23980  || !SCIPisFeasZero(scip, upinfer) || !SCIPisFeasZero(scip, upcutoff) )
23981  {
23983  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, 1.0, uppscost, 1.0) );
23985  SCIP_CALL( SCIPvarIncVSIDS(var, NULL, scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, SCIP_UNKNOWN, upvsids) );
23987  }
23988 
23989  if( !SCIPisFeasZero(scip, upconflen) )
23990  {
23992  }
23993 
23994  return SCIP_OKAY;
23995 }
23996 
23997 /** initializes the upwards and downwards conflict scores, conflict lengths, inference scores, cutoff scores of a
23998  * variable w.r.t. a value by the given values (SCIP_VALUEHISTORY)
23999  *
24000  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24001  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24002  *
24003  * @pre This method can be called if @p scip is in one of the following stages:
24004  * - \ref SCIP_STAGE_TRANSFORMED
24005  * - \ref SCIP_STAGE_INITPRESOLVE
24006  * - \ref SCIP_STAGE_PRESOLVING
24007  * - \ref SCIP_STAGE_EXITPRESOLVE
24008  * - \ref SCIP_STAGE_PRESOLVED
24009  * - \ref SCIP_STAGE_INITSOLVE
24010  * - \ref SCIP_STAGE_SOLVING
24011  */
24013  SCIP* scip, /**< SCIP data structure */
24014  SCIP_VAR* var, /**< variable which should be initialized */
24015  SCIP_Real value, /**< domain value, or SCIP_UNKNOWN */
24016  SCIP_Real downvsids, /**< value to which VSIDS score for downwards branching should be initialized */
24017  SCIP_Real upvsids, /**< value to which VSIDS score for upwards branching should be initialized */
24018  SCIP_Real downconflen, /**< value to which conflict length score for downwards branching should be initialized */
24019  SCIP_Real upconflen, /**< value to which conflict length score for upwards branching should be initialized */
24020  SCIP_Real downinfer, /**< value to which inference counter for downwards branching should be initialized */
24021  SCIP_Real upinfer, /**< value to which inference counter for upwards branching should be initialized */
24022  SCIP_Real downcutoff, /**< value to which cutoff counter for downwards branching should be initialized */
24023  SCIP_Real upcutoff /**< value to which cutoff counter for upwards branching should be initialized */
24024  )
24025 {
24026  SCIP_CALL( checkStage(scip, "SCIPinitVarValueBranchStats", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24027 
24028  assert(downvsids >= 0.0 && upvsids >= 0.0);
24029  assert(downconflen >= 0.0 && upconflen >= 0.0);
24030  assert(downinfer >= 0.0 && upinfer >= 0.0);
24031  assert(downcutoff >= 0.0 && upcutoff >= 0.0);
24032 
24033  if( !SCIPisFeasZero(scip, downvsids) || !SCIPisFeasZero(scip, downinfer) || !SCIPisFeasZero(scip, downcutoff) )
24034  {
24035  SCIP_CALL( SCIPvarIncNBranchings(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, 1) );
24036  SCIP_CALL( SCIPvarIncInferenceSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downinfer) );
24037  SCIP_CALL( SCIPvarIncVSIDS(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downvsids) );
24038  SCIP_CALL( SCIPvarIncCutoffSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downcutoff) );
24039  }
24040 
24041  if( !SCIPisFeasZero(scip, downconflen) )
24042  {
24043  SCIP_CALL( SCIPvarIncNActiveConflicts(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downconflen) );
24044  }
24045 
24046  if( !SCIPisFeasZero(scip, upvsids) || !SCIPisFeasZero(scip, upinfer) || !SCIPisFeasZero(scip, upcutoff) )
24047  {
24048  SCIP_CALL( SCIPvarIncNBranchings(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, 1) );
24049  SCIP_CALL( SCIPvarIncInferenceSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upinfer) );
24050  SCIP_CALL( SCIPvarIncVSIDS(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upvsids) );
24051  SCIP_CALL( SCIPvarIncCutoffSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upcutoff) );
24052  }
24053 
24054  if( !SCIPisFeasZero(scip, upconflen) )
24055  {
24056  SCIP_CALL( SCIPvarIncNActiveConflicts(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upconflen) );
24057  }
24058 
24059  return SCIP_OKAY;
24060 }
24061 
24062 /** returns the average number of cutoffs found after branching on the variable in given direction;
24063  * if branching on the variable in the given direction was yet evaluated, the average number of cutoffs
24064  * over all variables for branching in the given direction is returned
24065  *
24066  * @return the average number of cutoffs found after branching on the variable in given direction
24067  *
24068  * @pre This method can be called if @p scip is in one of the following stages:
24069  * - \ref SCIP_STAGE_INITPRESOLVE
24070  * - \ref SCIP_STAGE_PRESOLVING
24071  * - \ref SCIP_STAGE_EXITPRESOLVE
24072  * - \ref SCIP_STAGE_PRESOLVED
24073  * - \ref SCIP_STAGE_INITSOLVE
24074  * - \ref SCIP_STAGE_SOLVING
24075  * - \ref SCIP_STAGE_SOLVED
24076  */
24078  SCIP* scip, /**< SCIP data structure */
24079  SCIP_VAR* var, /**< problem variable */
24080  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
24081  )
24082 {
24083  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffs", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
24084 
24085  assert( var->scip == scip );
24086 
24087  return SCIPvarGetAvgCutoffs(var, scip->stat, dir);
24088 }
24089 
24090 /** returns the average number of cutoffs found after branching on the variable in given direction in the current run;
24091  * if branching on the variable in the given direction was yet evaluated, the average number of cutoffs
24092  * over all variables for branching in the given direction is returned
24093  *
24094  * @return the average number of cutoffs found after branching on the variable in given direction in the current run
24095  *
24096  * @pre This method can be called if @p scip is in one of the following stages:
24097  * - \ref SCIP_STAGE_INITPRESOLVE
24098  * - \ref SCIP_STAGE_PRESOLVING
24099  * - \ref SCIP_STAGE_EXITPRESOLVE
24100  * - \ref SCIP_STAGE_PRESOLVED
24101  * - \ref SCIP_STAGE_INITSOLVE
24102  * - \ref SCIP_STAGE_SOLVING
24103  * - \ref SCIP_STAGE_SOLVED
24104  */
24106  SCIP* scip, /**< SCIP data structure */
24107  SCIP_VAR* var, /**< problem variable */
24108  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
24109  )
24110 {
24111  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffsCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
24112 
24113  assert( var->scip == scip );
24114 
24115  return SCIPvarGetAvgCutoffsCurrentRun(var, scip->stat, dir);
24116 }
24117 
24118 /** returns the variable's average cutoff score value
24119  *
24120  * @return the variable's average cutoff score value
24121  *
24122  * @pre This method can be called if @p scip is in one of the following stages:
24123  * - \ref SCIP_STAGE_INITPRESOLVE
24124  * - \ref SCIP_STAGE_PRESOLVING
24125  * - \ref SCIP_STAGE_EXITPRESOLVE
24126  * - \ref SCIP_STAGE_PRESOLVED
24127  * - \ref SCIP_STAGE_INITSOLVE
24128  * - \ref SCIP_STAGE_SOLVING
24129  * - \ref SCIP_STAGE_SOLVED
24130  */
24132  SCIP* scip, /**< SCIP data structure */
24133  SCIP_VAR* var /**< problem variable */
24134  )
24135 {
24136  SCIP_Real cutoffdown;
24137  SCIP_Real cutoffup;
24138 
24139  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
24140 
24141  assert( var->scip == scip );
24142 
24143  cutoffdown = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
24144  cutoffup = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
24145 
24146  return SCIPbranchGetScore(scip->set, var, cutoffdown, cutoffup);
24147 }
24148 
24149 /** returns the variable's average cutoff score value, only using cutoffs of the current run
24150  *
24151  * @return the variable's average cutoff score value, only using cutoffs of the current run
24152  *
24153  * @pre This method can be called if @p scip is in one of the following stages:
24154  * - \ref SCIP_STAGE_INITPRESOLVE
24155  * - \ref SCIP_STAGE_PRESOLVING
24156  * - \ref SCIP_STAGE_EXITPRESOLVE
24157  * - \ref SCIP_STAGE_PRESOLVED
24158  * - \ref SCIP_STAGE_INITSOLVE
24159  * - \ref SCIP_STAGE_SOLVING
24160  * - \ref SCIP_STAGE_SOLVED
24161  */
24163  SCIP* scip, /**< SCIP data structure */
24164  SCIP_VAR* var /**< problem variable */
24165  )
24166 {
24167  SCIP_Real cutoffdown;
24168  SCIP_Real cutoffup;
24169 
24170  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
24171 
24172  assert( var->scip == scip );
24173 
24176 
24177  return SCIPbranchGetScore(scip->set, var, cutoffdown, cutoffup);
24178 }
24179 
24180 /** returns the variable's average inference/cutoff score value, weighting the cutoffs of the variable with the given
24181  * factor
24182  *
24183  * @return the variable's average inference/cutoff score value
24184  *
24185  * @pre This method can be called if @p scip is in one of the following stages:
24186  * - \ref SCIP_STAGE_INITPRESOLVE
24187  * - \ref SCIP_STAGE_PRESOLVING
24188  * - \ref SCIP_STAGE_EXITPRESOLVE
24189  * - \ref SCIP_STAGE_PRESOLVED
24190  * - \ref SCIP_STAGE_INITSOLVE
24191  * - \ref SCIP_STAGE_SOLVING
24192  * - \ref SCIP_STAGE_SOLVED
24193  */
24195  SCIP* scip, /**< SCIP data structure */
24196  SCIP_VAR* var, /**< problem variable */
24197  SCIP_Real cutoffweight /**< factor to weigh average number of cutoffs in branching score */
24198  )
24199 {
24200  SCIP_Real avginferdown;
24201  SCIP_Real avginferup;
24202  SCIP_Real avginfer;
24203  SCIP_Real inferdown;
24204  SCIP_Real inferup;
24205  SCIP_Real cutoffdown;
24206  SCIP_Real cutoffup;
24207 
24208  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceCutoffScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
24209 
24210  assert( var->scip == scip );
24211 
24214  avginfer = (avginferdown + avginferup)/2.0;
24215  inferdown = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
24216  inferup = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
24217  cutoffdown = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
24218  cutoffup = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
24219 
24220  return SCIPbranchGetScore(scip->set, var,
24221  inferdown + cutoffweight * avginfer * cutoffdown, inferup + cutoffweight * avginfer * cutoffup);
24222 }
24223 
24224 /** returns the variable's average inference/cutoff score value, weighting the cutoffs of the variable with the given
24225  * factor, only using inferences and cutoffs of the current run
24226  *
24227  * @return the variable's average inference/cutoff score value, only using inferences and cutoffs of the current run
24228  *
24229  * @pre This method can be called if @p scip is in one of the following stages:
24230  * - \ref SCIP_STAGE_INITPRESOLVE
24231  * - \ref SCIP_STAGE_PRESOLVING
24232  * - \ref SCIP_STAGE_EXITPRESOLVE
24233  * - \ref SCIP_STAGE_PRESOLVED
24234  * - \ref SCIP_STAGE_INITSOLVE
24235  * - \ref SCIP_STAGE_SOLVING
24236  * - \ref SCIP_STAGE_SOLVED
24237  */
24239  SCIP* scip, /**< SCIP data structure */
24240  SCIP_VAR* var, /**< problem variable */
24241  SCIP_Real cutoffweight /**< factor to weigh average number of cutoffs in branching score */
24242  )
24243 {
24244  SCIP_Real avginferdown;
24245  SCIP_Real avginferup;
24246  SCIP_Real avginfer;
24247  SCIP_Real inferdown;
24248  SCIP_Real inferup;
24249  SCIP_Real cutoffdown;
24250  SCIP_Real cutoffup;
24251 
24252  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
24253 
24254  assert( var->scip == scip );
24255 
24258  avginfer = (avginferdown + avginferup)/2.0;
24263 
24264  return SCIPbranchGetScore(scip->set, var,
24265  inferdown + cutoffweight * avginfer * cutoffdown, inferup + cutoffweight * avginfer * cutoffup);
24266 }
24267 
24268 /** outputs variable information to file stream via the message system
24269  *
24270  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24271  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24272  *
24273  * @pre This method can be called if @p scip is in one of the following stages:
24274  * - \ref SCIP_STAGE_PROBLEM
24275  * - \ref SCIP_STAGE_TRANSFORMING
24276  * - \ref SCIP_STAGE_TRANSFORMED
24277  * - \ref SCIP_STAGE_INITPRESOLVE
24278  * - \ref SCIP_STAGE_PRESOLVING
24279  * - \ref SCIP_STAGE_EXITPRESOLVE
24280  * - \ref SCIP_STAGE_PRESOLVED
24281  * - \ref SCIP_STAGE_INITSOLVE
24282  * - \ref SCIP_STAGE_SOLVING
24283  * - \ref SCIP_STAGE_SOLVED
24284  * - \ref SCIP_STAGE_EXITSOLVE
24285  * - \ref SCIP_STAGE_FREETRANS
24286  *
24287  * @note If the message handler is set to a NULL pointer nothing will be printed
24288  */
24290  SCIP* scip, /**< SCIP data structure */
24291  SCIP_VAR* var, /**< problem variable */
24292  FILE* file /**< output file (or NULL for standard output) */
24293  )
24294 {
24295  SCIP_CALL( checkStage(scip, "SCIPprintVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
24296 
24297  SCIP_CALL( SCIPvarPrint(var, scip->set, scip->messagehdlr, file) );
24298 
24299  return SCIP_OKAY;
24300 }
24301 
24302 /*
24303  * conflict analysis methods
24304  */
24305 
24306 /** return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
24307  * conflict analysis since it will not be applied
24308  *
24309  * @return return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
24310  * conflict analysis since it will not be applied
24311  *
24312  * @pre This method can be called if SCIP is in one of the following stages:
24313  * - \ref SCIP_STAGE_INITPRESOLVE
24314  * - \ref SCIP_STAGE_PRESOLVING
24315  * - \ref SCIP_STAGE_EXITPRESOLVE
24316  * - \ref SCIP_STAGE_SOLVING
24317  *
24318  * @note SCIP stage does not get changed
24319  */
24321  SCIP* scip /**< SCIP data structure */
24322  )
24323 {
24324  SCIP_CALL_ABORT( checkStage(scip, "SCIPisConflictAnalysisApplicable", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24325 
24326  return (SCIPgetDepth(scip) > 0 && SCIPconflictApplicable(scip->set));
24327 }
24328 
24329 /** initializes the conflict analysis by clearing the conflict candidate queue; this method must be called before you
24330  * enter the conflict variables by calling SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
24331  * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar();
24332  *
24333  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24334  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24335  *
24336  * @pre This method can be called if SCIP is in one of the following stages:
24337  * - \ref SCIP_STAGE_PRESOLVING
24338  * - \ref SCIP_STAGE_SOLVING
24339  *
24340  * @note SCIP stage does not get changed
24341  */
24343  SCIP* scip /**< SCIP data structure */
24344  )
24345 {
24346  SCIP_CALL( checkStage(scip, "SCIPinitConflictAnalysis", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24347 
24348  SCIP_CALL( SCIPconflictInit(scip->conflict, scip->set, scip->stat, scip->transprob) );
24349 
24350  return SCIP_OKAY;
24351 }
24352 
24353 /** adds lower bound of variable at the time of the given bound change index to the conflict analysis' candidate storage;
24354  * this method should be called in one of the following two cases:
24355  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictLb() should be called for each lower bound
24356  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
24357  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictLb() should be called
24358  * for each lower bound, whose current assignment led to the deduction of the given conflict bound.
24359  *
24360  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24361  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24362  *
24363  * @pre This method can be called if SCIP is in one of the following stages:
24364  * - \ref SCIP_STAGE_PRESOLVING
24365  * - \ref SCIP_STAGE_SOLVING
24366  *
24367  * @note SCIP stage does not get changed
24368  */
24370  SCIP* scip, /**< SCIP data structure */
24371  SCIP_VAR* var, /**< variable whose lower bound should be added to conflict candidate queue */
24372  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
24373  * conflicting bound was valid, NULL for current local bound */
24374  )
24375 {
24376  SCIP_CALL( checkStage(scip, "SCIPaddConflictLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24377 
24378  assert( var->scip == scip );
24379 
24380  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, bdchgidx) );
24381 
24382  return SCIP_OKAY;
24383 }
24384 
24385 /** adds lower bound of variable at the time of the given bound change index to the conflict analysis' candidate storage
24386  * with the additional information of a relaxed lower bound; this relaxed lower bound is the one which would be enough
24387  * to explain a certain bound change;
24388  * this method should be called in one of the following two cases:
24389  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedLb() should be called for each (relaxed) lower bound
24390  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
24391  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelexedLb() should be called
24392  * for each (relaxed) lower bound, whose current assignment led to the deduction of the given conflict bound.
24393  *
24394  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24395  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24396  *
24397  * @pre This method can be called if SCIP is in one of the following stages:
24398  * - \ref SCIP_STAGE_PRESOLVING
24399  * - \ref SCIP_STAGE_SOLVING
24400  *
24401  * @note SCIP stage does not get changed
24402  */
24404  SCIP* scip, /**< SCIP data structure */
24405  SCIP_VAR* var, /**< variable whose lower bound should be added to conflict candidate queue */
24406  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
24407  * conflicting bound was valid, NULL for current local bound */
24408  SCIP_Real relaxedlb /**< the relaxed lower bound */
24409  )
24410 {
24411  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24412 
24413  assert( var->scip == scip );
24414 
24415  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, bdchgidx, relaxedlb) );
24416 
24417  return SCIP_OKAY;
24418 }
24419 
24420 /** adds upper bound of variable at the time of the given bound change index to the conflict analysis' candidate storage;
24421  * this method should be called in one of the following two cases:
24422  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictUb() should be called for each upper bound that
24423  * led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
24424  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictUb() should be called for
24425  * each upper bound, whose current assignment led to the deduction of the given conflict bound.
24426  *
24427  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24428  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24429  *
24430  * @pre This method can be called if SCIP is in one of the following stages:
24431  * - \ref SCIP_STAGE_PRESOLVING
24432  * - \ref SCIP_STAGE_SOLVING
24433  *
24434  * @note SCIP stage does not get changed
24435  */
24437  SCIP* scip, /**< SCIP data structure */
24438  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
24439  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
24440  * conflicting bound was valid, NULL for current local bound */
24441  )
24442 {
24443  SCIP_CALL( checkStage(scip, "SCIPaddConflictUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24444 
24445  assert( var->scip == scip );
24446 
24447  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, bdchgidx) );
24448 
24449  return SCIP_OKAY;
24450 }
24451 
24452 /** adds upper bound of variable at the time of the given bound change index to the conflict analysis' candidate storage
24453  * with the additional information of a relaxed upper bound; this relaxed upper bound is the one which would be enough
24454  * to explain a certain bound change;
24455  * this method should be called in one of the following two cases:
24456  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedUb() should be called for each (relaxed) upper
24457  * bound that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
24458  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelaxedUb() should be
24459  * called for each (relaxed) upper bound, whose current assignment led to the deduction of the given conflict
24460  * bound.
24461  *
24462  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24463  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24464  *
24465  * @pre This method can be called if SCIP is in one of the following stages:
24466  * - \ref SCIP_STAGE_PRESOLVING
24467  * - \ref SCIP_STAGE_SOLVING
24468  *
24469  * @note SCIP stage does not get changed
24470  */
24472  SCIP* scip, /**< SCIP data structure */
24473  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
24474  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
24475  * conflicting bound was valid, NULL for current local bound */
24476  SCIP_Real relaxedub /**< the relaxed upper bound */
24477  )
24478 {
24479  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24480 
24481  assert( var->scip == scip );
24482 
24483  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, bdchgidx, relaxedub) );
24484 
24485  return SCIP_OKAY;
24486 }
24487 
24488 /** adds lower or upper bound of variable at the time of the given bound change index to the conflict analysis' candidate
24489  * storage; this method should be called in one of the following two cases:
24490  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictBd() should be called for each bound
24491  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
24492  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictBd() should be called
24493  * for each bound, whose current assignment led to the deduction of the given conflict bound.
24494  *
24495  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24496  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24497  *
24498  * @pre This method can be called if SCIP is in one of the following stages:
24499  * - \ref SCIP_STAGE_PRESOLVING
24500  * - \ref SCIP_STAGE_SOLVING
24501  *
24502  * @note SCIP stage does not get changed
24503  */
24505  SCIP* scip, /**< SCIP data structure */
24506  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
24507  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
24508  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
24509  * conflicting bound was valid, NULL for current local bound */
24510  )
24511 {
24512  SCIP_CALL( checkStage(scip, "SCIPaddConflictBd", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24513 
24514  assert( var->scip == scip );
24515 
24516  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, boundtype, bdchgidx) );
24517 
24518  return SCIP_OKAY;
24519 }
24520 
24521 /** adds lower or upper bound of variable at the time of the given bound change index to the conflict analysis'
24522  * candidate storage; with the additional information of a relaxed upper bound; this relaxed upper bound is the one
24523  * which would be enough to explain a certain bound change;
24524  * this method should be called in one of the following two cases:
24525  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedBd() should be called for each (relaxed)
24526  * bound that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
24527  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelaxedBd() should be
24528  * called for each (relaxed) bound, whose current assignment led to the deduction of the given conflict bound.
24529  *
24530  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24531  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24532  *
24533  * @pre This method can be called if SCIP is in one of the following stages:
24534  * - \ref SCIP_STAGE_PRESOLVING
24535  * - \ref SCIP_STAGE_SOLVING
24536  *
24537  * @note SCIP stage does not get changed
24538  */
24540  SCIP* scip, /**< SCIP data structure */
24541  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
24542  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
24543  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
24544  * conflicting bound was valid, NULL for current local bound */
24545  SCIP_Real relaxedbd /**< the relaxed bound */
24546  )
24547 {
24548  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedBd", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24549 
24550  assert( var->scip == scip );
24551 
24552  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, boundtype, bdchgidx, relaxedbd) );
24553 
24554  return SCIP_OKAY;
24555 }
24556 
24557 /** adds changed bound of fixed binary variable to the conflict analysis' candidate storage;
24558  * this method should be called in one of the following two cases:
24559  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictBinvar() should be called for each fixed binary
24560  * variable that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
24561  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictBinvar() should be called
24562  * for each binary variable, whose current fixing led to the deduction of the given conflict bound.
24563  *
24564  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24565  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24566  *
24567  * @pre This method can be called if SCIP is in one of the following stages:
24568  * - \ref SCIP_STAGE_PRESOLVING
24569  * - \ref SCIP_STAGE_SOLVING
24570  *
24571  * @note SCIP stage does not get changed
24572  */
24574  SCIP* scip, /**< SCIP data structure */
24575  SCIP_VAR* var /**< binary variable whose changed bound should be added to conflict queue */
24576  )
24577 {
24578  SCIP_CALL( checkStage(scip, "SCIPaddConflictBinvar", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24579 
24580  assert(var->scip == scip);
24581  assert(SCIPvarIsBinary(var));
24582 
24583  if( SCIPvarGetLbLocal(var) > 0.5 )
24584  {
24585  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, NULL) );
24586  }
24587  else if( SCIPvarGetUbLocal(var) < 0.5 )
24588  {
24589  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, NULL) );
24590  }
24591 
24592  return SCIP_OKAY;
24593 }
24594 
24595 /** checks if the given variable is already part of the current conflict set or queued for resolving with the same or
24596  * even stronger bound
24597  *
24598  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24599  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24600  *
24601  * @pre This method can be called if SCIP is in one of the following stages:
24602  * - \ref SCIP_STAGE_PRESOLVING
24603  * - \ref SCIP_STAGE_SOLVING
24604  *
24605  * @note SCIP stage does not get changed
24606  */
24608  SCIP* scip, /**< SCIP data structure */
24609  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
24610  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
24611  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
24612  * conflicting bound was valid, NULL for current local bound */
24613  SCIP_Bool* used /**< pointer to store if the variable is already used */
24614  )
24615 {
24616  SCIP_CALL_ABORT( checkStage(scip, "SCIPisConflictVarUsed", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24617 
24618  assert( var->scip == scip );
24619 
24620  return SCIPconflictIsVarUsed(scip->conflict, var, scip->set, boundtype, bdchgidx, used);
24621 }
24622 
24623 /** returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
24624  * bound
24625  *
24626  * @return returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
24627  * bound
24628  *
24629  * @pre This method can be called if SCIP is in one of the following stages:
24630  * - \ref SCIP_STAGE_PRESOLVING
24631  * - \ref SCIP_STAGE_SOLVING
24632  *
24633  * @note SCIP stage does not get changed
24634  */
24636  SCIP* scip, /**< SCIP data structure */
24637  SCIP_VAR* var /**< problem variable */
24638  )
24639 {
24640  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConflictVarLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24641 
24642  assert( var->scip == scip );
24643 
24644  return SCIPconflictGetVarLb(scip->conflict, var);
24645 }
24646 
24647 /** returns the conflict upper bound if the variable is present in the current conflict set; otherwise minus global
24648  * upper bound
24649  *
24650  * @return returns the conflict upper bound if the variable is present in the current conflict set; otherwise minus global
24651  * upper bound
24652  *
24653  * @pre This method can be called if SCIP is in one of the following stages:
24654  * - \ref SCIP_STAGE_PRESOLVING
24655  * - \ref SCIP_STAGE_SOLVING
24656  *
24657  * @note SCIP stage does not get changed
24658  */
24660  SCIP* scip, /**< SCIP data structure */
24661  SCIP_VAR* var /**< problem variable */
24662  )
24663 {
24664  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConflictVarUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24665 
24666  assert( var->scip == scip );
24667 
24668  return SCIPconflictGetVarUb(scip->conflict, var);
24669 }
24670 
24671 /** analyzes conflict bounds that were added after a call to SCIPinitConflictAnalysis() with calls to
24672  * SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(),
24673  * SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar(); on success, calls the conflict
24674  * handlers to create a conflict constraint out of the resulting conflict set; the given valid depth must be a depth
24675  * level, at which the conflict set defined by calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
24676  * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), and SCIPaddConflictBinvar() is
24677  * valid for the whole subtree; if the conflict was found by a violated constraint, use SCIPanalyzeConflictCons()
24678  * instead of SCIPanalyzeConflict() to make sure, that the correct valid depth is used
24679  *
24680  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24681  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24682  *
24683  * @pre This method can be called if SCIP is in one of the following stages:
24684  * - \ref SCIP_STAGE_PRESOLVING
24685  * - \ref SCIP_STAGE_SOLVING
24686  *
24687  * @note SCIP stage does not get changed
24688  */
24690  SCIP* scip, /**< SCIP data structure */
24691  int validdepth, /**< minimal depth level at which the initial conflict set is valid */
24692  SCIP_Bool* success /**< pointer to store whether a conflict constraint was created, or NULL */
24693  )
24694 {
24695  SCIP_CALL( checkStage(scip, "SCIPanalyzeConflict", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24696 
24697  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
24698  scip->transprob, scip->tree, validdepth, success) );
24699 
24700  return SCIP_OKAY;
24701 }
24702 
24703 /** analyzes conflict bounds that were added with calls to SCIPaddConflictLb(), SCIPaddConflictUb(),
24704  * SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or
24705  * SCIPaddConflictBinvar(); on success, calls the conflict handlers to create a conflict constraint out of the
24706  * resulting conflict set; the given constraint must be the constraint that detected the conflict, i.e. the constraint
24707  * that is infeasible in the local bounds of the initial conflict set (defined by calls to SCIPaddConflictLb(),
24708  * SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(),
24709  * SCIPaddConflictRelaxedBd(), and SCIPaddConflictBinvar())
24710  *
24711  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24712  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24713  *
24714  * @pre This method can be called if SCIP is in one of the following stages:
24715  * - \ref SCIP_STAGE_PRESOLVING
24716  * - \ref SCIP_STAGE_SOLVING
24717  *
24718  * @note SCIP stage does not get changed
24719  */
24721  SCIP* scip, /**< SCIP data structure */
24722  SCIP_CONS* cons, /**< constraint that detected the conflict */
24723  SCIP_Bool* success /**< pointer to store whether a conflict constraint was created, or NULL */
24724  )
24725 {
24726  SCIP_CALL( checkStage(scip, "SCIPanalyzeConflictCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24727 
24728  if( SCIPconsIsGlobal(cons) )
24729  {
24730  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
24731  scip->transprob, scip->tree, 0, success) );
24732  }
24733  else if( SCIPconsIsActive(cons) )
24734  {
24735  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
24736  scip->transprob, scip->tree, SCIPconsGetValidDepth(cons), success) );
24737  }
24738 
24739  return SCIP_OKAY;
24740 }
24741 
24742 
24743 
24744 
24745 /*
24746  * constraint methods
24747  */
24748 
24749 /** creates and captures a constraint of the given constraint handler
24750  *
24751  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
24752  * be declared feasible even if it violates this particular constraint. This constellation should only be
24753  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
24754  * to the variable's local bounds.
24755  *
24756  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24757  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24758  *
24759  * @pre This method can be called if @p scip is in one of the following stages:
24760  * - \ref SCIP_STAGE_PROBLEM
24761  * - \ref SCIP_STAGE_TRANSFORMING
24762  * - \ref SCIP_STAGE_INITPRESOLVE
24763  * - \ref SCIP_STAGE_PRESOLVING
24764  * - \ref SCIP_STAGE_EXITPRESOLVE
24765  * - \ref SCIP_STAGE_PRESOLVED
24766  * - \ref SCIP_STAGE_INITSOLVE
24767  * - \ref SCIP_STAGE_SOLVING
24768  * - \ref SCIP_STAGE_EXITSOLVE
24769  *
24770  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
24771  */
24773  SCIP* scip, /**< SCIP data structure */
24774  SCIP_CONS** cons, /**< pointer to constraint */
24775  const char* name, /**< name of constraint */
24776  SCIP_CONSHDLR* conshdlr, /**< constraint handler for this constraint */
24777  SCIP_CONSDATA* consdata, /**< data for this specific constraint */
24778  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
24779  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
24780  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
24781  * Usually set to TRUE. */
24782  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
24783  * TRUE for model constraints, FALSE for additional, redundant constraints. */
24784  SCIP_Bool check, /**< should the constraint be checked for feasibility?
24785  * TRUE for model constraints, FALSE for additional, redundant constraints. */
24786  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
24787  * Usually set to TRUE. */
24788  SCIP_Bool local, /**< is constraint only valid locally?
24789  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
24790  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
24791  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
24792  * adds coefficients to this constraint. */
24793  SCIP_Bool dynamic, /**< is constraint subject to aging?
24794  * Usually set to FALSE. Set to TRUE for own cuts which
24795  * are separated as constraints. */
24796  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
24797  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
24798  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
24799  * if it may be moved to a more global node?
24800  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
24801  )
24802 {
24803  assert(cons != NULL);
24804  assert(name != NULL);
24805  assert(conshdlr != NULL);
24806 
24807  SCIP_CALL( checkStage(scip, "SCIPcreateCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
24808 
24809  switch( scip->set->stage )
24810  {
24811  case SCIP_STAGE_PROBLEM:
24812  SCIP_CALL( SCIPconsCreate(cons, scip->mem->probmem, scip->set, name, conshdlr, consdata,
24813  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, TRUE, TRUE) );
24814  return SCIP_OKAY;
24815 
24819  case SCIP_STAGE_PRESOLVING:
24821  case SCIP_STAGE_PRESOLVED:
24822  case SCIP_STAGE_INITSOLVE:
24823  case SCIP_STAGE_SOLVING:
24824  case SCIP_STAGE_EXITSOLVE:
24825  SCIP_CALL( SCIPconsCreate(cons, scip->mem->probmem, scip->set, name, conshdlr, consdata,
24826  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, FALSE, TRUE) );
24827  return SCIP_OKAY;
24828 
24829  default:
24830  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
24831  return SCIP_INVALIDCALL;
24832  } /*lint !e788*/
24833 }
24834 
24835 /** parses constraint information (in cip format) out of a string; if the parsing process was successful a constraint is
24836  * creates and captures;
24837  *
24838  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24839  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24840  *
24841  * @pre This method can be called if @p scip is in one of the following stages:
24842  * - \ref SCIP_STAGE_PROBLEM
24843  * - \ref SCIP_STAGE_TRANSFORMING
24844  * - \ref SCIP_STAGE_INITPRESOLVE
24845  * - \ref SCIP_STAGE_PRESOLVING
24846  * - \ref SCIP_STAGE_EXITPRESOLVE
24847  * - \ref SCIP_STAGE_PRESOLVED
24848  * - \ref SCIP_STAGE_SOLVING
24849  * - \ref SCIP_STAGE_EXITSOLVE
24850  *
24851  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
24852  * be declared feasible even if it violates this particular constraint. This constellation should only be
24853  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
24854  * to the variable's local bounds.
24855  */
24857  SCIP* scip, /**< SCIP data structure */
24858  SCIP_CONS** cons, /**< pointer to store constraint */
24859  const char* str, /**< string to parse for constraint */
24860  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
24861  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
24862  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
24863  * Usually set to TRUE. */
24864  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
24865  * TRUE for model constraints, FALSE for additional, redundant constraints. */
24866  SCIP_Bool check, /**< should the constraint be checked for feasibility?
24867  * TRUE for model constraints, FALSE for additional, redundant constraints. */
24868  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
24869  * Usually set to TRUE. */
24870  SCIP_Bool local, /**< is constraint only valid locally?
24871  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
24872  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
24873  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
24874  * adds coefficients to this constraint. */
24875  SCIP_Bool dynamic, /**< is constraint subject to aging?
24876  * Usually set to FALSE. Set to TRUE for own cuts which
24877  * are separated as constraints. */
24878  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
24879  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
24880  SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
24881  * if it may be moved to a more global node?
24882  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
24883  SCIP_Bool* success /**< pointer to store if the paring process was successful */
24884  )
24885 {
24886  assert(cons != NULL);
24887 
24888  SCIP_CALL( checkStage(scip, "SCIPparseCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
24889 
24890  SCIP_CALL( SCIPconsParse(cons, scip->set, scip->messagehdlr, str,
24891  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, success) );
24892 
24893 
24894  return SCIP_OKAY;
24895 }
24896 
24897 /** increases usage counter of constraint
24898  *
24899  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24900  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24901  *
24902  * @pre This method can be called if @p scip is in one of the following stages:
24903  * - \ref SCIP_STAGE_PROBLEM
24904  * - \ref SCIP_STAGE_TRANSFORMING
24905  * - \ref SCIP_STAGE_TRANSFORMED
24906  * - \ref SCIP_STAGE_INITPRESOLVE
24907  * - \ref SCIP_STAGE_PRESOLVING
24908  * - \ref SCIP_STAGE_EXITPRESOLVE
24909  * - \ref SCIP_STAGE_PRESOLVED
24910  * - \ref SCIP_STAGE_INITSOLVE
24911  * - \ref SCIP_STAGE_SOLVING
24912  * - \ref SCIP_STAGE_SOLVED
24913  */
24915  SCIP* scip, /**< SCIP data structure */
24916  SCIP_CONS* cons /**< constraint to capture */
24917  )
24918 {
24919  SCIP_CALL( checkStage(scip, "SCIPcaptureCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
24920 
24921  assert( cons->scip == scip );
24922 
24923  SCIPconsCapture(cons);
24924 
24925  return SCIP_OKAY;
24926 }
24927 
24928 /** decreases usage counter of constraint, if the usage pointer reaches zero the constraint gets freed
24929  *
24930  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24931  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24932  *
24933  * @pre This method can be called if @p scip is in one of the following stages:
24934  * - \ref SCIP_STAGE_PROBLEM
24935  * - \ref SCIP_STAGE_TRANSFORMING
24936  * - \ref SCIP_STAGE_TRANSFORMED
24937  * - \ref SCIP_STAGE_INITPRESOLVE
24938  * - \ref SCIP_STAGE_PRESOLVING
24939  * - \ref SCIP_STAGE_EXITPRESOLVE
24940  * - \ref SCIP_STAGE_PRESOLVED
24941  * - \ref SCIP_STAGE_INITSOLVE
24942  * - \ref SCIP_STAGE_SOLVING
24943  * - \ref SCIP_STAGE_SOLVED
24944  * - \ref SCIP_STAGE_EXITSOLVE
24945  * - \ref SCIP_STAGE_FREETRANS
24946  *
24947  * @note the pointer of the constraint will be NULLed
24948  */
24950  SCIP* scip, /**< SCIP data structure */
24951  SCIP_CONS** cons /**< pointer to constraint */
24952  )
24953 {
24954  assert(cons != NULL);
24955  assert(*cons != NULL);
24956 
24957  SCIP_CALL( checkStage(scip, "SCIPreleaseCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
24958 
24959  switch( scip->set->stage )
24960  {
24961  case SCIP_STAGE_PROBLEM:
24962  SCIP_CALL( SCIPconsRelease(cons, scip->mem->probmem, scip->set) );
24963  return SCIP_OKAY;
24964 
24968  case SCIP_STAGE_PRESOLVING:
24970  case SCIP_STAGE_PRESOLVED:
24971  case SCIP_STAGE_INITSOLVE:
24972  case SCIP_STAGE_SOLVING:
24973  case SCIP_STAGE_SOLVED:
24974  case SCIP_STAGE_EXITSOLVE:
24975  case SCIP_STAGE_FREETRANS:
24976  if( SCIPconsIsOriginal(*cons) && (*cons)->nuses == 1 )
24977  {
24978  SCIPerrorMessage("cannot release last use of original constraint while the transformed problem exists\n");
24979  return SCIP_INVALIDCALL;
24980  }
24981  SCIP_CALL( SCIPconsRelease(cons, scip->mem->probmem, scip->set) );
24982  return SCIP_OKAY;
24983 
24984  default:
24985  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
24986  return SCIP_INVALIDCALL;
24987  } /*lint !e788*/
24988 }
24989 
24990 /** change constraint name
24991  *
24992  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24993  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24994  *
24995  * @pre This method can be called if @p scip is in one of the following stages:
24996  * - \ref SCIP_STAGE_PROBLEM
24997  *
24998  * @note to get the current name of a constraint, use SCIPconsGetName() from pub_cons.h
24999  */
25001  SCIP* scip, /**< SCIP data structure */
25002  SCIP_CONS* cons, /**< constraint */
25003  const char* name /**< new name of constraint */
25004  )
25005 {
25006  SCIP_CALL( checkStage(scip, "SCIPchgConsName", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE , FALSE, FALSE, FALSE) );
25007 
25008  assert( cons->scip == scip );
25009 
25010  if( SCIPgetStage(scip) != SCIP_STAGE_PROBLEM )
25011  {
25012  SCIPerrorMessage("constraint names can only be changed in problem creation stage\n");
25013  SCIPABORT();
25014  return SCIP_INVALIDCALL; /*lint !e527*/
25015  }
25016 
25017  /* remove constraint's name from the namespace if the constraint was already added */
25018  if( SCIPconsIsAdded(cons) )
25019  {
25020  SCIP_CALL( SCIPprobRemoveConsName(scip->origprob, cons) );
25021  }
25022 
25023  /* change constraint name */
25024  SCIP_CALL( SCIPconsChgName(cons, SCIPblkmem(scip), name) );
25025 
25026  /* add constraint's name to the namespace if the constraint was already added */
25027  if( SCIPconsIsAdded(cons) )
25028  {
25029  SCIP_CALL( SCIPprobAddConsName(scip->origprob, cons) );
25030  }
25031 
25032  return SCIP_OKAY;
25033 }
25034 
25035 /** sets the initial flag of the given constraint
25036  *
25037  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25038  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25039  *
25040  * @pre This method can be called if @p scip is in one of the following stages:
25041  * - \ref SCIP_STAGE_PROBLEM
25042  * - \ref SCIP_STAGE_TRANSFORMING
25043  * - \ref SCIP_STAGE_PRESOLVING
25044  * - \ref SCIP_STAGE_PRESOLVED
25045  * - \ref SCIP_STAGE_SOLVING
25046  */
25048  SCIP* scip, /**< SCIP data structure */
25049  SCIP_CONS* cons, /**< constraint */
25050  SCIP_Bool initial /**< new value */
25051  )
25052 {
25053  SCIP_CALL( checkStage(scip, "SCIPsetConsInitial", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25054 
25055  SCIP_CALL( SCIPconsSetInitial(cons, scip->set, scip->stat, initial) );
25056 
25057  return SCIP_OKAY;
25058 }
25059 
25060 /** sets the separate flag of the given constraint
25061  *
25062  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25063  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25064  *
25065  * @pre This method can be called if @p scip is in one of the following stages:
25066  * - \ref SCIP_STAGE_PROBLEM
25067  * - \ref SCIP_STAGE_TRANSFORMING
25068  * - \ref SCIP_STAGE_PRESOLVING
25069  * - \ref SCIP_STAGE_PRESOLVED
25070  * - \ref SCIP_STAGE_SOLVING
25071  */
25073  SCIP* scip, /**< SCIP data structure */
25074  SCIP_CONS* cons, /**< constraint */
25075  SCIP_Bool separate /**< new value */
25076  )
25077 {
25078  SCIP_CALL( checkStage(scip, "SCIPsetConsSeparated", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25079 
25080  SCIP_CALL( SCIPconsSetSeparated(cons, scip->set, separate) );
25081 
25082  return SCIP_OKAY;
25083 }
25084 
25085 /** sets the enforce flag of the given constraint
25086  *
25087  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25088  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25089  *
25090  * @pre This method can be called if @p scip is in one of the following stages:
25091  * - \ref SCIP_STAGE_PROBLEM
25092  * - \ref SCIP_STAGE_TRANSFORMING
25093  * - \ref SCIP_STAGE_PRESOLVING
25094  * - \ref SCIP_STAGE_PRESOLVED
25095  * - \ref SCIP_STAGE_SOLVING
25096  */
25098  SCIP* scip, /**< SCIP data structure */
25099  SCIP_CONS* cons, /**< constraint */
25100  SCIP_Bool enforce /**< new value */
25101  )
25102 {
25103  SCIP_CALL( checkStage(scip, "SCIPsetConsEnforced", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25104 
25105  SCIP_CALL( SCIPconsSetEnforced(cons, scip->set, enforce) );
25106 
25107  return SCIP_OKAY;
25108 }
25109 
25110 /** sets the check flag of the given constraint
25111  *
25112  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25113  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25114  *
25115  * @pre This method can be called if @p scip is in one of the following stages:
25116  * - \ref SCIP_STAGE_PROBLEM
25117  * - \ref SCIP_STAGE_TRANSFORMING
25118  * - \ref SCIP_STAGE_PRESOLVING
25119  * - \ref SCIP_STAGE_PRESOLVED
25120  * - \ref SCIP_STAGE_SOLVING
25121  */
25123  SCIP* scip, /**< SCIP data structure */
25124  SCIP_CONS* cons, /**< constraint */
25125  SCIP_Bool check /**< new value */
25126  )
25127 {
25128  SCIP_CALL( checkStage(scip, "SCIPsetConsChecked", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25129 
25130  SCIP_CALL( SCIPconsSetChecked(cons, scip->set, check) );
25131 
25132  return SCIP_OKAY;
25133 }
25134 
25135 /** sets the propagate flag of the given constraint
25136  *
25137  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25138  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25139  *
25140  * @pre This method can be called if @p scip is in one of the following stages:
25141  * - \ref SCIP_STAGE_PROBLEM
25142  * - \ref SCIP_STAGE_TRANSFORMING
25143  * - \ref SCIP_STAGE_PRESOLVING
25144  * - \ref SCIP_STAGE_PRESOLVED
25145  * - \ref SCIP_STAGE_SOLVING
25146  */
25148  SCIP* scip, /**< SCIP data structure */
25149  SCIP_CONS* cons, /**< constraint */
25150  SCIP_Bool propagate /**< new value */
25151  )
25152 {
25153  SCIP_CALL( checkStage(scip, "SCIPsetConsPropagated", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25154 
25155  SCIP_CALL( SCIPconsSetPropagated(cons, scip->set, propagate) );
25156 
25157  return SCIP_OKAY;
25158 }
25159 
25160 /** sets the local flag of the given constraint
25161  *
25162  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25163  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25164  *
25165  * @pre This method can be called if @p scip is in one of the following stages:
25166  * - \ref SCIP_STAGE_PROBLEM
25167  * - \ref SCIP_STAGE_TRANSFORMING
25168  * - \ref SCIP_STAGE_INITPRESOLVE
25169  * - \ref SCIP_STAGE_PRESOLVING
25170  * - \ref SCIP_STAGE_PRESOLVED
25171  * - \ref SCIP_STAGE_INITSOLVE
25172  * - \ref SCIP_STAGE_SOLVING
25173  */
25175  SCIP* scip, /**< SCIP data structure */
25176  SCIP_CONS* cons, /**< constraint */
25177  SCIP_Bool local /**< new value */
25178  )
25179 {
25180  SCIP_CALL( checkStage(scip, "SCIPsetConsLocal", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25181 
25182  SCIPconsSetLocal(cons, local);
25183 
25184  return SCIP_OKAY;
25185 }
25186 
25187 /** sets the modifiable flag of the given constraint
25188  *
25189  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25190  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25191  *
25192  * @pre This method can be called if @p scip is in one of the following stages:
25193  * - \ref SCIP_STAGE_PROBLEM
25194  * - \ref SCIP_STAGE_TRANSFORMING
25195  * - \ref SCIP_STAGE_PRESOLVING
25196  * - \ref SCIP_STAGE_PRESOLVED
25197  * - \ref SCIP_STAGE_SOLVING
25198  * - \ref SCIP_STAGE_EXITSOLVE
25199  */
25201  SCIP* scip, /**< SCIP data structure */
25202  SCIP_CONS* cons, /**< constraint */
25203  SCIP_Bool modifiable /**< new value */
25204  )
25205 {
25206  SCIP_CALL( checkStage(scip, "SCIPsetConsModifiable", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
25207 
25208  SCIPconsSetModifiable(cons, modifiable);
25209 
25210  return SCIP_OKAY;
25211 }
25212 
25213 /** sets the dynamic flag of the given constraint
25214  *
25215  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25216  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25217  *
25218  * @pre This method can be called if @p scip is in one of the following stages:
25219  * - \ref SCIP_STAGE_PROBLEM
25220  * - \ref SCIP_STAGE_TRANSFORMING
25221  * - \ref SCIP_STAGE_PRESOLVING
25222  * - \ref SCIP_STAGE_PRESOLVED
25223  * - \ref SCIP_STAGE_SOLVING
25224  */
25226  SCIP* scip, /**< SCIP data structure */
25227  SCIP_CONS* cons, /**< constraint */
25228  SCIP_Bool dynamic /**< new value */
25229  )
25230 {
25231  SCIP_CALL( checkStage(scip, "SCIPsetConsDynamic", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25232 
25233  SCIPconsSetDynamic(cons, dynamic);
25234 
25235  return SCIP_OKAY;
25236 }
25237 
25238 /** sets the removable flag of the given constraint
25239  *
25240  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25241  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25242  *
25243  * @pre This method can be called if @p scip is in one of the following stages:
25244  * - \ref SCIP_STAGE_PROBLEM
25245  * - \ref SCIP_STAGE_TRANSFORMING
25246  * - \ref SCIP_STAGE_PRESOLVING
25247  * - \ref SCIP_STAGE_PRESOLVED
25248  * - \ref SCIP_STAGE_SOLVING
25249  */
25251  SCIP* scip, /**< SCIP data structure */
25252  SCIP_CONS* cons, /**< constraint */
25253  SCIP_Bool removable /**< new value */
25254  )
25255 {
25256  SCIP_CALL( checkStage(scip, "SCIPsetConsRemovable", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25257 
25258  SCIPconsSetRemovable(cons, removable);
25259 
25260  return SCIP_OKAY;
25261 }
25262 
25263 /** sets the stickingatnode flag of the given constraint
25264  *
25265  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25266  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25267  *
25268  * @pre This method can be called if @p scip is in one of the following stages:
25269  * - \ref SCIP_STAGE_PROBLEM
25270  * - \ref SCIP_STAGE_TRANSFORMING
25271  * - \ref SCIP_STAGE_PRESOLVING
25272  * - \ref SCIP_STAGE_PRESOLVED
25273  * - \ref SCIP_STAGE_SOLVING
25274  */
25276  SCIP* scip, /**< SCIP data structure */
25277  SCIP_CONS* cons, /**< constraint */
25278  SCIP_Bool stickingatnode /**< new value */
25279  )
25280 {
25281  SCIP_CALL( checkStage(scip, "SCIPsetConsStickingAtNode", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25282 
25283  SCIPconsSetStickingAtNode(cons, stickingatnode);
25284 
25285  return SCIP_OKAY;
25286 }
25287 
25288 /** updates the flags of the first constraint according to the ones of the second constraint
25289  *
25290  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25291  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25292  *
25293  * @pre This method can be called if @p scip is in one of the following stages:
25294  * - \ref SCIP_STAGE_PROBLEM
25295  * - \ref SCIP_STAGE_TRANSFORMING
25296  * - \ref SCIP_STAGE_PRESOLVING
25297  * - \ref SCIP_STAGE_PRESOLVED
25298  * - \ref SCIP_STAGE_SOLVING
25299  */
25301  SCIP* scip, /**< SCIP data structure */
25302  SCIP_CONS* cons0, /**< constraint that should stay */
25303  SCIP_CONS* cons1 /**< constraint that should be deleted */
25304  )
25305 {
25306  SCIP_CALL( checkStage(scip, "SCIPupdateConsFlags", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25307 
25308  if( SCIPconsIsInitial(cons1) )
25309  {
25310  SCIP_CALL( SCIPsetConsInitial(scip, cons0, TRUE) );
25311  }
25312  if( SCIPconsIsSeparated(cons1) )
25313  {
25314  SCIP_CALL( SCIPsetConsSeparated(scip, cons0, TRUE) );
25315  }
25316  if( SCIPconsIsEnforced(cons1) )
25317  {
25318  SCIP_CALL( SCIPsetConsEnforced(scip, cons0, TRUE) );
25319  }
25320  if( SCIPconsIsChecked(cons1) )
25321  {
25322  SCIP_CALL( SCIPsetConsChecked(scip, cons0, TRUE) );
25323  }
25324  if( SCIPconsIsPropagated(cons1) )
25325  {
25326  SCIP_CALL( SCIPsetConsPropagated(scip, cons0, TRUE) );
25327  }
25328  if( !SCIPconsIsDynamic(cons1) )
25329  {
25330  SCIP_CALL( SCIPsetConsDynamic(scip, cons0, FALSE) );
25331  }
25332  if( !SCIPconsIsRemovable(cons1) )
25333  {
25334  SCIP_CALL( SCIPsetConsRemovable(scip, cons0, FALSE) );
25335  }
25336  if( SCIPconsIsStickingAtNode(cons1) )
25337  {
25338  SCIP_CALL( SCIPsetConsStickingAtNode(scip, cons0, TRUE) );
25339  }
25340 
25341  return SCIP_OKAY;
25342 }
25343 
25344 /** gets and captures transformed constraint of a given constraint; if the constraint is not yet transformed,
25345  * a new transformed constraint for this constraint is created
25346  *
25347  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25348  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25349  *
25350  * @pre This method can be called if @p scip is in one of the following stages:
25351  * - \ref SCIP_STAGE_TRANSFORMING
25352  * - \ref SCIP_STAGE_TRANSFORMED
25353  * - \ref SCIP_STAGE_INITPRESOLVE
25354  * - \ref SCIP_STAGE_PRESOLVING
25355  * - \ref SCIP_STAGE_EXITPRESOLVE
25356  * - \ref SCIP_STAGE_PRESOLVED
25357  * - \ref SCIP_STAGE_INITSOLVE
25358  * - \ref SCIP_STAGE_SOLVING
25359  */
25361  SCIP* scip, /**< SCIP data structure */
25362  SCIP_CONS* cons, /**< constraint to get/create transformed constraint for */
25363  SCIP_CONS** transcons /**< pointer to store the transformed constraint */
25364  )
25365 {
25366  assert(transcons != NULL);
25367  assert(cons->scip == scip);
25368 
25369  SCIP_CALL( checkStage(scip, "SCIPtransformCons", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25370 
25371  if( SCIPconsIsTransformed(cons) )
25372  {
25373  *transcons = cons;
25374  SCIPconsCapture(*transcons);
25375  }
25376  else
25377  {
25378  SCIP_CALL( SCIPconsTransform(cons, scip->mem->probmem, scip->set, transcons) );
25379  }
25380 
25381  return SCIP_OKAY;
25382 }
25383 
25384 /** gets and captures transformed constraints for an array of constraints;
25385  * if a constraint in the array is not yet transformed, a new transformed constraint for this constraint is created;
25386  * it is possible to call this method with conss == transconss
25387  *
25388  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25389  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25390  *
25391  * @pre This method can be called if @p scip is in one of the following stages:
25392  * - \ref SCIP_STAGE_TRANSFORMING
25393  * - \ref SCIP_STAGE_TRANSFORMED
25394  * - \ref SCIP_STAGE_INITPRESOLVE
25395  * - \ref SCIP_STAGE_PRESOLVING
25396  * - \ref SCIP_STAGE_EXITPRESOLVE
25397  * - \ref SCIP_STAGE_PRESOLVED
25398  * - \ref SCIP_STAGE_INITSOLVE
25399  * - \ref SCIP_STAGE_SOLVING
25400  */
25402  SCIP* scip, /**< SCIP data structure */
25403  int nconss, /**< number of constraints to get/create transformed constraints for */
25404  SCIP_CONS** conss, /**< array with constraints to get/create transformed constraints for */
25405  SCIP_CONS** transconss /**< array to store the transformed constraints */
25406  )
25407 {
25408  int c;
25409 
25410  assert(nconss == 0 || conss != NULL);
25411  assert(nconss == 0 || transconss != NULL);
25412 
25413  SCIP_CALL( checkStage(scip, "SCIPtransformConss", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25414 
25415  for( c = 0; c < nconss; ++c )
25416  {
25417  if( SCIPconsIsTransformed(conss[c]) )
25418  {
25419  transconss[c] = conss[c];
25420  SCIPconsCapture(transconss[c]);
25421  }
25422  else
25423  {
25424  SCIP_CALL( SCIPconsTransform(conss[c], scip->mem->probmem, scip->set, &transconss[c]) );
25425  }
25426  }
25427 
25428  return SCIP_OKAY;
25429 }
25430 
25431 /** gets corresponding transformed constraint of a given constraint;
25432  * returns NULL as transcons, if transformed constraint is not yet existing
25433  *
25434  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25435  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25436  *
25437  * @pre This method can be called if @p scip is in one of the following stages:
25438  * - \ref SCIP_STAGE_TRANSFORMING
25439  * - \ref SCIP_STAGE_TRANSFORMED
25440  * - \ref SCIP_STAGE_INITPRESOLVE
25441  * - \ref SCIP_STAGE_PRESOLVING
25442  * - \ref SCIP_STAGE_EXITPRESOLVE
25443  * - \ref SCIP_STAGE_PRESOLVED
25444  * - \ref SCIP_STAGE_INITSOLVE
25445  * - \ref SCIP_STAGE_SOLVING
25446  * - \ref SCIP_STAGE_SOLVED
25447  * - \ref SCIP_STAGE_EXITSOLVE
25448  * - \ref SCIP_STAGE_FREETRANS
25449  */
25451  SCIP* scip, /**< SCIP data structure */
25452  SCIP_CONS* cons, /**< constraint to get the transformed constraint for */
25453  SCIP_CONS** transcons /**< pointer to store the transformed constraint */
25454  )
25455 {
25456  assert(transcons != NULL);
25457  assert(cons->scip == scip);
25458 
25459  SCIP_CALL( checkStage(scip, "SCIPgetTransformedCons", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
25460 
25461  if( SCIPconsIsTransformed(cons) )
25462  *transcons = cons;
25463  else
25464  *transcons = SCIPconsGetTransformed(cons);
25465 
25466  return SCIP_OKAY;
25467 }
25468 
25469 /** gets corresponding transformed constraints for an array of constraints;
25470  * stores NULL in a transconss slot, if the transformed constraint is not yet existing;
25471  * it is possible to call this method with conss == transconss, but remember that constraints that are not
25472  * yet transformed will be replaced with NULL
25473  *
25474  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25475  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25476  *
25477  * @pre This method can be called if @p scip is in one of the following stages:
25478  * - \ref SCIP_STAGE_TRANSFORMING
25479  * - \ref SCIP_STAGE_TRANSFORMED
25480  * - \ref SCIP_STAGE_INITPRESOLVE
25481  * - \ref SCIP_STAGE_PRESOLVING
25482  * - \ref SCIP_STAGE_EXITPRESOLVE
25483  * - \ref SCIP_STAGE_PRESOLVED
25484  * - \ref SCIP_STAGE_INITSOLVE
25485  * - \ref SCIP_STAGE_SOLVING
25486  * - \ref SCIP_STAGE_SOLVED
25487  * - \ref SCIP_STAGE_EXITSOLVE
25488  * - \ref SCIP_STAGE_FREETRANS
25489  */
25491  SCIP* scip, /**< SCIP data structure */
25492  int nconss, /**< number of constraints to get the transformed constraints for */
25493  SCIP_CONS** conss, /**< constraints to get the transformed constraints for */
25494  SCIP_CONS** transconss /**< array to store the transformed constraints */
25495  )
25496 {
25497  int c;
25498 
25499  assert(nconss == 0 || conss != NULL);
25500  assert(nconss == 0 || transconss != NULL);
25501 
25502  SCIP_CALL( checkStage(scip, "SCIPgetTransformedConss", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
25503 
25504  for( c = 0; c < nconss; ++c )
25505  {
25506  if( SCIPconsIsTransformed(conss[c]) )
25507  transconss[c] = conss[c];
25508  else
25509  transconss[c] = SCIPconsGetTransformed(conss[c]);
25510  }
25511 
25512  return SCIP_OKAY;
25513 }
25514 
25515 /** adds given value to age of constraint, but age can never become negative;
25516  * should be called
25517  * - in constraint separation, if no cut was found for this constraint,
25518  * - in constraint enforcing, if constraint was feasible, and
25519  * - in constraint propagation, if no domain reduction was deduced;
25520  *
25521  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25522  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25523  *
25524  * @pre This method can be called if @p scip is in one of the following stages:
25525  * - \ref SCIP_STAGE_TRANSFORMED
25526  * - \ref SCIP_STAGE_PRESOLVING
25527  * - \ref SCIP_STAGE_PRESOLVED
25528  * - \ref SCIP_STAGE_SOLVING
25529  * - \ref SCIP_STAGE_SOLVED
25530  */
25532  SCIP* scip, /**< SCIP data structure */
25533  SCIP_CONS* cons, /**< constraint */
25534  SCIP_Real deltaage /**< value to add to the constraint's age */
25535  )
25536 {
25537  SCIP_CALL( checkStage(scip, "SCIPaddConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25538 
25539  SCIP_CALL( SCIPconsAddAge(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, deltaage) );
25540 
25541  return SCIP_OKAY;
25542 }
25543 
25544 /** increases age of constraint by 1.0;
25545  * should be called
25546  * - in constraint separation, if no cut was found for this constraint,
25547  * - in constraint enforcing, if constraint was feasible, and
25548  * - in constraint propagation, if no domain reduction was deduced;
25549  *
25550  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25551  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25552  *
25553  * @pre This method can be called if @p scip is in one of the following stages:
25554  * - \ref SCIP_STAGE_TRANSFORMED
25555  * - \ref SCIP_STAGE_PRESOLVING
25556  * - \ref SCIP_STAGE_PRESOLVED
25557  * - \ref SCIP_STAGE_SOLVING
25558  * - \ref SCIP_STAGE_SOLVED
25559  */
25561  SCIP* scip, /**< SCIP data structure */
25562  SCIP_CONS* cons /**< constraint */
25563  )
25564 {
25565  SCIP_CALL( checkStage(scip, "SCIPincConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25566 
25567  SCIP_CALL( SCIPconsIncAge(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob) );
25568 
25569  return SCIP_OKAY;
25570 }
25571 
25572 /** resets age of constraint to zero;
25573  * should be called
25574  * - in constraint separation, if a cut was found for this constraint,
25575  * - in constraint enforcing, if the constraint was violated, and
25576  * - in constraint propagation, if a domain reduction was deduced;
25577  *
25578  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25579  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25580  *
25581  * @pre This method can be called if @p scip is in one of the following stages:
25582  * - \ref SCIP_STAGE_TRANSFORMED
25583  * - \ref SCIP_STAGE_PRESOLVING
25584  * - \ref SCIP_STAGE_PRESOLVED
25585  * - \ref SCIP_STAGE_SOLVING
25586  * - \ref SCIP_STAGE_SOLVED
25587  */
25589  SCIP* scip, /**< SCIP data structure */
25590  SCIP_CONS* cons /**< constraint */
25591  )
25592 {
25593  SCIP_CALL( checkStage(scip, "SCIPresetConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25594 
25595  SCIP_CALL( SCIPconsResetAge(cons, scip->set) );
25596 
25597  return SCIP_OKAY;
25598 }
25599 
25600 /** enables constraint's separation, propagation, and enforcing capabilities
25601  *
25602  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25603  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25604  *
25605  * @pre This method can be called if @p scip is in one of the following stages:
25606  * - \ref SCIP_STAGE_TRANSFORMED
25607  * - \ref SCIP_STAGE_PRESOLVING
25608  * - \ref SCIP_STAGE_PRESOLVED
25609  * - \ref SCIP_STAGE_INITSOLVE
25610  * - \ref SCIP_STAGE_SOLVING
25611  * - \ref SCIP_STAGE_SOLVED
25612  */
25614  SCIP* scip, /**< SCIP data structure */
25615  SCIP_CONS* cons /**< constraint */
25616  )
25617 {
25618  SCIP_CALL( checkStage(scip, "SCIPenableCons", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25619 
25620  SCIP_CALL( SCIPconsEnable(cons, scip->set, scip->stat) );
25621 
25622  return SCIP_OKAY;
25623 }
25624 
25625 /** disables constraint's separation, propagation, and enforcing capabilities, s.t. the constraint is not propagated,
25626  * separated, and enforced anymore until it is enabled again with a call to SCIPenableCons();
25627  * in contrast to SCIPdelConsLocal() and SCIPdelConsNode(), the disabling is not associated to a node in the tree and
25628  * does not consume memory; therefore, the constraint is neither automatically enabled on leaving the node nor
25629  * automatically disabled again on entering the node again;
25630  * note that the constraints enforcing capabilities are necessary for the solution's feasibility, if the constraint
25631  * is a model constraint; that means, you must be sure that the constraint cannot be violated in the current subtree,
25632  * and you have to enable it again manually by calling SCIPenableCons(), if this subtree is left (e.g. by using
25633  * an appropriate event handler that watches the corresponding variables' domain changes)
25634  *
25635  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25636  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25637  *
25638  * @pre This method can be called if @p scip is in one of the following stages:
25639  * - \ref SCIP_STAGE_TRANSFORMED
25640  * - \ref SCIP_STAGE_INITPRESOLVE
25641  * - \ref SCIP_STAGE_PRESOLVING
25642  * - \ref SCIP_STAGE_PRESOLVED
25643  * - \ref SCIP_STAGE_INITSOLVE
25644  * - \ref SCIP_STAGE_SOLVING
25645  * - \ref SCIP_STAGE_SOLVED
25646  */
25648  SCIP* scip, /**< SCIP data structure */
25649  SCIP_CONS* cons /**< constraint */
25650  )
25651 {
25652  SCIP_CALL( checkStage(scip, "SCIPdisableCons", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25653 
25654  SCIP_CALL( SCIPconsDisable(cons, scip->set, scip->stat) );
25655 
25656  return SCIP_OKAY;
25657 }
25658 
25659 /** enables constraint's separation capabilities
25660  *
25661  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25662  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25663  *
25664  * @pre This method can be called if @p scip is in one of the following stages:
25665  * - \ref SCIP_STAGE_TRANSFORMED
25666  * - \ref SCIP_STAGE_PRESOLVING
25667  * - \ref SCIP_STAGE_PRESOLVED
25668  * - \ref SCIP_STAGE_INITSOLVE
25669  * - \ref SCIP_STAGE_SOLVING
25670  * - \ref SCIP_STAGE_SOLVED
25671  */
25673  SCIP* scip, /**< SCIP data structure */
25674  SCIP_CONS* cons /**< constraint */
25675  )
25676 {
25677  SCIP_CALL( checkStage(scip, "SCIPenableConsSeparation", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25678 
25679  SCIP_CALL( SCIPconsEnableSeparation(cons, scip->set) );
25680 
25681  return SCIP_OKAY;
25682 }
25683 
25684 /** disables constraint's separation capabilities s.t. the constraint is not separated anymore until the separation
25685  * is enabled again with a call to SCIPenableConsSeparation(); in contrast to SCIPdelConsLocal() and SCIPdelConsNode(),
25686  * the disabling is not associated to a node in the tree and does not consume memory; therefore, the constraint
25687  * is neither automatically enabled on leaving the node nor automatically disabled again on entering the node again
25688  *
25689  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25690  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25691  *
25692  * @pre This method can be called if @p scip is in one of the following stages:
25693  * - \ref SCIP_STAGE_TRANSFORMED
25694  * - \ref SCIP_STAGE_PRESOLVING
25695  * - \ref SCIP_STAGE_PRESOLVED
25696  * - \ref SCIP_STAGE_INITSOLVE
25697  * - \ref SCIP_STAGE_SOLVING
25698  * - \ref SCIP_STAGE_SOLVED
25699  */
25701  SCIP* scip, /**< SCIP data structure */
25702  SCIP_CONS* cons /**< constraint */
25703  )
25704 {
25705  SCIP_CALL( checkStage(scip, "SCIPdisableConsSeparation", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25706 
25707  SCIP_CALL( SCIPconsDisableSeparation(cons, scip->set) );
25708 
25709  return SCIP_OKAY;
25710 }
25711 
25712 /** enables constraint's propagation capabilities
25713  *
25714  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25715  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25716  *
25717  * @pre This method can be called if @p scip is in one of the following stages:
25718  * - \ref SCIP_STAGE_TRANSFORMED
25719  * - \ref SCIP_STAGE_INITPRESOLVE
25720  * - \ref SCIP_STAGE_PRESOLVING
25721  * - \ref SCIP_STAGE_EXITPRESOLVE
25722  * - \ref SCIP_STAGE_PRESOLVED
25723  * - \ref SCIP_STAGE_INITSOLVE
25724  * - \ref SCIP_STAGE_SOLVING
25725  * - \ref SCIP_STAGE_SOLVED
25726  */
25728  SCIP* scip, /**< SCIP data structure */
25729  SCIP_CONS* cons /**< constraint */
25730  )
25731 {
25732  SCIP_CALL( checkStage(scip, "SCIPenableConsPropagation", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25733 
25734  SCIP_CALL( SCIPconsEnablePropagation(cons, scip->set) );
25735 
25736  return SCIP_OKAY;
25737 }
25738 
25739 /** disables constraint's propagation capabilities s.t. the constraint is not propagated anymore until the propagation
25740  * is enabled again with a call to SCIPenableConsPropagation(); in contrast to SCIPdelConsLocal() and SCIPdelConsNode(),
25741  * the disabling is not associated to a node in the tree and does not consume memory; therefore, the constraint
25742  * is neither automatically enabled on leaving the node nor automatically disabled again on entering the node again
25743  *
25744  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25745  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25746  *
25747  * @pre This method can be called if @p scip is in one of the following stages:
25748  * - \ref SCIP_STAGE_TRANSFORMED
25749  * - \ref SCIP_STAGE_INITPRESOLVE
25750  * - \ref SCIP_STAGE_PRESOLVING
25751  * - \ref SCIP_STAGE_EXITPRESOLVE
25752  * - \ref SCIP_STAGE_PRESOLVED
25753  * - \ref SCIP_STAGE_INITSOLVE
25754  * - \ref SCIP_STAGE_SOLVING
25755  * - \ref SCIP_STAGE_SOLVED
25756  */
25758  SCIP* scip, /**< SCIP data structure */
25759  SCIP_CONS* cons /**< constraint */
25760  )
25761 {
25762  SCIP_CALL( checkStage(scip, "SCIPdisableConsPropagation", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25763 
25764  SCIP_CALL( SCIPconsDisablePropagation(cons, scip->set) );
25765 
25766  return SCIP_OKAY;
25767 }
25768 
25769 /** marks constraint to be propagated
25770  *
25771  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25772  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25773  *
25774  * @pre This method can be called if @p scip is in one of the following stages:
25775  * - \ref SCIP_STAGE_TRANSFORMED
25776  * - \ref SCIP_STAGE_INITPRESOLVE
25777  * - \ref SCIP_STAGE_PRESOLVING
25778  * - \ref SCIP_STAGE_EXITPRESOLVE
25779  * - \ref SCIP_STAGE_PRESOLVED
25780  * - \ref SCIP_STAGE_INITSOLVE
25781  * - \ref SCIP_STAGE_SOLVING
25782  * - \ref SCIP_STAGE_SOLVED
25783  *
25784  * @note if a constraint is marked to be propagated, the age of the constraint will be ignored for propagation
25785  */
25787  SCIP* scip, /**< SCIP data structure */
25788  SCIP_CONS* cons /**< constraint */
25789  )
25790 {
25791  SCIP_CALL( checkStage(scip, "SCIPmarkConsPropagate", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25792 
25793  SCIP_CALL( SCIPconsMarkPropagate(cons, scip->set) );
25794 
25795  return SCIP_OKAY;
25796 }
25797 
25798 /** unmarks the constraint to be propagated
25799  *
25800  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25801  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25802  *
25803  * @pre This method can be called if @p scip is in one of the following stages:
25804  * - \ref SCIP_STAGE_TRANSFORMED
25805  * - \ref SCIP_STAGE_PRESOLVING
25806  * - \ref SCIP_STAGE_EXITPRESOLVE
25807  * - \ref SCIP_STAGE_PRESOLVED
25808  * - \ref SCIP_STAGE_INITSOLVE
25809  * - \ref SCIP_STAGE_SOLVING
25810  * - \ref SCIP_STAGE_SOLVED
25811  */
25813  SCIP* scip, /**< SCIP data structure */
25814  SCIP_CONS* cons /**< constraint */
25815  )
25816 {
25817  SCIP_CALL( checkStage(scip, "SCIPunmarkConsPropagate", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25818 
25819  SCIP_CALL( SCIPconsUnmarkPropagate(cons, scip->set) );
25820 
25821  return SCIP_OKAY;
25822 }
25823 
25824 /** adds given values to lock status of the constraint and updates the rounding locks of the involved variables
25825  *
25826  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25827  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25828  *
25829  * @pre This method can be called if @p scip is in one of the following stages:
25830  * - \ref SCIP_STAGE_PROBLEM
25831  * - \ref SCIP_STAGE_TRANSFORMING
25832  * - \ref SCIP_STAGE_INITPRESOLVE
25833  * - \ref SCIP_STAGE_PRESOLVING
25834  * - \ref SCIP_STAGE_EXITPRESOLVE
25835  * - \ref SCIP_STAGE_INITSOLVE
25836  * - \ref SCIP_STAGE_SOLVING
25837  * - \ref SCIP_STAGE_EXITSOLVE
25838  * - \ref SCIP_STAGE_FREETRANS
25839  */
25841  SCIP* scip, /**< SCIP data structure */
25842  SCIP_CONS* cons, /**< constraint */
25843  int nlockspos, /**< increase in number of rounding locks for constraint */
25844  int nlocksneg /**< increase in number of rounding locks for constraint's negation */
25845  )
25846 {
25847  SCIP_CALL( checkStage(scip, "SCIPaddConsLocks", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
25848 
25849  SCIP_CALL( SCIPconsAddLocks(cons, scip->set, nlockspos, nlocksneg) );
25850 
25851  return SCIP_OKAY;
25852 }
25853 
25854 /** checks single constraint for feasibility of the given solution
25855  *
25856  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25857  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25858  *
25859  * @pre This method can be called if @p scip is in one of the following stages:
25860  * - \ref SCIP_STAGE_PROBLEM
25861  * - \ref SCIP_STAGE_TRANSFORMED
25862  * - \ref SCIP_STAGE_INITPRESOLVE
25863  * - \ref SCIP_STAGE_PRESOLVING
25864  * - \ref SCIP_STAGE_EXITPRESOLVE
25865  * - \ref SCIP_STAGE_PRESOLVED
25866  * - \ref SCIP_STAGE_INITSOLVE
25867  * - \ref SCIP_STAGE_SOLVING
25868  * - \ref SCIP_STAGE_SOLVED
25869  */
25871  SCIP* scip, /**< SCIP data structure */
25872  SCIP_CONS* cons, /**< constraint to check */
25873  SCIP_SOL* sol, /**< primal CIP solution */
25874  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
25875  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
25876  SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
25877  SCIP_RESULT* result /**< pointer to store the result of the callback method */
25878  )
25879 {
25880  SCIP_CALL( checkStage(scip, "SCIPcheckCons", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25881 
25882  SCIP_CALL( SCIPconsCheck(cons, scip->set, sol, checkintegrality, checklprows, printreason, result) );
25883 
25884  return SCIP_OKAY;
25885 }
25886 
25887 /** enforces single constraint for a given pseudo solution
25888  *
25889  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25890  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25891  *
25892  * @pre This method can be called if @p scip is in one of the following stages:
25893  * - \ref SCIP_STAGE_SOLVING
25894  *
25895  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
25896  * added to SCIP beforehand.
25897  */
25899  SCIP* scip, /**< SCIP data structure */
25900  SCIP_CONS* cons, /**< constraint to enforce */
25901  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
25902  SCIP_Bool objinfeasible, /**< is the solution infeasible anyway due to violating lower objective bound? */
25903  SCIP_RESULT* result /**< pointer to store the result of the callback method */
25904  )
25905 {
25906  assert(scip != NULL);
25907  assert(cons != NULL);
25908  assert(!SCIPconsIsAdded(cons));
25909  assert(result != NULL);
25910 
25911  SCIP_CALL( checkStage(scip, "SCIPenfopsCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25912 
25913  SCIP_CALL( SCIPconsEnfops(cons, scip->set, solinfeasible, objinfeasible, result) );
25914 
25915  return SCIP_OKAY;
25916 }
25917 
25918 /** enforces single constraint for a given LP solution
25919  *
25920  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25921  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25922  *
25923  * @pre This method can be called if @p scip is in one of the following stages:
25924  * - \ref SCIP_STAGE_SOLVING
25925  *
25926  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
25927  * added to SCIP beforehand.
25928  */
25930  SCIP* scip, /**< SCIP data structure */
25931  SCIP_CONS* cons, /**< constraint to enforce */
25932  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
25933  SCIP_RESULT* result /**< pointer to store the result of the callback method */
25934  )
25935 {
25936  assert(scip != NULL);
25937  assert(cons != NULL);
25938  assert(!SCIPconsIsAdded(cons));
25939  assert(result != NULL);
25940 
25941  SCIP_CALL( checkStage(scip, "SCIPenfolpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25942 
25943  SCIP_CALL( SCIPconsEnfolp(cons, scip->set, solinfeasible, result) );
25944 
25945  return SCIP_OKAY;
25946 }
25947 
25948 /** calls LP initialization method for single constraint
25949  *
25950  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25951  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25952  *
25953  * @pre This method can be called if @p scip is in one of the following stages:
25954  * - \ref SCIP_STAGE_SOLVING
25955  *
25956  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
25957  * added to SCIP beforehand.
25958  */
25960  SCIP* scip, /**< SCIP data structure */
25961  SCIP_CONS* cons /**< constraint to initialize */
25962  )
25963 {
25964  assert(scip != NULL);
25965  assert(cons != NULL);
25966  assert(!SCIPconsIsAdded(cons));
25967 
25968  SCIP_CALL( checkStage(scip, "SCIPinitlpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25969 
25970  SCIP_CALL( SCIPconsInitlp(cons, scip->set) );
25971 
25972  return SCIP_OKAY;
25973 }
25974 
25975 /** calls separation method of single constraint for LP solution
25976  *
25977  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25978  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25979  *
25980  * @pre This method can be called if @p scip is in one of the following stages:
25981  * - \ref SCIP_STAGE_SOLVING
25982  *
25983  * @note This is an advanced method and should be used with caution.
25984  */
25986  SCIP* scip, /**< SCIP data structure */
25987  SCIP_CONS* cons, /**< constraint to separate */
25988  SCIP_RESULT* result /**< pointer to store the result of the separation call */
25989  )
25990 {
25991  assert(scip != NULL);
25992  assert(cons != NULL);
25993  assert(result != NULL);
25994 
25995  SCIP_CALL( checkStage(scip, "SCIPsepalpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25996 
25997  SCIP_CALL( SCIPconsSepalp(cons, scip->set, result) );
25998 
25999  return SCIP_OKAY;
26000 }
26001 
26002 /** calls separation method of single constraint for given primal solution
26003  *
26004  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26005  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26006  *
26007  * @pre This method can be called if @p scip is in one of the following stages:
26008  * - \ref SCIP_STAGE_SOLVING
26009  *
26010  * @note This is an advanced method and should be used with caution.
26011  */
26013  SCIP* scip, /**< SCIP data structure */
26014  SCIP_CONS* cons, /**< constraint to separate */
26015  SCIP_SOL* sol, /**< primal solution that should be separated*/
26016  SCIP_RESULT* result /**< pointer to store the result of the separation call */
26017  )
26018 {
26019  assert(scip != NULL);
26020  assert(cons != NULL);
26021  assert(sol != NULL);
26022  assert(result != NULL);
26023 
26024  SCIP_CALL( checkStage(scip, "SCIPsepasolCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26025 
26026  SCIP_CALL( SCIPconsSepasol(cons, scip->set, sol, result) );
26027 
26028  return SCIP_OKAY;
26029 }
26030 
26031 /** calls domain propagation method of single constraint
26032  *
26033  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26034  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26035  *
26036  * @pre This method can be called if @p scip is in one of the following stages:
26037  * - \ref SCIP_STAGE_PRESOLVING
26038  * - \ref SCIP_STAGE_SOLVING
26039  *
26040  * @note This is an advanced method and should be used with caution.
26041  */
26043  SCIP* scip, /**< SCIP data structure */
26044  SCIP_CONS* cons, /**< constraint to propagate */
26045  SCIP_PROPTIMING proptiming, /**< current point in the node solving loop */
26046  SCIP_RESULT* result /**< pointer to store the result of the callback method */
26047  )
26048 {
26049  assert(scip != NULL);
26050  assert(cons != NULL);
26051  assert(result != NULL);
26052 
26053  SCIP_CALL( checkStage(scip, "SCIPpropCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26054 
26055  SCIP_CALL( SCIPconsProp(cons, scip->set, proptiming, result) );
26056 
26057  return SCIP_OKAY;
26058 }
26059 
26060 /** resolves propagation conflict of single constraint
26061  *
26062  *
26063  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26064  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26065  *
26066  * @pre This method can be called if @p scip is in one of the following stages:
26067  * - \ref SCIP_STAGE_PRESOLVING
26068  * - \ref SCIP_STAGE_SOLVING
26069  *
26070  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
26071  * added to SCIP beforehand.
26072  */
26074  SCIP* scip, /**< SCIP data structure */
26075  SCIP_CONS* cons, /**< constraint to resolve conflict for */
26076  SCIP_VAR* infervar, /**< the conflict variable whose bound change has to be resolved */
26077  int inferinfo, /**< the user information passed to the corresponding SCIPinferVarLbCons() or SCIPinferVarUbCons() call */
26078  SCIP_BOUNDTYPE boundtype, /**< the type of the changed bound (lower or upper bound) */
26079  SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
26080  SCIP_Real relaxedbd, /**< the relaxed bound which is sufficient to be explained */
26081  SCIP_RESULT* result /**< pointer to store the result of the callback method */
26082  )
26083 {
26084  assert(scip != NULL);
26085  assert(cons != NULL);
26086  assert(!SCIPconsIsAdded(cons));
26087  assert(infervar != NULL);
26088  assert(bdchgidx != NULL);
26089  assert(result != NULL);
26090 
26091  SCIP_CALL( checkStage(scip, "SCIPrespropCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26092 
26093  SCIP_CALL( SCIPconsResprop(cons, scip->set, infervar, inferinfo, boundtype, bdchgidx, relaxedbd, result) );
26094 
26095  return SCIP_OKAY;
26096 }
26097 
26098 /** presolves of single constraint
26099  *
26100  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26101  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26102  *
26103  * @pre This method can be called if @p scip is in one of the following stages:
26104  * - \ref SCIP_STAGE_PRESOLVING
26105  *
26106  * @note This is an advanced method and should be used with caution.
26107  */
26109  SCIP* scip, /**< SCIP data structure */
26110  SCIP_CONS* cons, /**< constraint to presolve */
26111  int nrounds, /**< number of presolving rounds already done */
26112  SCIP_PRESOLTIMING presoltiming, /**< presolving timing(s) to be performed */
26113  int nnewfixedvars, /**< number of variables fixed since the last call to the presolving method */
26114  int nnewaggrvars, /**< number of variables aggregated since the last call to the presolving method */
26115  int nnewchgvartypes, /**< number of variable type changes since the last call to the presolving method */
26116  int nnewchgbds, /**< number of variable bounds tightened since the last call to the presolving method */
26117  int nnewholes, /**< number of domain holes added since the last call to the presolving method */
26118  int nnewdelconss, /**< number of deleted constraints since the last call to the presolving method */
26119  int nnewaddconss, /**< number of added constraints since the last call to the presolving method */
26120  int nnewupgdconss, /**< number of upgraded constraints since the last call to the presolving method */
26121  int nnewchgcoefs, /**< number of changed coefficients since the last call to the presolving method */
26122  int nnewchgsides, /**< number of changed left or right hand sides since the last call to the presolving method */
26123  int* nfixedvars, /**< pointer to count total number of variables fixed of all presolvers */
26124  int* naggrvars, /**< pointer to count total number of variables aggregated of all presolvers */
26125  int* nchgvartypes, /**< pointer to count total number of variable type changes of all presolvers */
26126  int* nchgbds, /**< pointer to count total number of variable bounds tightened of all presolvers */
26127  int* naddholes, /**< pointer to count total number of domain holes added of all presolvers */
26128  int* ndelconss, /**< pointer to count total number of deleted constraints of all presolvers */
26129  int* naddconss, /**< pointer to count total number of added constraints of all presolvers */
26130  int* nupgdconss, /**< pointer to count total number of upgraded constraints of all presolvers */
26131  int* nchgcoefs, /**< pointer to count total number of changed coefficients of all presolvers */
26132  int* nchgsides, /**< pointer to count total number of changed left/right hand sides of all presolvers */
26133  SCIP_RESULT* result /**< pointer to store the result of the callback method */
26134  )
26135 {
26136  assert(scip != NULL);
26137  assert(cons != NULL);
26138  assert(nfixedvars != NULL);
26139  assert(naggrvars != NULL);
26140  assert(nchgvartypes != NULL);
26141  assert(nchgbds != NULL);
26142  assert(naddholes != NULL);
26143  assert(ndelconss != NULL);
26144  assert(naddconss != NULL);
26145  assert(nupgdconss != NULL);
26146  assert(nchgcoefs != NULL);
26147  assert(nchgsides != NULL);
26148  assert(result != NULL);
26149 
26150  SCIP_CALL( checkStage(scip, "SCIPpresolCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
26151 
26152  SCIP_CALL( SCIPconsPresol(cons, scip->set, nrounds, presoltiming, nnewfixedvars, nnewaggrvars, nnewchgvartypes, nnewchgbds, nnewholes,
26153  nnewdelconss, nnewaddconss, nnewupgdconss, nnewchgcoefs, nnewchgsides, nfixedvars, naggrvars, nchgvartypes,
26154  nchgbds, naddholes, ndelconss, naddconss, nupgdconss, nchgcoefs, nchgsides , result) );
26155 
26156  return SCIP_OKAY;
26157 }
26158 
26159 /** calls constraint activation notification method of single constraint
26160  *
26161  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26162  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26163  *
26164  * @pre This method can be called if @p scip is in one of the following stages:
26165  * - \ref SCIP_STAGE_TRANSFORMING
26166  *
26167  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
26168  * added to SCIP beforehand.
26169  */
26171  SCIP* scip, /**< SCIP data structure */
26172  SCIP_CONS* cons /**< constraint to notify */
26173  )
26174 {
26175  assert(scip != NULL);
26176  assert(cons != NULL);
26177  assert(!SCIPconsIsAdded(cons));
26178 
26179  SCIP_CALL( checkStage(scip, "SCIPactiveCons", FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
26180 
26181  SCIP_CALL( SCIPconsActive(cons, scip->set) );
26182 
26183  return SCIP_OKAY;
26184 }
26185 
26186 /** calls constraint deactivation notification method of single constraint
26187  *
26188  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26189  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26190  *
26191  * @pre This method can be called if @p scip is in one of the following stages:
26192  * - \ref SCIP_STAGE_PRESOLVING
26193  * - \ref SCIP_STAGE_SOLVING
26194  *
26195  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
26196  * added to SCIP beforehand.
26197  */
26199  SCIP* scip, /**< SCIP data structure */
26200  SCIP_CONS* cons /**< constraint to notify */
26201  )
26202 {
26203  assert(scip != NULL);
26204  assert(cons != NULL);
26205  assert(!SCIPconsIsAdded(cons));
26206 
26207  SCIP_CALL( checkStage(scip, "SCIPdeactiveCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26208 
26209  SCIP_CALL( SCIPconsDeactive(cons, scip->set) );
26210 
26211  return SCIP_OKAY;
26212 }
26213 
26214 /** outputs constraint information to file stream via the message handler system
26215  *
26216  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26217  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26218  *
26219  * @pre This method can be called if @p scip is in one of the following stages:
26220  * - \ref SCIP_STAGE_PROBLEM
26221  * - \ref SCIP_STAGE_TRANSFORMING
26222  * - \ref SCIP_STAGE_TRANSFORMED
26223  * - \ref SCIP_STAGE_INITPRESOLVE
26224  * - \ref SCIP_STAGE_PRESOLVING
26225  * - \ref SCIP_STAGE_EXITPRESOLVE
26226  * - \ref SCIP_STAGE_PRESOLVED
26227  * - \ref SCIP_STAGE_INITSOLVE
26228  * - \ref SCIP_STAGE_SOLVING
26229  * - \ref SCIP_STAGE_SOLVED
26230  * - \ref SCIP_STAGE_EXITSOLVE
26231  * - \ref SCIP_STAGE_FREETRANS
26232  *
26233  * @note If the message handler is set to a NULL pointer nothing will be printed.
26234  * @note The file stream will not be flushed directly, this can be achieved by calling SCIPinfoMessage() printing a
26235  * newline character.
26236  */
26238  SCIP* scip, /**< SCIP data structure */
26239  SCIP_CONS* cons, /**< constraint */
26240  FILE* file /**< output file (or NULL for standard output) */
26241  )
26242 {
26243  SCIP_CALL( checkStage(scip, "SCIPprintCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
26244 
26245  SCIP_CALL( SCIPconsPrint(cons, scip->set, scip->messagehdlr, file) );
26246 
26247  return SCIP_OKAY;
26248 }
26249 
26250 /** method to collect the variables of a constraint
26251  *
26252  * If the number of variables is greater than the available slots in the variable array, nothing happens except that
26253  * the success point is set to FALSE. With the method SCIPgetConsNVars() it is possible to get the number of variables
26254  * a constraint has in its scope.
26255  *
26256  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26257  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26258  *
26259  * @pre This method can be called if @p scip is in one of the following stages:
26260  * - \ref SCIP_STAGE_PROBLEM
26261  * - \ref SCIP_STAGE_TRANSFORMING
26262  * - \ref SCIP_STAGE_TRANSFORMED
26263  * - \ref SCIP_STAGE_INITPRESOLVE
26264  * - \ref SCIP_STAGE_PRESOLVING
26265  * - \ref SCIP_STAGE_EXITPRESOLVE
26266  * - \ref SCIP_STAGE_PRESOLVED
26267  * - \ref SCIP_STAGE_INITSOLVE
26268  * - \ref SCIP_STAGE_SOLVING
26269  * - \ref SCIP_STAGE_SOLVED
26270  * - \ref SCIP_STAGE_EXITSOLVE
26271  * - \ref SCIP_STAGE_FREETRANS
26272  *
26273  * @note The success pointer indicates if all variables were copied into the vars arrray.
26274  *
26275  * @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
26276  * set to FALSE.
26277  */
26279  SCIP* scip, /**< SCIP data structure */
26280  SCIP_CONS* cons, /**< constraint for which the variables are wanted */
26281  SCIP_VAR** vars, /**< array to store the involved variable of the constraint */
26282  int varssize, /**< available slots in vars array which is needed to check if the array is large enough */
26283  SCIP_Bool* success /**< pointer to store whether the variables are successfully copied */
26284  )
26285 {
26286  SCIP_CALL( checkStage(scip, "SCIPgetConsVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
26287 
26288  assert(scip != NULL);
26289  assert(cons != NULL);
26290  assert(vars != NULL);
26291  assert(success != NULL);
26292 
26293  SCIP_CALL( SCIPconsGetVars(cons, scip->set, vars, varssize, success) );
26294 
26295  return SCIP_OKAY;
26296 }
26297 
26298 /** method to collect the number of variables of a constraint
26299  *
26300  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26301  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26302  *
26303  * @pre This method can be called if @p scip is in one of the following stages:
26304  * - \ref SCIP_STAGE_PROBLEM
26305  * - \ref SCIP_STAGE_TRANSFORMING
26306  * - \ref SCIP_STAGE_TRANSFORMED
26307  * - \ref SCIP_STAGE_INITPRESOLVE
26308  * - \ref SCIP_STAGE_PRESOLVING
26309  * - \ref SCIP_STAGE_EXITPRESOLVE
26310  * - \ref SCIP_STAGE_PRESOLVED
26311  * - \ref SCIP_STAGE_INITSOLVE
26312  * - \ref SCIP_STAGE_SOLVING
26313  * - \ref SCIP_STAGE_SOLVED
26314  * - \ref SCIP_STAGE_EXITSOLVE
26315  * - \ref SCIP_STAGE_FREETRANS
26316  *
26317  * @note The success pointer indicates if the contraint handler was able to return the number of variables
26318  *
26319  * @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
26320  * set to FALSE
26321  */
26323  SCIP* scip, /**< SCIP data structure */
26324  SCIP_CONS* cons, /**< constraint for which the number of variables is wanted */
26325  int* nvars, /**< pointer to store the number of variables */
26326  SCIP_Bool* success /**< pointer to store whether the constraint successfully returned the number of variables */
26327  )
26328 {
26329  SCIP_CALL( checkStage(scip, "SCIPgetConsNVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
26330 
26331  assert(scip != NULL);
26332  assert(cons != NULL);
26333  assert(nvars != NULL);
26334  assert(success != NULL);
26335 
26336  SCIP_CALL( SCIPconsGetNVars(cons, scip->set, nvars, success) );
26337 
26338  return SCIP_OKAY;
26339 }
26340 
26341 /*
26342  * LP methods
26343  */
26344 
26345 /** returns, whether the LP was or is to be solved in the current node
26346  *
26347  * @return whether the LP was or is to be solved in the current node.
26348  *
26349  * @pre This method can be called if @p scip is in one of the following stages:
26350  * - \ref SCIP_STAGE_SOLVING
26351  *
26352  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26353  */
26355  SCIP* scip /**< SCIP data structure */
26356  )
26357 {
26358  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasCurrentNodeLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26359 
26360  return SCIPtreeHasCurrentNodeLP(scip->tree);
26361 }
26362 
26363 /** returns, whether the LP of the current node is already constructed
26364  *
26365  * @return whether the LP of the current node is already constructed.
26366  *
26367  * @pre This method can be called if @p scip is in one of the following stages:
26368  * - \ref SCIP_STAGE_SOLVING
26369  *
26370  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26371  */
26373  SCIP* scip /**< SCIP data structure */
26374  )
26375 {
26376  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPConstructed", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26377 
26378  return SCIPtreeIsFocusNodeLPConstructed(scip->tree);
26379 }
26380 
26381 /** makes sure that the LP of the current node is loaded and may be accessed through the LP information methods
26382  *
26383  * @warning Contructing the LP might change the amount of variables known in the transformed problem and therefore also
26384  * the variables array of SCIP (returned by SCIPgetVars() and SCIPgetVarsData()), so it might be necessary to
26385  * call one of the later method after this one
26386  *
26387  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26388  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26389  *
26390  * @pre This method can be called if @p scip is in one of the following stages:
26391  * - \ref SCIP_STAGE_SOLVING
26392  *
26393  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26394  */
26396  SCIP* scip, /**< SCIP data structure */
26397  SCIP_Bool* cutoff /**< pointer to store whether the node can be cut off */
26398  )
26399 {
26400  SCIP_CALL( checkStage(scip, "SCIPconstructLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26401 
26402  SCIP_CALL( SCIPconstructCurrentLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
26403  scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->branchcand, scip->eventqueue, scip->eventfilter,
26404  scip->cliquetable, FALSE, cutoff) );
26405 
26406  return SCIP_OKAY;
26407 }
26408 
26409 /** makes sure that the LP of the current node is flushed
26410  *
26411  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26412  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26413  *
26414  * @pre This method can be called if @p scip is in one of the following stages:
26415  * - \ref SCIP_STAGE_SOLVING
26416  *
26417  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26418  */
26420  SCIP* scip /**< SCIP data structure */
26421  )
26422 {
26423  SCIP_CALL( checkStage(scip, "SCIPflushLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26424 
26425  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
26426 
26427  return SCIP_OKAY;
26428 }
26429 
26430 /** gets solution status of current LP
26431  *
26432  * @return the solution status of current LP.
26433  *
26434  * @pre This method can be called if @p scip is in one of the following stages:
26435  * - \ref SCIP_STAGE_SOLVING
26436  *
26437  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26438  */
26440  SCIP* scip /**< SCIP data structure */
26441  )
26442 {
26443  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPSolstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26444 
26446  return SCIPlpGetSolstat(scip->lp);
26447  else
26448  return SCIP_LPSOLSTAT_NOTSOLVED;
26449 }
26450 
26451 /** returns whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound
26452  *
26453  * @return whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound.
26454  *
26455  * @pre This method can be called if @p scip is in one of the following stages:
26456  * - \ref SCIP_STAGE_SOLVING
26457  *
26458  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26459  */
26461  SCIP* scip /**< SCIP data structure */
26462  )
26463 {
26464  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26465 
26466  return SCIPlpIsRelax(scip->lp);
26467 }
26468 
26469 /** gets objective value of current LP (which is the sum of column and loose objective value)
26470  *
26471  * @return the objective value of current LP (which is the sum of column and loose objective value).
26472  *
26473  * @pre This method can be called if @p scip is in one of the following stages:
26474  * - \ref SCIP_STAGE_SOLVING
26475  *
26476  * @note This method returns the objective value of the current LP solution, which might be primal or dual infeasible
26477  * if a limit was hit during solving. It must not be used as a dual bound if the LP solution status returned by
26478  * SCIPgetLPSolstat() is SCIP_LPSOLSTAT_ITERLIMIT or SCIP_LPSOLSTAT_TIMELIMIT.
26479  *
26480  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26481  */
26483  SCIP* scip /**< SCIP data structure */
26484  )
26485 {
26486  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26487 
26488  return SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
26489 }
26490 
26491 /** gets part of objective value of current LP that results from COLUMN variables only
26492  *
26493  * @return the part of objective value of current LP that results from COLUMN variables only.
26494  *
26495  * @pre This method can be called if @p scip is in one of the following stages:
26496  * - \ref SCIP_STAGE_SOLVING
26497  *
26498  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26499  */
26501  SCIP* scip /**< SCIP data structure */
26502  )
26503 {
26504  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPColumnObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26505 
26506  return SCIPlpGetColumnObjval(scip->lp);
26507 }
26508 
26509 /** gets part of objective value of current LP that results from LOOSE variables only
26510  *
26511  * @return part of objective value of current LP that results from LOOSE variables only.
26512  *
26513  * @pre This method can be called if @p scip is in one of the following stages:
26514  * - \ref SCIP_STAGE_SOLVING
26515  *
26516  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26517  */
26519  SCIP* scip /**< SCIP data structure */
26520  )
26521 {
26522  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPLooseObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26523 
26524  return SCIPlpGetLooseObjval(scip->lp, scip->set, scip->transprob);
26525 }
26526 
26527 /** gets the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
26528  * function) global bound
26529  *
26530  * @return the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
26531  * function) global bound.
26532  *
26533  * @pre This method can be called if @p scip is in one of the following stages:
26534  * - \ref SCIP_STAGE_INITPRESOLVE
26535  * - \ref SCIP_STAGE_PRESOLVING
26536  * - \ref SCIP_STAGE_EXITPRESOLVE
26537  * - \ref SCIP_STAGE_PRESOLVED
26538  * - \ref SCIP_STAGE_INITSOLVE
26539  * - \ref SCIP_STAGE_SOLVING
26540  *
26541  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26542  */
26544  SCIP* scip /**< SCIP data structure */
26545  )
26546 {
26547  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGlobalPseudoObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26548 
26549  return SCIPlpGetGlobalPseudoObjval(scip->lp, scip->set, scip->transprob);
26550 }
26551 
26552 /** gets the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
26553  * objective function) local bound
26554  *
26555  * @return the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
26556  * objective function) local bound.
26557  *
26558  * @pre This method can be called if @p scip is in one of the following stages:
26559  * - \ref SCIP_STAGE_INITPRESOLVE
26560  * - \ref SCIP_STAGE_PRESOLVING
26561  * - \ref SCIP_STAGE_EXITPRESOLVE
26562  * - \ref SCIP_STAGE_PRESOLVED
26563  * - \ref SCIP_STAGE_INITSOLVE
26564  * - \ref SCIP_STAGE_SOLVING
26565  *
26566  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26567  */
26569  SCIP* scip /**< SCIP data structure */
26570  )
26571 {
26572  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPseudoObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26573 
26574  return SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob);
26575 }
26576 
26577 /** returns whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound
26578  *
26579  * @return whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound.
26580  *
26581  * @pre This method can be called if @p scip is in one of the following stages:
26582  * - \ref SCIP_STAGE_SOLVING
26583  *
26584  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26585  */
26587  SCIP* scip /**< SCIP data structure */
26588  )
26589 {
26590  SCIP_CALL_ABORT( checkStage(scip, "SCIPisRootLPRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26591 
26592  return SCIPlpIsRootLPRelax(scip->lp);
26593 }
26594 
26595 /** gets the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved
26596  *
26597  * @return the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved.
26598  *
26599  * @pre This method can be called if @p scip is in one of the following stages:
26600  * - \ref SCIP_STAGE_INITPRESOLVE
26601  * - \ref SCIP_STAGE_PRESOLVING
26602  * - \ref SCIP_STAGE_EXITPRESOLVE
26603  * - \ref SCIP_STAGE_SOLVING
26604  *
26605  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26606  */
26608  SCIP* scip /**< SCIP data structure */
26609  )
26610 {
26611  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26612 
26613  return SCIPlpGetRootObjval(scip->lp);
26614 }
26615 
26616 /** gets part of the objective value of the root node LP that results from COLUMN variables only;
26617  * returns SCIP_INVALID if the root node LP was not (yet) solved
26618  *
26619  * @return the part of the objective value of the root node LP that results from COLUMN variables only;
26620  * or SCIP_INVALID if the root node LP was not (yet) solved.
26621  *
26622  * @pre This method can be called if @p scip is in one of the following stages:
26623  * - \ref SCIP_STAGE_INITPRESOLVE
26624  * - \ref SCIP_STAGE_PRESOLVING
26625  * - \ref SCIP_STAGE_EXITPRESOLVE
26626  * - \ref SCIP_STAGE_SOLVING
26627  *
26628  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26629  */
26631  SCIP* scip /**< SCIP data structure */
26632  )
26633 {
26634  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootColumnObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26635 
26636  return SCIPlpGetRootColumnObjval(scip->lp);
26637 }
26638 
26639 /** gets part of the objective value of the root node LP that results from LOOSE variables only;
26640  * returns SCIP_INVALID if the root node LP was not (yet) solved
26641  *
26642  * @return the part of the objective value of the root node LP that results from LOOSE variables only;
26643  * or SCIP_INVALID if the root node LP was not (yet) solved.
26644  *
26645  * @pre This method can be called if @p scip is in one of the following stages:
26646  * - \ref SCIP_STAGE_INITPRESOLVE
26647  * - \ref SCIP_STAGE_PRESOLVING
26648  * - \ref SCIP_STAGE_EXITPRESOLVE
26649  * - \ref SCIP_STAGE_SOLVING
26650  *
26651  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26652  */
26654  SCIP* scip /**< SCIP data structure */
26655  )
26656 {
26657  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootLooseObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26658 
26659  return SCIPlpGetRootLooseObjval(scip->lp);
26660 }
26661 
26662 /** gets current LP columns along with the current number of LP columns
26663  *
26664  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26665  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26666  *
26667  * @pre This method can be called if @p scip is in one of the following stages:
26668  * - \ref SCIP_STAGE_SOLVING
26669  *
26670  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26671  */
26673  SCIP* scip, /**< SCIP data structure */
26674  SCIP_COL*** cols, /**< pointer to store the array of LP columns, or NULL */
26675  int* ncols /**< pointer to store the number of LP columns, or NULL */
26676  )
26677 {
26678  SCIP_CALL( checkStage(scip, "SCIPgetLPColsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26679 
26681  {
26682  if( cols != NULL )
26683  *cols = SCIPlpGetCols(scip->lp);
26684  if( ncols != NULL )
26685  *ncols = SCIPlpGetNCols(scip->lp);
26686  }
26687  else
26688  {
26689  if( cols != NULL )
26690  *cols = NULL;
26691  if( ncols != NULL )
26692  *ncols = 0;
26693  }
26694 
26695  return SCIP_OKAY;
26696 }
26697 
26698 /** gets current LP columns
26699  *
26700  * @return the current LP columns.
26701  *
26702  * @pre This method can be called if @p scip is in one of the following stages:
26703  * - \ref SCIP_STAGE_SOLVING
26704  *
26705  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26706  */
26708  SCIP* scip /**< SCIP data structure */
26709  )
26710 {
26711  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26712 
26714  return SCIPlpGetCols(scip->lp);
26715  else
26716  return NULL;
26717 }
26718 
26719 /** gets current number of LP columns
26720  *
26721  * @return the current number of LP columns.
26722  *
26723  * @pre This method can be called if @p scip is in one of the following stages:
26724  * - \ref SCIP_STAGE_SOLVING
26725  *
26726  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26727  */
26729  SCIP* scip /**< SCIP data structure */
26730  )
26731 {
26732  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26733 
26735  return SCIPlpGetNCols(scip->lp);
26736  else
26737  return 0;
26738 }
26739 
26740 /** gets current LP rows along with the current number of LP rows
26741  *
26742  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26743  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26744  *
26745  * @pre This method can be called if @p scip is in one of the following stages:
26746  * - \ref SCIP_STAGE_SOLVING
26747  *
26748  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26749  */
26751  SCIP* scip, /**< SCIP data structure */
26752  SCIP_ROW*** rows, /**< pointer to store the array of LP rows, or NULL */
26753  int* nrows /**< pointer to store the number of LP rows, or NULL */
26754  )
26755 {
26756  SCIP_CALL( checkStage(scip, "SCIPgetLPRowsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26757 
26759  {
26760  if( rows != NULL )
26761  *rows = SCIPlpGetRows(scip->lp);
26762  if( nrows != NULL )
26763  *nrows = SCIPlpGetNRows(scip->lp);
26764  }
26765  else
26766  {
26767  if( rows != NULL )
26768  *rows = NULL;
26769  if( nrows != NULL )
26770  *nrows = 0;
26771  }
26772 
26773  return SCIP_OKAY;
26774 }
26775 
26776 /** gets current LP rows
26777  *
26778  * @return the current LP rows.
26779  *
26780  * @pre This method can be called if @p scip is in one of the following stages:
26781  * - \ref SCIP_STAGE_SOLVING
26782  *
26783  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26784  */
26786  SCIP* scip /**< SCIP data structure */
26787  )
26788 {
26789  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26790 
26792  return SCIPlpGetRows(scip->lp);
26793  else
26794  return NULL;
26795 }
26796 
26797 /** gets current number of LP rows
26798  *
26799  * @return the current number of LP rows.
26800  *
26801  * @pre This method can be called if @p scip is in one of the following stages:
26802  * - \ref SCIP_STAGE_SOLVING
26803  *
26804  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26805  */
26807  SCIP* scip /**< SCIP data structure */
26808  )
26809 {
26810  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26811 
26813  return SCIPlpGetNRows(scip->lp);
26814  else
26815  return 0;
26816 }
26817 
26818 /** returns TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
26819  * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing
26820  *
26821  * @return TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
26822  * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing.
26823  *
26824  * @pre This method can be called if @p scip is in one of the following stages:
26825  * - \ref SCIP_STAGE_SOLVING
26826  *
26827  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26828  */
26830  SCIP* scip /**< SCIP data structure */
26831  )
26832 {
26833  SCIP_CALL_ABORT( checkStage(scip, "SCIPallColsInLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26834 
26835  return SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp);
26836 }
26837 
26838 /** returns whether the current LP solution is basic, i.e. is defined by a valid simplex basis
26839  *
26840  * @return whether the current LP solution is basic, i.e. is defined by a valid simplex basis.
26841  *
26842  * @pre This method can be called if @p scip is in one of the following stages:
26843  * - \ref SCIP_STAGE_SOLVING
26844  *
26845  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26846  */
26848  SCIP* scip /**< SCIP data structure */
26849  )
26850 {
26851  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPSolBasic", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26852 
26853  return SCIPlpIsSolBasic(scip->lp);
26854 }
26855 
26856 /** gets all indices of basic columns and rows: index i >= 0 corresponds to column i, index i < 0 to row -i-1
26857  *
26858  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26859  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26860  *
26861  * @pre This method can be called if @p scip is in one of the following stages:
26862  * - \ref SCIP_STAGE_SOLVING
26863  *
26864  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26865  */
26867  SCIP* scip, /**< SCIP data structure */
26868  int* basisind /**< pointer to store basis indices ready to keep number of rows entries */
26869  )
26870 {
26871  SCIP_CALL( checkStage(scip, "SCIPgetLPBasisInd", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26872 
26873  if( !SCIPlpIsSolBasic(scip->lp) )
26874  {
26875  SCIPerrorMessage("current LP solution is not basic\n");
26876  return SCIP_INVALIDCALL;
26877  }
26878 
26879  SCIP_CALL( SCIPlpGetBasisInd(scip->lp, basisind) );
26880 
26881  return SCIP_OKAY;
26882 }
26883 
26884 /** gets a row from the inverse basis matrix B^-1
26885  *
26886  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26887  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26888  *
26889  * @pre This method can be called if @p scip is in one of the following stages:
26890  * - \ref SCIP_STAGE_SOLVING
26891  *
26892  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26893  */
26895  SCIP* scip, /**< SCIP data structure */
26896  int r, /**< row number */
26897  SCIP_Real* coefs, /**< array to store the coefficients of the row */
26898  int* inds, /**< array to store the non-zero indices, or NULL */
26899  int* ninds /**< pointer to store the number of non-zero indices, or NULL
26900  * (-1: if we do not store sparsity informations) */
26901  )
26902 {
26903  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26904 
26905  if( !SCIPlpIsSolBasic(scip->lp) )
26906  {
26907  SCIPerrorMessage("current LP solution is not basic\n");
26908  return SCIP_INVALIDCALL;
26909  }
26910 
26911  SCIP_CALL( SCIPlpGetBInvRow(scip->lp, r, coefs, inds, ninds) );
26912 
26913  /* debug check if the coef is the r-th line of the inverse matrix B^-1 */
26914  SCIP_CALL( SCIPdebugCheckBInvRow(scip, r, coefs) ); /*lint !e506 !e774*/
26915 
26916  return SCIP_OKAY;
26917 }
26918 
26919 /** gets a column from the inverse basis matrix B^-1
26920  *
26921  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26922  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26923  *
26924  * @pre This method can be called if @p scip is in one of the following stages:
26925  * - \ref SCIP_STAGE_SOLVING
26926  *
26927  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26928  */
26930  SCIP* scip, /**< SCIP data structure */
26931  int c, /**< column number of B^-1; this is NOT the number of the column in the LP
26932  * returned by SCIPcolGetLPPos(); you have to call SCIPgetBasisInd()
26933  * to get the array which links the B^-1 column numbers to the row and
26934  * column numbers of the LP! c must be between 0 and nrows-1, since the
26935  * basis has the size nrows * nrows */
26936  SCIP_Real* coefs, /**< array to store the coefficients of the column */
26937  int* inds, /**< array to store the non-zero indices, or NULL */
26938  int* ninds /**< pointer to store the number of non-zero indices, or NULL
26939  * (-1: if we do not store sparsity informations) */
26940  )
26941 {
26942  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvCol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26943 
26944  if( !SCIPlpIsSolBasic(scip->lp) )
26945  {
26946  SCIPerrorMessage("current LP solution is not basic\n");
26947  return SCIP_INVALIDCALL;
26948  }
26949 
26950  SCIP_CALL( SCIPlpGetBInvCol(scip->lp, c, coefs, inds, ninds) );
26951 
26952  return SCIP_OKAY;
26953 }
26954 
26955 /** gets a row from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A)
26956  *
26957  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26958  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26959  *
26960  * @pre This method can be called if @p scip is in one of the following stages:
26961  * - \ref SCIP_STAGE_SOLVING
26962  *
26963  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26964  */
26966  SCIP* scip, /**< SCIP data structure */
26967  int r, /**< row number */
26968  SCIP_Real* binvrow, /**< row in B^-1 from prior call to SCIPgetLPBInvRow(), or NULL */
26969  SCIP_Real* coefs, /**< array to store the coefficients of the row */
26970  int* inds, /**< array to store the non-zero indices, or NULL */
26971  int* ninds /**< pointer to store the number of non-zero indices, or NULL
26972  * (-1: if we do not store sparsity informations) */
26973  )
26974 {
26975  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvARow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26976 
26977  if( !SCIPlpIsSolBasic(scip->lp) )
26978  {
26979  SCIPerrorMessage("current LP solution is not basic\n");
26980  return SCIP_INVALIDCALL;
26981  }
26982 
26983  SCIP_CALL( SCIPlpGetBInvARow(scip->lp, r, binvrow, coefs, inds, ninds) );
26984 
26985  return SCIP_OKAY;
26986 }
26987 
26988 /** gets a column from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A),
26989  * i.e., it computes B^-1 * A_c with A_c being the c'th column of A
26990  *
26991  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26992  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26993  *
26994  * @pre This method can be called if @p scip is in one of the following stages:
26995  * - \ref SCIP_STAGE_SOLVING
26996  *
26997  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
26998  */
27000  SCIP* scip, /**< SCIP data structure */
27001  int c, /**< column number which can be accessed by SCIPcolGetLPPos() */
27002  SCIP_Real* coefs, /**< array to store the coefficients of the column */
27003  int* inds, /**< array to store the non-zero indices, or NULL */
27004  int* ninds /**< pointer to store the number of non-zero indices, or NULL
27005  * (-1: if we do not store sparsity informations) */
27006  )
27007 {
27008  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvACol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27009 
27010  if( !SCIPlpIsSolBasic(scip->lp) )
27011  {
27012  SCIPerrorMessage("current LP solution is not basic\n");
27013  return SCIP_INVALIDCALL;
27014  }
27015 
27016  SCIP_CALL( SCIPlpGetBInvACol(scip->lp, c, coefs, inds, ninds) );
27017 
27018  return SCIP_OKAY;
27019 }
27020 
27021 /** calculates a weighted sum of all LP rows; for negative weights, the left and right hand side of the corresponding
27022  * LP row are swapped in the summation
27023  *
27024  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27025  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27026  *
27027  * @pre This method can be called if @p scip is in one of the following stages:
27028  * - \ref SCIP_STAGE_SOLVING
27029  *
27030  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
27031  */
27033  SCIP* scip, /**< SCIP data structure */
27034  SCIP_Real* weights, /**< row weights in row summation */
27035  SCIP_REALARRAY* sumcoef, /**< array to store sum coefficients indexed by variables' probindex */
27036  SCIP_Real* sumlhs, /**< pointer to store the left hand side of the row summation */
27037  SCIP_Real* sumrhs /**< pointer to store the right hand side of the row summation */
27038  )
27039 {
27040  SCIP_CALL( checkStage(scip, "SCIPsumLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27041 
27042  SCIP_CALL( SCIPlpSumRows(scip->lp, scip->set, scip->transprob, weights, sumcoef, sumlhs, sumrhs) );
27043 
27044  return SCIP_OKAY;
27045 }
27046 
27047 /** calculates a MIR cut out of the weighted sum of LP rows; The weights of modifiable rows are set to 0.0, because these
27048  * rows cannot participate in a MIR cut.
27049  *
27050  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27051  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27052  *
27053  * @pre This method can be called if @p scip is in one of the following stages:
27054  * - \ref SCIP_STAGE_SOLVING
27055  *
27056  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
27057  */
27059  SCIP* scip, /**< SCIP data structure */
27060  SCIP_SOL* sol, /**< the solution that should be separated, or NULL for LP solution */
27061  SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
27062  SCIP_Bool usevbds, /**< should variable bounds be used in bound transformation? */
27063  SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
27064  SCIP_Bool fixintegralrhs, /**< should complementation tried to be adjusted such that rhs gets fractional? */
27065  int* boundsfortrans, /**< bounds that should be used for transformed variables: vlb_idx/vub_idx,
27066  * -1 for global lb/ub, -2 for local lb/ub, or -3 for using closest bound;
27067  * NULL for using closest bound for all variables */
27068  SCIP_BOUNDTYPE* boundtypesfortrans, /**< type of bounds that should be used for transformed variables;
27069  * NULL for using closest bound for all variables */
27070  int maxmksetcoefs, /**< maximal number of nonzeros allowed in aggregated base inequality */
27071  SCIP_Real maxweightrange, /**< maximal valid range max(|weights|)/min(|weights|) of row weights */
27072  SCIP_Real minfrac, /**< minimal fractionality of rhs to produce MIR cut for */
27073  SCIP_Real maxfrac, /**< maximal fractionality of rhs to produce MIR cut for */
27074  SCIP_Real* weights, /**< row weights in row summation; some weights might be set to zero */
27075  SCIP_Real maxweight, /**< largest magnitude of weights; set to -1.0 if sparsity information is
27076  * unknown */
27077  int* weightinds, /**< sparsity pattern of weights; size nrowinds; NULL if sparsity info is
27078  * unknown */
27079  int nweightinds, /**< number of nonzeros in weights; -1 if rowinds is NULL */
27080  int rowlensum, /**< total number of non-zeros in used rows (row associated with nonzero weight coefficient); -1 if unknown */
27081  int* sidetypes, /**< specify row side type (-1 = lhs, 0 = unkown, 1 = rhs) or NULL for automatic choices */
27082  SCIP_Real scale, /**< additional scaling factor multiplied to all rows */
27083  SCIP_Real* mksetcoefs, /**< array to store mixed knapsack set coefficients: size nvars; or NULL */
27084  SCIP_Bool* mksetcoefsvalid, /**< pointer to store whether mixed knapsack set coefficients are valid; or NULL */
27085  SCIP_Real* mircoef, /**< array to store MIR coefficients: must be of size SCIPgetNVars() */
27086  SCIP_Real* mirrhs, /**< pointer to store the right hand side of the MIR row */
27087  SCIP_Real* cutactivity, /**< pointer to store the activity of the resulting cut */
27088  SCIP_Bool* success, /**< pointer to store whether the returned coefficients are a valid MIR cut */
27089  SCIP_Bool* cutislocal, /**< pointer to store whether the returned cut is only valid locally */
27090  int* cutrank /**< pointer to store the rank of the returned cut; or NULL */
27091  )
27092 {
27093  SCIP_CALL( checkStage(scip, "SCIPcalcMIR", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27094 
27095  SCIP_CALL( SCIPlpCalcMIR(scip->lp, scip->set, scip->stat, scip->transprob, sol,
27096  boundswitch, usevbds, allowlocal, fixintegralrhs, boundsfortrans, boundtypesfortrans, maxmksetcoefs,
27097  maxweightrange, minfrac, maxfrac, weights, maxweight, weightinds, nweightinds, rowlensum, sidetypes,
27098  scale, mksetcoefs, mksetcoefsvalid, mircoef, mirrhs, cutactivity, success, cutislocal, cutrank) );
27099 
27100  return SCIP_OKAY;
27101 }
27102 
27103 /** calculates a strong CG cut out of the weighted sum of LP rows; The weights of modifiable rows are set to 0.0, because these
27104  * rows cannot participate in a MIR cut.
27105  *
27106  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27107  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27108  *
27109  * @pre This method can be called if @p scip is in one of the following stages:
27110  * - \ref SCIP_STAGE_SOLVING
27111  *
27112  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
27113  */
27115  SCIP* scip, /**< SCIP data structure */
27116  SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
27117  SCIP_Bool usevbds, /**< should variable bounds be used in bound transformation? */
27118  SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
27119  int maxmksetcoefs, /**< maximal number of nonzeros allowed in aggregated base inequality */
27120  SCIP_Real maxweightrange, /**< maximal valid range max(|weights|)/min(|weights|) of row weights */
27121  SCIP_Real minfrac, /**< minimal fractionality of rhs to produce strong CG cut for */
27122  SCIP_Real maxfrac, /**< maximal fractionality of rhs to produce strong CG cut for */
27123  SCIP_Real* weights, /**< row weights in row summation; some weights might be set to zero */
27124  int* inds, /**< indices of non-zero entries in weights array, or NULL */
27125  int ninds, /**< number of indices of non-zero entries in weights array, -1 if inds is
27126  * NULL */
27127  SCIP_Real scale, /**< additional scaling factor multiplied to all rows */
27128  SCIP_Real* mircoef, /**< array to store strong CG coefficients: must be of size SCIPgetNVars() */
27129  SCIP_Real* mirrhs, /**< pointer to store the right hand side of the strong CG row */
27130  SCIP_Real* cutactivity, /**< pointer to store the activity of the resulting cut */
27131  SCIP_Bool* success, /**< pointer to store whether the returned coefficients are a valid strong CG cut */
27132  SCIP_Bool* cutislocal, /**< pointer to store whether the returned cut is only valid locally */
27133  int* cutrank /**< pointer to store the rank of the returned cut; or NULL */
27134  )
27135 {
27136  SCIP_CALL( checkStage(scip, "SCIPcalcStrongCG", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27137 
27138  SCIP_CALL( SCIPlpCalcStrongCG(scip->lp, scip->set, scip->stat, scip->transprob,
27139  boundswitch, usevbds, allowlocal, maxmksetcoefs, maxweightrange, minfrac, maxfrac, weights, inds, ninds, scale,
27140  mircoef, mirrhs, cutactivity, success, cutislocal, cutrank) );
27141 
27142  return SCIP_OKAY;
27143 }
27144 
27145 /** writes current LP to a file
27146  *
27147  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27148  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27149  *
27150  * @pre This method can be called if @p scip is in one of the following stages:
27151  * - \ref SCIP_STAGE_SOLVING
27152  *
27153  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
27154  */
27156  SCIP* scip, /**< SCIP data structure */
27157  const char* filename /**< file name */
27158  )
27159 {
27160 
27161  SCIP_Bool cutoff;
27162 
27163  SCIP_CALL( checkStage(scip, "SCIPwriteLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27165  {
27166  SCIP_CALL( SCIPconstructCurrentLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
27167  scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->branchcand, scip->eventqueue,
27168  scip->eventfilter, scip->cliquetable, FALSE, &cutoff) );
27169  }
27170 
27171  /* we need a flushed lp to write the current lp */
27172  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
27173 
27174  SCIP_CALL( SCIPlpWrite(scip->lp, filename) );
27175 
27176  return SCIP_OKAY;
27177 }
27178 
27179 /** writes MIP relaxation of the current branch-and-bound node to a file
27180  *
27181  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27182  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27183  *
27184  * @pre This method can be called if @p scip is in one of the following stages:
27185  * - \ref SCIP_STAGE_SOLVING
27186  *
27187  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
27188  */
27190  SCIP* scip, /**< SCIP data structure */
27191  const char* filename, /**< file name */
27192  SCIP_Bool genericnames, /**< should generic names like x_i and row_j be used in order to avoid
27193  * troubles with reserved symbols? */
27194  SCIP_Bool origobj, /**< should the original objective function be used? */
27195  SCIP_Bool lazyconss /**< output removable rows as lazy constraints? */
27196  )
27197 {
27198  SCIP_CALL( checkStage(scip, "SCIPwriteMIP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27199 
27200  /* we need a flushed lp to write the current mip */
27201  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
27202 
27203  SCIP_CALL( SCIPlpWriteMip(scip->lp, scip->set, scip->messagehdlr, filename, genericnames,
27204  origobj, scip->origprob->objsense, scip->transprob->objscale, scip->transprob->objoffset, lazyconss) );
27205 
27206  return SCIP_OKAY;
27207 }
27208 
27209 /** gets the LP interface of SCIP;
27210  * with the LPI you can use all of the methods defined in lpi/lpi.h;
27211  *
27212  * @warning You have to make sure, that the full internal state of the LPI does not change or is recovered completely
27213  * after the end of the method that uses the LPI. In particular, if you manipulate the LP or its solution
27214  * (e.g. by calling one of the SCIPlpiAdd...() or one of the SCIPlpiSolve...() methods), you have to check in
27215  * advance with SCIPlpiWasSolved() whether the LP is currently solved. If this is the case, you have to make
27216  * sure, the internal solution status is recovered completely at the end of your method. This can be achieved
27217  * by getting the LPI state before applying any LPI manipulations with SCIPlpiGetState() and restoring it
27218  * afterwards with SCIPlpiSetState() and SCIPlpiFreeState(). Additionally you have to resolve the LP with the
27219  * appropriate SCIPlpiSolve...() call in order to reinstall the internal solution status.
27220  *
27221  * @warning Make also sure, that all parameter values that you have changed are set back to their original values.
27222  *
27223  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27224  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27225  *
27226  * @pre This method can be called if @p scip is in one of the following stages:
27227  * - \ref SCIP_STAGE_TRANSFORMED
27228  * - \ref SCIP_STAGE_INITPRESOLVE
27229  * - \ref SCIP_STAGE_PRESOLVING
27230  * - \ref SCIP_STAGE_EXITPRESOLVE
27231  * - \ref SCIP_STAGE_PRESOLVED
27232  * - \ref SCIP_STAGE_INITSOLVE
27233  * - \ref SCIP_STAGE_SOLVING
27234  * - \ref SCIP_STAGE_SOLVED
27235  * - \ref SCIP_STAGE_EXITSOLVE
27236  *
27237  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
27238  */
27240  SCIP* scip, /**< SCIP data structure */
27241  SCIP_LPI** lpi /**< pointer to store the LP interface */
27242  )
27243 {
27244  assert(lpi != NULL);
27245 
27246  SCIP_CALL( checkStage(scip, "SCIPgetLPI", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
27247 
27248  *lpi = SCIPlpGetLPI(scip->lp);
27249 
27250  return SCIP_OKAY;
27251 }
27252 
27253 /** displays quality information about the current LP solution. An LP solution need to be available; information printed
27254  * is subject to what the LP solver supports
27255  *
27256  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27257  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27258  *
27259  * @pre This method can be called if @p scip is in one of the following stages:
27260  * - \ref SCIP_STAGE_INIT
27261  * - \ref SCIP_STAGE_PROBLEM
27262  * - \ref SCIP_STAGE_TRANSFORMED
27263  * - \ref SCIP_STAGE_INITPRESOLVE
27264  * - \ref SCIP_STAGE_PRESOLVING
27265  * - \ref SCIP_STAGE_EXITPRESOLVE
27266  * - \ref SCIP_STAGE_PRESOLVED
27267  * - \ref SCIP_STAGE_SOLVING
27268  * - \ref SCIP_STAGE_SOLVED
27269  * - \ref SCIP_STAGE_FREE
27270  *
27271  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
27272  *
27273  * @note The printing process is done via the message handler system.
27274  */
27276  SCIP* scip, /**< SCIP data structure */
27277  FILE* file /**< output file (or NULL for standard output) */
27278  )
27279 {
27280  SCIP_LPI* lpi;
27281  SCIP_Real quality;
27282 
27283  SCIP_CALL( checkStage(scip, "SCIPprintLPSolutionQuality", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
27284 
27285  switch( scip->set->stage )
27286  {
27287  case SCIP_STAGE_INIT:
27288  case SCIP_STAGE_PROBLEM:
27291  case SCIP_STAGE_PRESOLVING:
27293  case SCIP_STAGE_PRESOLVED:
27294  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Problem not solving yet, no LP available.\n");
27295  return SCIP_OKAY;
27296 
27297  case SCIP_STAGE_SOLVING:
27298  case SCIP_STAGE_SOLVED:
27299  break;
27300 
27301  default:
27302  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
27303  return SCIP_INVALIDCALL;
27304  } /*lint !e788*/
27305 
27306  /* note that after diving mode, the LPI may only have the basis information, but SCIPlpiWasSolved() can be false; in
27307  * this case, we will (depending on the LP solver) probably not obtain the quality measure; one solution would be to
27308  * store the results of SCIPlpiGetRealSolQuality() within the SCIP_LP after each LP solve; this would have the added
27309  * advantage, that we reduce direct access to the LPI, but it sounds potentially expensive
27310  */
27311  lpi = SCIPlpGetLPI(scip->lp);
27312  assert(lpi != NULL);
27313 
27315  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Basis matrix condition (estimated): ");
27316  if( quality != SCIP_INVALID ) /*lint !e777*/
27317  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%.6e\n", quality);
27318  else
27319  SCIPmessageFPrintInfo(scip->messagehdlr, file, "not available\n", quality);
27320 
27322  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Basis matrix condition (exact): ");
27323  if( quality != SCIP_INVALID ) /*lint !e777*/
27324  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%.6e\n", quality);
27325  else
27326  SCIPmessageFPrintInfo(scip->messagehdlr, file, "not available\n", quality);
27327 
27328  return SCIP_OKAY;
27329 }
27330 
27331 /** compute relative interior point to current LP
27332  * @see SCIPlpComputeRelIntPoint
27333  *
27334  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27335  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27336  *
27337  * @pre This method can be called if @p scip is in one of the following stages:
27338  * - \ref SCIP_STAGE_TRANSFORMED
27339  * - \ref SCIP_STAGE_INITPRESOLVE
27340  * - \ref SCIP_STAGE_PRESOLVING
27341  * - \ref SCIP_STAGE_EXITPRESOLVE
27342  * - \ref SCIP_STAGE_PRESOLVED
27343  * - \ref SCIP_STAGE_SOLVING
27344  * - \ref SCIP_STAGE_SOLVED
27345  *
27346  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
27347  */
27349  SCIP* scip, /**< SCIP data structure */
27350  SCIP_Bool relaxrows, /**< should the rows be relaxed */
27351  SCIP_Bool inclobjcutoff, /**< should a row for the objective cutoff be included */
27352  SCIP_Real timelimit, /**< time limit for LP solver */
27353  int iterlimit, /**< iteration limit for LP solver */
27354  SCIP_SOL** point /**< relative interior point on exit */
27355  )
27356 {
27357  SCIP_Real* pointvals;
27358  SCIP_Bool success;
27359 
27360  SCIP_CALL( checkStage(scip, "SCIPcomputeLPRelIntPoint", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27361 
27362  assert(scip != NULL);
27363  assert(scip->lp != NULL);
27364  assert(point != NULL);
27365 
27366  *point = NULL;
27367 
27368  SCIP_CALL( SCIPallocBufferArray(scip, &pointvals, SCIPlpGetNCols(scip->lp)) );
27369 
27370  SCIP_CALL( SCIPlpComputeRelIntPoint(scip->set, scip->messagehdlr, scip->lp, scip->transprob,
27371  relaxrows, inclobjcutoff, timelimit, iterlimit, pointvals, &success) );
27372 
27373  /* if successful, create new solution with point values */
27374  if( success )
27375  {
27376  int i;
27377 
27378  SCIP_CALL( SCIPcreateSol(scip, point, NULL) );
27379 
27380  for( i = 0; i < SCIPlpGetNCols(scip->lp); ++i )
27381  {
27382  SCIP_CALL( SCIPsetSolVal(scip, *point, SCIPcolGetVar(SCIPlpGetCols(scip->lp)[i]), pointvals[i]) );
27383  }
27384  }
27385 
27386  SCIPfreeBufferArray(scip, &pointvals);
27387 
27388  return SCIP_OKAY;
27389 }
27390 
27391 /*
27392  * LP column methods
27393  */
27394 
27395 /** returns the reduced costs of a column in the last (feasible) LP
27396  *
27397  * @return the reduced costs of a column in the last (feasible) LP
27398  *
27399  * @pre this method can be called in one of the following stages of the SCIP solving process:
27400  * - \ref SCIP_STAGE_SOLVING
27401  */
27403  SCIP* scip, /**< SCIP data structure */
27404  SCIP_COL* col /**< LP column */
27405  )
27406 {
27407  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetColRedcost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27408 
27409  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
27410  {
27411  SCIPerrorMessage("cannot get reduced costs, because node LP is not processed\n");
27412  SCIPABORT();
27413  return 0.0; /*lint !e527*/
27414  }
27415 
27416  return SCIPcolGetRedcost(col, scip->stat, scip->lp);
27417 }
27418 
27419 
27420 /** returns the Farkas coefficient of a column in the last (infeasible) LP
27421  *
27422  * @return the Farkas coefficient of a column in the last (infeasible) LP
27423  *
27424  * @pre this method can be called in one of the following stages of the SCIP solving process:
27425  * - \ref SCIP_STAGE_SOLVING
27426  */
27428  SCIP* scip, /**< SCIP data structure */
27429  SCIP_COL* col /**< LP column */
27430  )
27431 {
27432  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetColFarkasCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27433 
27434  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
27435  {
27436  SCIPerrorMessage("cannot get Farkas coeff, because node LP is not processed\n");
27437  SCIPABORT();
27438  return 0.0; /*lint !e527*/
27439  }
27440 
27441  return SCIPcolGetFarkasCoef(col, scip->stat, scip->lp);
27442 }
27443 
27444 /** marks a column to be not removable from the LP in the current node
27445  *
27446  * @pre this method can be called in the following stage of the SCIP solving process:
27447  * - \ref SCIP_STAGE_SOLVING
27448  */
27450  SCIP* scip, /**< SCIP data structure */
27451  SCIP_COL* col /**< LP column */
27452  )
27453 {
27454  SCIP_CALL_ABORT( checkStage(scip, "SCIPmarkColNotRemovableLocal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27455 
27456  SCIPcolMarkNotRemovableLocal(col, scip->stat);
27457 }
27458 
27459 /*
27460  * LP row methods
27461  */
27462 
27463 /** creates and captures an LP row from a constraint handler
27464  *
27465  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27466  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27467  *
27468  * @pre this method can be called in one of the following stages of the SCIP solving process:
27469  * - \ref SCIP_STAGE_INITSOLVE
27470  * - \ref SCIP_STAGE_SOLVING
27471  */
27473  SCIP* scip, /**< SCIP data structure */
27474  SCIP_ROW** row, /**< pointer to row */
27475  SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */
27476  const char* name, /**< name of row */
27477  int len, /**< number of nonzeros in the row */
27478  SCIP_COL** cols, /**< array with columns of row entries */
27479  SCIP_Real* vals, /**< array with coefficients of row entries */
27480  SCIP_Real lhs, /**< left hand side of row */
27481  SCIP_Real rhs, /**< right hand side of row */
27482  SCIP_Bool local, /**< is row only valid locally? */
27483  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
27484  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
27485  )
27486 {
27487  SCIP_CALL( checkStage(scip, "SCIPcreateRowCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27488 
27489  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
27490  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_CONS, (void*) conshdlr, local, modifiable, removable) );
27491 
27492  return SCIP_OKAY;
27493 }
27494 
27495 /** creates and captures an LP row from a separator
27496  *
27497  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27498  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27499  *
27500  * @pre this method can be called in one of the following stages of the SCIP solving process:
27501  * - \ref SCIP_STAGE_INITSOLVE
27502  * - \ref SCIP_STAGE_SOLVING
27503  */
27505  SCIP* scip, /**< SCIP data structure */
27506  SCIP_ROW** row, /**< pointer to row */
27507  SCIP_SEPA* sepa, /**< separator that creates the row */
27508  const char* name, /**< name of row */
27509  int len, /**< number of nonzeros in the row */
27510  SCIP_COL** cols, /**< array with columns of row entries */
27511  SCIP_Real* vals, /**< array with coefficients of row entries */
27512  SCIP_Real lhs, /**< left hand side of row */
27513  SCIP_Real rhs, /**< right hand side of row */
27514  SCIP_Bool local, /**< is row only valid locally? */
27515  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
27516  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
27517  )
27518 {
27519  SCIP_CALL( checkStage(scip, "SCIPcreateRowSepa", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27520 
27521  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
27522  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_SEPA, (void*) sepa, local, modifiable, removable) );
27523 
27524  return SCIP_OKAY;
27525 }
27526 
27527 /** creates and captures an LP row from an unspecified source
27528  *
27529  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27530  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27531  *
27532  * @pre this method can be called in one of the following stages of the SCIP solving process:
27533  * - \ref SCIP_STAGE_INITSOLVE
27534  * - \ref SCIP_STAGE_SOLVING
27535  */
27537  SCIP* scip, /**< SCIP data structure */
27538  SCIP_ROW** row, /**< pointer to row */
27539  const char* name, /**< name of row */
27540  int len, /**< number of nonzeros in the row */
27541  SCIP_COL** cols, /**< array with columns of row entries */
27542  SCIP_Real* vals, /**< array with coefficients of row entries */
27543  SCIP_Real lhs, /**< left hand side of row */
27544  SCIP_Real rhs, /**< right hand side of row */
27545  SCIP_Bool local, /**< is row only valid locally? */
27546  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
27547  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
27548  )
27549 {
27550  SCIP_CALL( checkStage(scip, "SCIPcreateRowUnspec", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27551 
27552  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
27553  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_UNSPEC, NULL, local, modifiable, removable) );
27554 
27555  return SCIP_OKAY;
27556 }
27557 
27558 /** creates and captures an LP row
27559  *
27560  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27561  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27562  *
27563  * @pre this method can be called in one of the following stages of the SCIP solving process:
27564  * - \ref SCIP_STAGE_INITSOLVE
27565  * - \ref SCIP_STAGE_SOLVING
27566  *
27567  * @deprecated Please use SCIPcreateRowCons() or SCIPcreateRowSepa() when calling from a constraint handler or separator in order
27568  * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateRowUnspec().
27569  */
27571  SCIP* scip, /**< SCIP data structure */
27572  SCIP_ROW** row, /**< pointer to row */
27573  const char* name, /**< name of row */
27574  int len, /**< number of nonzeros in the row */
27575  SCIP_COL** cols, /**< array with columns of row entries */
27576  SCIP_Real* vals, /**< array with coefficients of row entries */
27577  SCIP_Real lhs, /**< left hand side of row */
27578  SCIP_Real rhs, /**< right hand side of row */
27579  SCIP_Bool local, /**< is row only valid locally? */
27580  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
27581  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
27582  )
27583 {
27584  SCIP_CALL( checkStage(scip, "SCIPcreateRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27585 
27586  SCIP_CALL( SCIPcreateRowUnspec(scip, row, name, len, cols, vals, lhs, rhs, local, modifiable, removable) );
27587 
27588  return SCIP_OKAY;
27589 }
27590 
27591 /** creates and captures an LP row without any coefficients from a constraint handler
27592  *
27593  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27594  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27595  *
27596  * @pre this method can be called in one of the following stages of the SCIP solving process:
27597  * - \ref SCIP_STAGE_INITSOLVE
27598  * - \ref SCIP_STAGE_SOLVING
27599  */
27601  SCIP* scip, /**< SCIP data structure */
27602  SCIP_ROW** row, /**< pointer to row */
27603  SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */
27604  const char* name, /**< name of row */
27605  SCIP_Real lhs, /**< left hand side of row */
27606  SCIP_Real rhs, /**< right hand side of row */
27607  SCIP_Bool local, /**< is row only valid locally? */
27608  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
27609  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
27610  )
27611 {
27612  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27613 
27614  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
27615  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_CONS, (void*) conshdlr, local, modifiable, removable) );
27616 
27617  return SCIP_OKAY;
27618 }
27619 
27620 /** creates and captures an LP row without any coefficients from a separator
27621  *
27622  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27623  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27624  *
27625  * @pre this method can be called in one of the following stages of the SCIP solving process:
27626  * - \ref SCIP_STAGE_INITSOLVE
27627  * - \ref SCIP_STAGE_SOLVING
27628  */
27630  SCIP* scip, /**< SCIP data structure */
27631  SCIP_ROW** row, /**< pointer to row */
27632  SCIP_SEPA* sepa, /**< separator that creates the row */
27633  const char* name, /**< name of row */
27634  SCIP_Real lhs, /**< left hand side of row */
27635  SCIP_Real rhs, /**< right hand side of row */
27636  SCIP_Bool local, /**< is row only valid locally? */
27637  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
27638  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
27639  )
27640 {
27641  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowSepa", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27642 
27643  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
27644  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_SEPA, (void*) sepa, local, modifiable, removable) );
27645 
27646  return SCIP_OKAY;
27647 }
27648 
27649 /** creates and captures an LP row without any coefficients from an unspecified source
27650  *
27651  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27652  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27653  *
27654  * @pre this method can be called in one of the following stages of the SCIP solving process:
27655  * - \ref SCIP_STAGE_INITSOLVE
27656  * - \ref SCIP_STAGE_SOLVING
27657  */
27659  SCIP* scip, /**< SCIP data structure */
27660  SCIP_ROW** row, /**< pointer to row */
27661  const char* name, /**< name of row */
27662  SCIP_Real lhs, /**< left hand side of row */
27663  SCIP_Real rhs, /**< right hand side of row */
27664  SCIP_Bool local, /**< is row only valid locally? */
27665  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
27666  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
27667  )
27668 {
27669  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowUnspec", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27670 
27671  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
27672  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_UNSPEC, NULL, local, modifiable, removable) );
27673 
27674  return SCIP_OKAY;
27675 }
27676 
27677 /** creates and captures an LP row without any coefficients
27678  *
27679  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27680  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27681  *
27682  * @pre this method can be called in one of the following stages of the SCIP solving process:
27683  * - \ref SCIP_STAGE_INITSOLVE
27684  * - \ref SCIP_STAGE_SOLVING
27685  *
27686  * @deprecated Please use SCIPcreateEmptyRowCons() or SCIPcreateEmptyRowSepa() when calling from a constraint handler or separator in order
27687  * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateEmptyRowUnspec().
27688  */
27690  SCIP* scip, /**< SCIP data structure */
27691  SCIP_ROW** row, /**< pointer to row */
27692  const char* name, /**< name of row */
27693  SCIP_Real lhs, /**< left hand side of row */
27694  SCIP_Real rhs, /**< right hand side of row */
27695  SCIP_Bool local, /**< is row only valid locally? */
27696  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
27697  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
27698  )
27699 {
27700  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27701 
27702  SCIP_CALL( SCIPcreateEmptyRowUnspec(scip, row, name, lhs, rhs, local, modifiable, removable) );
27703 
27704  return SCIP_OKAY;
27705 }
27706 
27707 /** increases usage counter of LP row
27708  *
27709  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27710  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27711  *
27712  * @pre this method can be called in one of the following stages of the SCIP solving process:
27713  * - \ref SCIP_STAGE_INITSOLVE
27714  * - \ref SCIP_STAGE_SOLVING
27715  */
27717  SCIP* scip, /**< SCIP data structure */
27718  SCIP_ROW* row /**< row to capture */
27719  )
27720 {
27721  SCIP_CALL( checkStage(scip, "SCIPcaptureRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27722 
27723  SCIProwCapture(row);
27724 
27725  return SCIP_OKAY;
27726 }
27727 
27728 /** decreases usage counter of LP row, and frees memory if necessary
27729  *
27730  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27731  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27732  *
27733  * @pre this method can be called in one of the following stages of the SCIP solving process:
27734  * - \ref SCIP_STAGE_INITSOLVE
27735  * - \ref SCIP_STAGE_SOLVING
27736  * - \ref SCIP_STAGE_EXITSOLVE
27737  */
27739  SCIP* scip, /**< SCIP data structure */
27740  SCIP_ROW** row /**< pointer to LP row */
27741  )
27742 {
27743  SCIP_CALL( checkStage(scip, "SCIPreleaseRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
27744 
27745  SCIP_CALL( SCIProwRelease(row, scip->mem->probmem, scip->set, scip->lp) );
27746 
27747  return SCIP_OKAY;
27748 }
27749 
27750 /** changes left hand side of LP row
27751  *
27752  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27753  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27754  *
27755  * @pre this method can be called in one of the following stages of the SCIP solving process:
27756  * - \ref SCIP_STAGE_INITSOLVE
27757  * - \ref SCIP_STAGE_SOLVING
27758  */
27760  SCIP* scip, /**< SCIP data structure */
27761  SCIP_ROW* row, /**< LP row */
27762  SCIP_Real lhs /**< new left hand side */
27763  )
27764 {
27765  SCIP_CALL( checkStage(scip, "SCIPchgRowLhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27766 
27767  assert(!SCIPlpDiving(scip->lp) || (row->lppos == -1));
27768 
27769  SCIP_CALL( SCIProwChgLhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, lhs) );
27770 
27771  return SCIP_OKAY;
27772 }
27773 
27774 /** changes right hand side of LP row
27775  *
27776  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27777  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27778  *
27779  * @pre this method can be called in one of the following stages of the SCIP solving process:
27780  * - \ref SCIP_STAGE_INITSOLVE
27781  * - \ref SCIP_STAGE_SOLVING
27782  */
27784  SCIP* scip, /**< SCIP data structure */
27785  SCIP_ROW* row, /**< LP row */
27786  SCIP_Real rhs /**< new right hand side */
27787  )
27788 {
27789  SCIP_CALL( checkStage(scip, "SCIPchgRowRhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27790 
27791  assert(!SCIPlpDiving(scip->lp) || (row->lppos == -1));
27792 
27793  SCIP_CALL( SCIProwChgRhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, rhs) );
27794 
27795  return SCIP_OKAY;
27796 }
27797 
27798 /** informs row, that all subsequent additions of variables to the row should be cached and not directly applied;
27799  * after all additions were applied, SCIPflushRowExtensions() must be called;
27800  * while the caching of row extensions is activated, information methods of the row give invalid results;
27801  * caching should be used, if a row is build with SCIPaddVarToRow() calls variable by variable to increase
27802  * the performance
27803  *
27804  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27805  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27806  *
27807  * @pre this method can be called in one of the following stages of the SCIP solving process:
27808  * - \ref SCIP_STAGE_INITSOLVE
27809  * - \ref SCIP_STAGE_SOLVING
27810  */
27812  SCIP* scip, /**< SCIP data structure */
27813  SCIP_ROW* row /**< LP row */
27814  )
27815 {
27816  SCIP_CALL( checkStage(scip, "SCIPcacheRowExtensions", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27817 
27818  /* delay the row sorting */
27819  SCIProwDelaySort(row);
27820 
27821  return SCIP_OKAY;
27822 }
27823 
27824 /** flushes all cached row extensions after a call of SCIPcacheRowExtensions() and merges coefficients with
27825  * equal columns into a single coefficient
27826  *
27827  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27828  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27829  *
27830  * @pre this method can be called in one of the following stages of the SCIP solving process:
27831  * - \ref SCIP_STAGE_INITSOLVE
27832  * - \ref SCIP_STAGE_SOLVING
27833  */
27835  SCIP* scip, /**< SCIP data structure */
27836  SCIP_ROW* row /**< LP row */
27837  )
27838 {
27839  SCIP_CALL( checkStage(scip, "SCIPflushRowExtensions", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27840 
27841  /* force the row sorting, and merge equal column entries */
27842  SCIProwForceSort(row, scip->set);
27843 
27844  return SCIP_OKAY;
27845 }
27846 
27847 /** resolves variable to columns and adds them with the coefficient to the row
27848  *
27849  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27850  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27851  *
27852  * @pre this method can be called in one of the following stages of the SCIP solving process:
27853  * - \ref SCIP_STAGE_INITSOLVE
27854  * - \ref SCIP_STAGE_SOLVING
27855  *
27856  * @note In case calling this method in the enforcement process of an lp solution, it might be that some variables,
27857  * that were not yet in the LP (e.g. dynamic columns) will change their lp solution value returned by SCIP.
27858  * For example, a variable, which has a negative objective value, that has no column in the lp yet, is in the lp solution
27859  * on its upper bound (variables with status SCIP_VARSTATUS_LOOSE are in an lp solution on it's best bound), but
27860  * creating the column, changes the solution value (variable than has status SCIP_VARSTATUS_COLUMN, and the
27861  * initialization sets the lp solution value) to 0.0. (This leads to the conclusion that, if a constraint was
27862  * violated, the linear relaxation might not be violated anymore.)
27863  */
27865  SCIP* scip, /**< SCIP data structure */
27866  SCIP_ROW* row, /**< LP row */
27867  SCIP_VAR* var, /**< problem variable */
27868  SCIP_Real val /**< value of coefficient */
27869  )
27870 {
27871  SCIP_CALL( checkStage(scip, "SCIPaddVarToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27872 
27873  SCIP_CALL( SCIPvarAddToRow(var, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp, row, val) );
27874 
27875  return SCIP_OKAY;
27876 }
27877 
27878 /** resolves variables to columns and adds them with the coefficients to the row;
27879  * this method caches the row extensions and flushes them afterwards to gain better performance
27880  *
27881  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27882  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27883  *
27884  * @pre this method can be called in one of the following stages of the SCIP solving process:
27885  * - \ref SCIP_STAGE_INITSOLVE
27886  * - \ref SCIP_STAGE_SOLVING
27887  */
27889  SCIP* scip, /**< SCIP data structure */
27890  SCIP_ROW* row, /**< LP row */
27891  int nvars, /**< number of variables to add to the row */
27892  SCIP_VAR** vars, /**< problem variables to add */
27893  SCIP_Real* vals /**< values of coefficients */
27894  )
27895 {
27896  int v;
27897 
27898  assert(nvars == 0 || vars != NULL);
27899  assert(nvars == 0 || vals != NULL);
27900 
27901  SCIP_CALL( checkStage(scip, "SCIPaddVarsToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27902 
27903  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
27904  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
27905 
27906  /* delay the row sorting */
27907  SCIProwDelaySort(row);
27908 
27909  /* add the variables to the row */
27910  for( v = 0; v < nvars; ++v )
27911  {
27912  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
27913  row, vals[v]) );
27914  }
27915 
27916  /* force the row sorting */
27917  SCIProwForceSort(row, scip->set);
27918 
27919  return SCIP_OKAY;
27920 }
27921 
27922 /** resolves variables to columns and adds them with the same single coefficient to the row;
27923  * this method caches the row extensions and flushes them afterwards to gain better performance
27924  *
27925  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27926  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27927  *
27928  * @pre this method can be called in one of the following stages of the SCIP solving process:
27929  * - \ref SCIP_STAGE_INITSOLVE
27930  * - \ref SCIP_STAGE_SOLVING
27931  */
27933  SCIP* scip, /**< SCIP data structure */
27934  SCIP_ROW* row, /**< LP row */
27935  int nvars, /**< number of variables to add to the row */
27936  SCIP_VAR** vars, /**< problem variables to add */
27937  SCIP_Real val /**< unique value of all coefficients */
27938  )
27939 {
27940  int v;
27941 
27942  assert(nvars == 0 || vars != NULL);
27943 
27944  SCIP_CALL( checkStage(scip, "SCIPaddVarsToRowSameCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27945 
27946  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
27947  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
27948 
27949  /* delay the row sorting */
27950  SCIProwDelaySort(row);
27951 
27952  /* add the variables to the row */
27953  for( v = 0; v < nvars; ++v )
27954  {
27955  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
27956  row, val) );
27957  }
27958 
27959  /* force the row sorting */
27960  SCIProwForceSort(row, scip->set);
27961 
27962  return SCIP_OKAY;
27963 }
27964 
27965 /** tries to find a value, such that all row coefficients, if scaled with this value become integral
27966  *
27967  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27968  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27969  *
27970  * @pre this method can be called in one of the following stages of the SCIP solving process:
27971  * - \ref SCIP_STAGE_INITSOLVE
27972  * - \ref SCIP_STAGE_SOLVING
27973  */
27975  SCIP* scip, /**< SCIP data structure */
27976  SCIP_ROW* row, /**< LP row */
27977  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
27978  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
27979  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
27980  SCIP_Real maxscale, /**< maximal allowed scalar */
27981  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
27982  SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */
27983  SCIP_Bool* success /**< stores whether returned value is valid */
27984  )
27985 {
27986  SCIP_CALL( checkStage(scip, "SCIPcalcRowIntegralScalar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27987 
27988  SCIP_CALL( SCIProwCalcIntegralScalar(row, scip->set, mindelta, maxdelta, maxdnom, maxscale,
27989  usecontvars, intscalar, success) );
27990 
27991  return SCIP_OKAY;
27992 }
27993 
27994 /** tries to scale row, s.t. all coefficients (of integer variables) become integral
27995  *
27996  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27997  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27998  *
27999  * @pre this method can be called in one of the following stages of the SCIP solving process:
28000  * - \ref SCIP_STAGE_INITSOLVE
28001  * - \ref SCIP_STAGE_SOLVING
28002  */
28004  SCIP* scip, /**< SCIP data structure */
28005  SCIP_ROW* row, /**< LP row */
28006  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
28007  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
28008  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
28009  SCIP_Real maxscale, /**< maximal value to scale row with */
28010  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
28011  SCIP_Bool* success /**< stores whether row could be made rational */
28012  )
28013 {
28014  SCIP_CALL( checkStage(scip, "SCIPmakeRowIntegral", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28015 
28016  SCIP_CALL( SCIProwMakeIntegral(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->stat, scip->lp, mindelta, maxdelta, maxdnom, maxscale,
28017  usecontvars, success) );
28018 
28019  return SCIP_OKAY;
28020 }
28021 
28022 /** marks a row to be not removable from the LP in the current node
28023  *
28024  * @pre this method can be called in the following stage of the SCIP solving process:
28025  * - \ref SCIP_STAGE_SOLVING
28026  */
28028  SCIP* scip, /**< SCIP data structure */
28029  SCIP_ROW* row /**< LP row */
28030  )
28031 {
28032  SCIP_CALL_ABORT( checkStage(scip, "SCIPmarkRowNotRemovableLocal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28033 
28034  SCIProwMarkNotRemovableLocal(row, scip->stat);
28035 }
28036 
28037 /** returns minimal absolute value of row vector's non-zero coefficients
28038  *
28039  * @return minimal absolute value of row vector's non-zero coefficients
28040  *
28041  * @pre this method can be called in one of the following stages of the SCIP solving process:
28042  * - \ref SCIP_STAGE_INITSOLVE
28043  * - \ref SCIP_STAGE_SOLVING
28044  */
28046  SCIP* scip, /**< SCIP data structure */
28047  SCIP_ROW* row /**< LP row */
28048  )
28049 {
28050  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMinCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28051 
28052  return SCIProwGetMinval(row, scip->set);
28053 }
28054 
28055 /** returns maximal absolute value of row vector's non-zero coefficients
28056  *
28057  * @return maximal absolute value of row vector's non-zero coefficients
28058  *
28059  * @pre this method can be called in one of the following stages of the SCIP solving process:
28060  * - \ref SCIP_STAGE_INITSOLVE
28061  * - \ref SCIP_STAGE_SOLVING
28062  */
28064  SCIP* scip, /**< SCIP data structure */
28065  SCIP_ROW* row /**< LP row */
28066  )
28067 {
28068  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMaxCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28069 
28070  return SCIProwGetMaxval(row, scip->set);
28071 }
28072 
28073 /** returns the minimal activity of a row w.r.t. the column's bounds
28074  *
28075  * @return the minimal activity of a row w.r.t. the column's bounds
28076  *
28077  * @pre this method can be called in one of the following stages of the SCIP solving process:
28078  * - \ref SCIP_STAGE_SOLVING
28079  */
28081  SCIP* scip, /**< SCIP data structure */
28082  SCIP_ROW* row /**< LP row */
28083  )
28084 {
28085  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMinActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28086 
28087  return SCIProwGetMinActivity(row, scip->set, scip->stat);
28088 }
28089 
28090 /** returns the maximal activity of a row w.r.t. the column's bounds
28091  *
28092  * @return the maximal activity of a row w.r.t. the column's bounds
28093  *
28094  * @pre this method can be called in one of the following stages of the SCIP solving process:
28095  * - \ref SCIP_STAGE_SOLVING
28096  */
28098  SCIP* scip, /**< SCIP data structure */
28099  SCIP_ROW* row /**< LP row */
28100  )
28101 {
28102  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMaxActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28103 
28104  return SCIProwGetMaxActivity(row, scip->set, scip->stat);
28105 }
28106 
28107 /** recalculates the activity of a row in the last LP solution
28108  *
28109  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28110  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28111  *
28112  * @pre this method can be called in one of the following stages of the SCIP solving process:
28113  * - \ref SCIP_STAGE_SOLVING
28114  */
28116  SCIP* scip, /**< SCIP data structure */
28117  SCIP_ROW* row /**< LP row */
28118  )
28119 {
28120  SCIP_CALL( checkStage(scip, "SCIPrecalcRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28121 
28122  SCIProwRecalcLPActivity(row, scip->stat);
28123 
28124  return SCIP_OKAY;
28125 }
28126 
28127 /** returns the activity of a row in the last LP solution
28128  *
28129  * @return activity of a row in the last LP solution
28130  *
28131  * @pre this method can be called in one of the following stages of the SCIP solving process:
28132  * - \ref SCIP_STAGE_SOLVING
28133  */
28135  SCIP* scip, /**< SCIP data structure */
28136  SCIP_ROW* row /**< LP row */
28137  )
28138 {
28139  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28140 
28141  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
28142 }
28143 
28144 /** returns the feasibility of a row in the last LP solution
28145  *
28146  * @return the feasibility of a row in the last LP solution: negative value means infeasibility
28147  *
28148  * @pre this method can be called in one of the following stages of the SCIP solving process:
28149  * - \ref SCIP_STAGE_SOLVING
28150  */
28152  SCIP* scip, /**< SCIP data structure */
28153  SCIP_ROW* row /**< LP row */
28154  )
28155 {
28156  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28157 
28158  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
28159 }
28160 
28161 /** recalculates the activity of a row for the current pseudo solution
28162  *
28163  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28164  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28165  *
28166  * @pre this method can be called in one of the following stages of the SCIP solving process:
28167  * - \ref SCIP_STAGE_SOLVING
28168  */
28170  SCIP* scip, /**< SCIP data structure */
28171  SCIP_ROW* row /**< LP row */
28172  )
28173 {
28174  SCIP_CALL( checkStage(scip, "SCIPrecalcRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28175 
28176  SCIProwRecalcPseudoActivity(row, scip->stat);
28177 
28178  return SCIP_OKAY;
28179 }
28180 
28181 /** returns the activity of a row for the current pseudo solution
28182  *
28183  * @return the activity of a row for the current pseudo solution
28184  *
28185  * @pre this method can be called in one of the following stages of the SCIP solving process:
28186  * - \ref SCIP_STAGE_SOLVING
28187  */
28189  SCIP* scip, /**< SCIP data structure */
28190  SCIP_ROW* row /**< LP row */
28191  )
28192 {
28193  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28194 
28195  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
28196 }
28197 
28198 /** returns the feasibility of a row for the current pseudo solution: negative value means infeasibility
28199  *
28200  * @return the feasibility of a row for the current pseudo solution: negative value means infeasibility
28201  *
28202  * @pre this method can be called in one of the following stages of the SCIP solving process:
28203  * - \ref SCIP_STAGE_SOLVING
28204  */
28206  SCIP* scip, /**< SCIP data structure */
28207  SCIP_ROW* row /**< LP row */
28208  )
28209 {
28210  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28211 
28212  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
28213 }
28214 
28215 /** recalculates the activity of a row in the last LP or pseudo solution
28216  *
28217  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28218  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28219  *
28220  * @pre this method can be called in one of the following stages of the SCIP solving process:
28221  * - \ref SCIP_STAGE_SOLVING
28222  */
28224  SCIP* scip, /**< SCIP data structure */
28225  SCIP_ROW* row /**< LP row */
28226  )
28227 {
28228  SCIP_CALL( checkStage(scip, "SCIPrecalcRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28229 
28230  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
28231  SCIProwRecalcLPActivity(row, scip->stat);
28232  else
28233  SCIProwRecalcPseudoActivity(row, scip->stat);
28234 
28235  return SCIP_OKAY;
28236 }
28237 
28238 /** returns the activity of a row in the last LP or pseudo solution
28239  *
28240  * @return the activity of a row in the last LP or pseudo solution
28241  *
28242  * @pre this method can be called in one of the following stages of the SCIP solving process:
28243  * - \ref SCIP_STAGE_SOLVING
28244  */
28246  SCIP* scip, /**< SCIP data structure */
28247  SCIP_ROW* row /**< LP row */
28248  )
28249 {
28250  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28251 
28252  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
28253  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
28254  else
28255  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
28256 }
28257 
28258 /** returns the feasibility of a row in the last LP or pseudo solution
28259  *
28260  * @return the feasibility of a row in the last LP or pseudo solution
28261  *
28262  * @pre this method can be called in one of the following stages of the SCIP solving process:
28263  * - \ref SCIP_STAGE_SOLVING
28264  */
28266  SCIP* scip, /**< SCIP data structure */
28267  SCIP_ROW* row /**< LP row */
28268  )
28269 {
28270  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28271 
28272  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
28273  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
28274  else
28275  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
28276 }
28277 
28278 /** returns the activity of a row for the given primal solution
28279  *
28280  * @return the activitiy of a row for the given primal solution
28281  *
28282  * @pre this method can be called in one of the following stages of the SCIP solving process:
28283  * - \ref SCIP_STAGE_SOLVING
28284  */
28286  SCIP* scip, /**< SCIP data structure */
28287  SCIP_ROW* row, /**< LP row */
28288  SCIP_SOL* sol /**< primal CIP solution */
28289  )
28290 {
28291  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28292 
28293  if( sol != NULL )
28294  return SCIProwGetSolActivity(row, scip->set, scip->stat, sol);
28295  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
28296  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
28297  else
28298  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
28299 }
28300 
28301 /** returns the feasibility of a row for the given primal solution
28302  *
28303  * @return the feasibility of a row for the given primal solution
28304  *
28305  * @pre this method can be called in one of the following stages of the SCIP solving process:
28306  * - \ref SCIP_STAGE_SOLVING
28307  */
28309  SCIP* scip, /**< SCIP data structure */
28310  SCIP_ROW* row, /**< LP row */
28311  SCIP_SOL* sol /**< primal CIP solution */
28312  )
28313 {
28314  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28315 
28316  if( sol != NULL )
28317  return SCIProwGetSolFeasibility(row, scip->set, scip->stat, sol);
28318  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
28319  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
28320  else
28321  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
28322 }
28323 
28324 /** output row to file stream via the message handler system
28325  *
28326  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28327  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28328  *
28329  * @pre this method can be called in one of the following stages of the SCIP solving process:
28330  * - \ref SCIP_STAGE_SOLVING
28331  * - \ref SCIP_STAGE_SOLVED
28332  * - \ref SCIP_STAGE_EXITSOLVE
28333  */
28335  SCIP* scip, /**< SCIP data structure */
28336  SCIP_ROW* row, /**< LP row */
28337  FILE* file /**< output file (or NULL for standard output) */
28338  )
28339 {
28340  assert(row != NULL);
28341 
28342  SCIP_CALL( checkStage(scip, "SCIPprintRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
28343 
28344  SCIProwPrint(row, scip->messagehdlr, file);
28345 
28346  return SCIP_OKAY;
28347 }
28348 
28349 
28350 /*
28351  * NLP methods
28352  */
28353 
28354 /** returns whether the NLP relaxation has been enabled
28355  *
28356  * If the NLP relaxation is enabled, then SCIP will construct the NLP relaxation when the solving process is about to begin.
28357  * To check whether an NLP is existing, use SCIPisNLPConstructed().
28358  *
28359  * @pre This method can be called if SCIP is in one of the following stages:
28360  * - \ref SCIP_STAGE_INITPRESOLVE
28361  * - \ref SCIP_STAGE_PRESOLVING
28362  * - \ref SCIP_STAGE_EXITPRESOLVE
28363  * - \ref SCIP_STAGE_PRESOLVED
28364  * - \ref SCIP_STAGE_INITSOLVE
28365  * - \ref SCIP_STAGE_SOLVING
28366  *
28367  * @see SCIPenableNLP
28368  */
28370  SCIP* scip /**< SCIP data structure */
28371  )
28372 {
28373  SCIP_CALL_ABORT( checkStage(scip, "SCIPisNLPEnabled", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28374 
28375  return scip->transprob->nlpenabled;
28376 }
28377 
28378 /** marks that there are constraints that are representable by nonlinear rows
28379  *
28380  * This method should be called by a constraint handler if it has constraints that have a representation as nonlinear rows.
28381  *
28382  * The function should be called before the branch-and-bound process is initialized, e.g., when presolve is exiting.
28383  *
28384  * @pre This method can be called if SCIP is in one of the following stages:
28385  * - \ref SCIP_STAGE_INITPRESOLVE
28386  * - \ref SCIP_STAGE_PRESOLVING
28387  * - \ref SCIP_STAGE_EXITPRESOLVE
28388  * - \ref SCIP_STAGE_PRESOLVED
28389  * - \ref SCIP_STAGE_INITSOLVE
28390  * - \ref SCIP_STAGE_SOLVING
28391  */
28393  SCIP* scip /**< SCIP data structure */
28394  )
28395 {
28396  SCIP_CALL_ABORT( checkStage(scip, "SCIPenableNLP", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28397 
28398  scip->transprob->nlpenabled = TRUE;
28399 }
28400 
28401 /** returns, whether an NLP has been constructed
28402  *
28403  * @pre This method can be called if SCIP is in one of the following stages:
28404  * - \ref SCIP_STAGE_INITSOLVE
28405  * - \ref SCIP_STAGE_SOLVING
28406  */
28408  SCIP* scip /**< SCIP data structure */
28409  )
28410 {
28411  SCIP_CALL_ABORT( checkStage(scip, "SCIPisNLPConstructed", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28412 
28413  return (scip->nlp != NULL);
28414 }
28415 
28416 /** returns whether the NLP has a continuous variable in a nonlinear term
28417  *
28418  * @pre This method can be called if SCIP is in one of the following stages:
28419  * - \ref SCIP_STAGE_INITSOLVE
28420  * - \ref SCIP_STAGE_SOLVING
28421  */
28423  SCIP* scip /**< SCIP data structure */
28424  )
28425 {
28426  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasNLPContinuousNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28427 
28428  if( scip->nlp == NULL )
28429  {
28430  SCIPerrorMessage("NLP has not been not constructed.\n");
28431  SCIPABORT();
28432  return FALSE; /*lint !e527*/
28433  }
28434 
28435  return SCIPnlpHasContinuousNonlinearity(scip->nlp);
28436 }
28437 
28438 /** gets current NLP variables along with the current number of NLP variables
28439  *
28440  * @pre This method can be called if SCIP is in one of the following stages:
28441  * - \ref SCIP_STAGE_INITSOLVE
28442  * - \ref SCIP_STAGE_SOLVING
28443  */
28445  SCIP* scip, /**< SCIP data structure */
28446  SCIP_VAR*** vars, /**< pointer to store the array of NLP variables, or NULL */
28447  int* nvars /**< pointer to store the number of NLP variables, or NULL */
28448  )
28449 {
28450  SCIP_CALL( checkStage(scip, "SCIPgetNLPVarsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28451 
28452  if( scip->nlp != NULL )
28453  {
28454  if( vars != NULL )
28455  *vars = SCIPnlpGetVars(scip->nlp);
28456  if( nvars != NULL )
28457  *nvars = SCIPnlpGetNVars(scip->nlp);
28458  }
28459  else
28460  {
28461  SCIPerrorMessage("NLP has not been constructed.\n");
28462  return SCIP_INVALIDCALL;
28463  }
28464 
28465  return SCIP_OKAY;
28466 }
28467 
28468 /** gets array with variables of the NLP
28469  *
28470  * @pre This method can be called if SCIP is in one of the following stages:
28471  * - \ref SCIP_STAGE_INITSOLVE
28472  * - \ref SCIP_STAGE_SOLVING
28473  */
28475  SCIP* scip /**< SCIP data structure */
28476  )
28477 {
28478  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28479 
28480  if( scip->nlp == NULL )
28481  {
28482  SCIPerrorMessage("NLP has not been constructed.\n");
28483  SCIPABORT();
28484  return NULL; /*lint !e527*/
28485  }
28486 
28487  return SCIPnlpGetVars(scip->nlp);
28488 }
28489 
28490 /** gets current number of variables in NLP
28491  *
28492  * @pre This method can be called if SCIP is in one of the following stages:
28493  * - \ref SCIP_STAGE_INITSOLVE
28494  * - \ref SCIP_STAGE_SOLVING
28495  */
28497  SCIP* scip /**< SCIP data structure */
28498  )
28499 {
28500  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNLPVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28501 
28502  if( scip->nlp == NULL )
28503  {
28504  SCIPerrorMessage("NLP has not been constructed.\n");
28505  SCIPABORT();
28506  return 0; /*lint !e527*/
28507  }
28508 
28509  return SCIPnlpGetNVars(scip->nlp);
28510 }
28511 
28512 /** computes for each variables the number of NLP rows in which the variable appears in a nonlinear var
28513  *
28514  * @pre This method can be called if SCIP is in one of the following stages:
28515  * - \ref SCIP_STAGE_INITSOLVE
28516  * - \ref SCIP_STAGE_SOLVING
28517  */
28519  SCIP* scip, /**< SCIP data structure */
28520  int* nlcount /**< an array of length at least SCIPnlpGetNVars() to store nonlinearity counts of variables */
28521  )
28522 {
28523  SCIP_CALL( checkStage(scip, "SCIPgetNLPVarsNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28524 
28525  if( scip->nlp == NULL )
28526  {
28527  SCIPerrorMessage("NLP has not been constructed.\n");
28528  return SCIP_INVALIDCALL;
28529  }
28530 
28531  SCIP_CALL( SCIPnlpGetVarsNonlinearity(scip->nlp, nlcount) );
28532 
28533  return SCIP_OKAY;
28534 }
28535 
28536 /** returns dual solution values associated with lower bounds of NLP variables
28537  *
28538  * @pre This method can be called if SCIP is in one of the following stages:
28539  * - \ref SCIP_STAGE_INITSOLVE
28540  * - \ref SCIP_STAGE_SOLVING
28541  */
28543  SCIP* scip /**< SCIP data structure */
28544  )
28545 {
28546  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVarsLbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28547 
28548  if( scip->nlp == NULL )
28549  {
28550  SCIPerrorMessage("NLP has not been constructed.\n");
28551  SCIPABORT();
28552  return NULL; /*lint !e527*/
28553  }
28554 
28555  return SCIPnlpGetVarsLbDualsol(scip->nlp);
28556 }
28557 
28558 /** returns dual solution values associated with upper bounds of NLP variables
28559  *
28560  * @pre This method can be called if SCIP is in one of the following stages:
28561  * - \ref SCIP_STAGE_INITSOLVE
28562  * - \ref SCIP_STAGE_SOLVING
28563  */
28565  SCIP* scip /**< SCIP data structure */
28566  )
28567 {
28568  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVarsUbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28569 
28570  if( scip->nlp == NULL )
28571  {
28572  SCIPerrorMessage("NLP has not been constructed.\n");
28573  SCIPABORT();
28574  return NULL; /*lint !e527*/
28575  }
28576 
28577  return SCIPnlpGetVarsUbDualsol(scip->nlp);
28578 }
28579 
28580 /** gets current NLP nonlinear rows along with the current number of NLP nonlinear rows
28581  *
28582  * @pre This method can be called if SCIP is in one of the following stages:
28583  * - \ref SCIP_STAGE_INITSOLVE
28584  * - \ref SCIP_STAGE_SOLVING
28585  */
28587  SCIP* scip, /**< SCIP data structure */
28588  SCIP_NLROW*** nlrows, /**< pointer to store the array of NLP nonlinear rows, or NULL */
28589  int* nnlrows /**< pointer to store the number of NLP nonlinear rows, or NULL */
28590  )
28591 {
28592  SCIP_CALL( checkStage(scip, "SCIPgetNLPNlRowsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28593 
28594  if( scip->nlp == NULL )
28595  {
28596  SCIPerrorMessage("NLP has not been constructed.\n");
28597  return SCIP_INVALIDCALL;
28598  }
28599 
28600  if( nlrows != NULL )
28601  *nlrows = SCIPnlpGetNlRows(scip->nlp);
28602  if( nnlrows != NULL )
28603  *nnlrows = SCIPnlpGetNNlRows(scip->nlp);
28604 
28605  return SCIP_OKAY;
28606 }
28607 
28608 /** gets array with nonlinear rows of the NLP
28609  *
28610  * @pre This method can be called if SCIP is in one of the following stages:
28611  * - \ref SCIP_STAGE_INITSOLVE
28612  * - \ref SCIP_STAGE_SOLVING
28613  */
28615  SCIP* scip /**< SCIP data structure */
28616  )
28617 {
28618  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28619 
28620  if( scip->nlp == NULL )
28621  {
28622  SCIPerrorMessage("NLP has not been constructed.\n");
28623  SCIPABORT();
28624  return NULL; /*lint !e527*/
28625  }
28626 
28627  return SCIPnlpGetNlRows(scip->nlp);
28628 }
28629 
28630 /** gets current number of nonlinear rows in NLP
28631  *
28632  * @pre This method can be called if SCIP is in one of the following stages:
28633  * - \ref SCIP_STAGE_INITSOLVE
28634  * - \ref SCIP_STAGE_SOLVING
28635  */
28637  SCIP* scip /**< SCIP data structure */
28638  )
28639 {
28640  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28641 
28642  if( scip->nlp == NULL )
28643  {
28644  SCIPerrorMessage("NLP has not been constructed.\n");
28645  SCIPABORT();
28646  return 0; /*lint !e527*/
28647  }
28648 
28649  return SCIPnlpGetNNlRows(scip->nlp);
28650 }
28651 
28652 /** adds a nonlinear row to the NLP. This row is captured by the NLP.
28653  *
28654  * @pre This method can be called if SCIP is in one of the following stages:
28655  * - \ref SCIP_STAGE_INITSOLVE
28656  * - \ref SCIP_STAGE_SOLVING
28657  */
28659  SCIP* scip, /**< SCIP data structure */
28660  SCIP_NLROW* nlrow /**< nonlinear row to add to NLP */
28661  )
28662 {
28663  SCIP_CALL( checkStage(scip, "SCIPaddNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28664 
28665  if( scip->nlp == NULL )
28666  {
28667  SCIPerrorMessage("NLP has not been constructed.\n");
28668  return SCIP_INVALIDCALL;
28669  }
28670 
28671  SCIP_CALL( SCIPnlpAddNlRow(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, nlrow) );
28672 
28673  return SCIP_OKAY;
28674 }
28675 
28676 /** makes sure that the NLP of the current node is flushed
28677  *
28678  * @pre This method can be called if SCIP is in one of the following stages:
28679  * - \ref SCIP_STAGE_INITSOLVE
28680  * - \ref SCIP_STAGE_SOLVING
28681  */
28683  SCIP* scip /**< SCIP data structure */
28684  )
28685 {
28686  SCIP_CALL( checkStage(scip, "SCIPflushNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28687 
28688  if( scip->nlp == NULL )
28689  {
28690  SCIPerrorMessage("NLP has not been constructed.\n");
28691  return SCIP_INVALIDCALL;
28692  }
28693 
28694  SCIP_CALL( SCIPnlpFlush(scip->nlp, scip->mem->probmem, scip->set) );
28695 
28696  return SCIP_OKAY;
28697 }
28698 
28699 /** sets or clears initial primal guess for NLP solution (start point for NLP solver)
28700  *
28701  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28702  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28703  *
28704  * @pre This method can be called if SCIP is in one of the following stages:
28705  * - \ref SCIP_STAGE_INITSOLVE
28706  * - \ref SCIP_STAGE_SOLVING
28707  */
28709  SCIP* scip, /**< SCIP data structure */
28710  SCIP_Real* initialguess /**< values of initial guess (corresponding to variables from SCIPgetNLPVarsData), or NULL to use no start point */
28711  )
28712 {
28713  SCIP_CALL( checkStage(scip, "SCIPsetNLPInitialGuess", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28714 
28715  if( scip->nlp == NULL )
28716  {
28717  SCIPerrorMessage("NLP has not been constructed.\n");
28718  return SCIP_INVALIDCALL;
28719  }
28720 
28721  SCIP_CALL( SCIPnlpSetInitialGuess(scip->nlp, SCIPblkmem(scip), initialguess) );
28722 
28723  return SCIP_OKAY;
28724 }
28725 
28726 /** sets initial primal guess for NLP solution (start point for NLP solver)
28727  *
28728  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28729  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28730  *
28731  * @pre This method can be called if SCIP is in one of the following stages:
28732  * - \ref SCIP_STAGE_INITSOLVE
28733  * - \ref SCIP_STAGE_SOLVING
28734  */
28736  SCIP* scip, /**< SCIP data structure */
28737  SCIP_SOL* sol /**< solution which values should be taken as initial guess, or NULL for LP solution */
28738  )
28739 {
28740  SCIP_Real* vals;
28741 
28742  SCIP_CALL( checkStage(scip, "SCIPsetNLPInitialGuessSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28743 
28744  if( scip->nlp == NULL )
28745  {
28746  SCIPerrorMessage("NLP has not been constructed.\n");
28747  return SCIP_INVALIDCALL;
28748  }
28749 
28750  SCIP_CALL( SCIPallocBufferArray(scip, &vals, SCIPnlpGetNVars(scip->nlp)) );
28751  SCIP_CALL( SCIPgetSolVals(scip, sol, SCIPnlpGetNVars(scip->nlp), SCIPnlpGetVars(scip->nlp), vals) );
28752  SCIP_CALL( SCIPnlpSetInitialGuess(scip->nlp, SCIPblkmem(scip), vals) );
28753  SCIPfreeBufferArray(scip, &vals);
28754 
28755  return SCIP_OKAY;
28756 }
28757 
28758 /** solves the current NLP
28759  *
28760  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28761  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28762  *
28763  * @pre This method can be called if SCIP is in one of the following stages:
28764  * - \ref SCIP_STAGE_INITSOLVE
28765  * - \ref SCIP_STAGE_SOLVING
28766  */
28768  SCIP* scip /**< SCIP data structure */
28769  )
28770 {
28771  SCIP_CALL( checkStage(scip, "SCIPsolveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28772 
28773  if( scip->nlp == NULL )
28774  {
28775  SCIPerrorMessage("NLP has not been constructed.\n");
28776  return SCIP_INVALIDCALL;
28777  }
28778 
28779  SCIP_CALL( SCIPnlpSolve(scip->nlp, SCIPblkmem(scip), scip->set, scip->messagehdlr, scip->stat) );
28780 
28781  return SCIP_OKAY;
28782 }
28783 
28784 /** gets solution status of current NLP
28785  *
28786  * @pre This method can be called if SCIP is in one of the following stages:
28787  * - \ref SCIP_STAGE_INITSOLVE
28788  * - \ref SCIP_STAGE_SOLVING
28789  */
28791  SCIP* scip /**< SCIP data structure */
28792  )
28793 {
28794  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPSolstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28795 
28796  if( scip->nlp == NULL )
28797  {
28798  SCIPerrorMessage("NLP has not been constructed.\n");
28799  SCIPABORT();
28800  return SCIP_NLPSOLSTAT_UNKNOWN; /*lint !e527*/
28801  }
28802 
28803  return SCIPnlpGetSolstat(scip->nlp);
28804 }
28805 
28806 /** gets termination status of last NLP solve
28807  *
28808  * @pre This method can be called if SCIP is in one of the following stages:
28809  * - \ref SCIP_STAGE_INITSOLVE
28810  * - \ref SCIP_STAGE_SOLVING
28811  */
28813  SCIP* scip /**< SCIP data structure */
28814  )
28815 {
28816  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPTermstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28817 
28818  if( scip->nlp == NULL )
28819  {
28820  SCIPerrorMessage("NLP has not been constructed.\n");
28821  SCIPABORT();
28822  return SCIP_NLPTERMSTAT_OTHER; /*lint !e527*/
28823  }
28824 
28825  return SCIPnlpGetTermstat(scip->nlp);
28826 }
28827 
28828 /** gives statistics (number of iterations, solving time, ...) of last NLP solve
28829  *
28830  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28831  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28832  *
28833  * @pre This method can be called if SCIP is in one of the following stages:
28834  * - \ref SCIP_STAGE_INITSOLVE
28835  * - \ref SCIP_STAGE_SOLVING
28836  */
28838  SCIP* scip, /**< SCIP data structure */
28839  SCIP_NLPSTATISTICS* statistics /**< pointer to store statistics */
28840  )
28841 {
28842  SCIP_CALL( checkStage(scip, "SCIPgetNLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28843 
28844  if( scip->nlp == NULL )
28845  {
28846  SCIPerrorMessage("NLP has not been constructed.\n");
28847  return SCIP_INVALIDCALL;
28848  }
28849 
28850  SCIP_CALL( SCIPnlpGetStatistics(scip->nlp, statistics) );
28851 
28852  return SCIP_OKAY;
28853 }
28854 
28855 /** gets objective value of current NLP
28856  *
28857  * @pre This method can be called if SCIP is in one of the following stages:
28858  * - \ref SCIP_STAGE_INITSOLVE
28859  * - \ref SCIP_STAGE_SOLVING
28860  */
28862  SCIP* scip /**< SCIP data structure */
28863  )
28864 {
28865  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28866 
28867  if( scip->nlp != NULL )
28868  {
28869  return SCIPnlpGetObjval(scip->nlp);
28870  }
28871  else
28872  {
28873  SCIPerrorMessage("NLP has not been constructed.\n");
28874  return SCIP_INVALID;
28875  }
28876 }
28877 
28878 /** indicates whether a feasible solution for the current NLP is available
28879  * thus, returns whether the solution status <= feasible
28880  *
28881  * @pre This method can be called if SCIP is in one of the following stages:
28882  * - \ref SCIP_STAGE_INITSOLVE
28883  * - \ref SCIP_STAGE_SOLVING
28884  */
28886  SCIP* scip /**< SCIP data structure */
28887  )
28888 {
28889  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasNLPSolution", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28890 
28891  if( scip->nlp == NULL )
28892  {
28893  SCIPerrorMessage("NLP has not been constructed.\n");
28894  SCIPABORT();
28895  return FALSE; /*lint !e527*/
28896  }
28897 
28898  return SCIPnlpHasSolution(scip->nlp);
28899 }
28900 
28901 /** gets fractional variables of last NLP solution along with solution values and fractionalities
28902  *
28903  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28904  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28905  *
28906  * @pre This method can be called if SCIP is in one of the following stages:
28907  * - \ref SCIP_STAGE_INITSOLVE
28908  * - \ref SCIP_STAGE_SOLVING
28909  */
28911  SCIP* scip, /**< SCIP data structure */
28912  SCIP_VAR*** fracvars, /**< pointer to store the array of NLP fractional variables, or NULL */
28913  SCIP_Real** fracvarssol, /**< pointer to store the array of NLP fractional variables solution values, or NULL */
28914  SCIP_Real** fracvarsfrac, /**< pointer to store the array of NLP fractional variables fractionalities, or NULL */
28915  int* nfracvars, /**< pointer to store the number of NLP fractional variables , or NULL */
28916  int* npriofracvars /**< pointer to store the number of NLP fractional variables with maximal branching priority, or NULL */
28917  )
28918 {
28919  SCIP_CALL( checkStage(scip, "SCIPgetNLPFracVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28920 
28921  if( scip->nlp == NULL )
28922  {
28923  SCIPerrorMessage("NLP has not been constructed.\n");
28924  return SCIP_INVALIDCALL;
28925  }
28926 
28927  SCIP_CALL( SCIPnlpGetFracVars(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, fracvars, fracvarssol, fracvarsfrac, nfracvars, npriofracvars) );
28928 
28929  return SCIP_OKAY;
28930 }
28931 
28932 /** gets integer parameter of NLP
28933  *
28934  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28935  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28936  *
28937  * @pre This method can be called if SCIP is in one of the following stages:
28938  * - \ref SCIP_STAGE_INITSOLVE
28939  * - \ref SCIP_STAGE_SOLVING
28940  */
28942  SCIP* scip, /**< SCIP data structure */
28943  SCIP_NLPPARAM type, /**< parameter number */
28944  int* ival /**< pointer to store the parameter value */
28945  )
28946 {
28947  SCIP_CALL( checkStage(scip, "SCIPgetNLPIntPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28948 
28949  if( scip->nlp == NULL )
28950  {
28951  SCIPerrorMessage("NLP has not been constructed.\n");
28952  return SCIP_INVALIDCALL;
28953  }
28954 
28955  SCIP_CALL( SCIPnlpGetIntPar(scip->nlp, type, ival) );
28956 
28957  return SCIP_OKAY;
28958 }
28959 
28960 /** sets integer parameter of NLP
28961  *
28962  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28963  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28964  *
28965  * @pre This method can be called if SCIP is in one of the following stages:
28966  * - \ref SCIP_STAGE_INITSOLVE
28967  * - \ref SCIP_STAGE_SOLVING
28968  */
28970  SCIP* scip, /**< SCIP data structure */
28971  SCIP_NLPPARAM type, /**< parameter number */
28972  int ival /**< parameter value */
28973  )
28974 {
28975  SCIP_CALL( checkStage(scip, "SCIPsetNLPIntPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28976 
28977  if( scip->nlp == NULL )
28978  {
28979  SCIPerrorMessage("NLP has not been constructed.\n");
28980  return SCIP_INVALIDCALL;
28981  }
28982 
28983  SCIP_CALL( SCIPnlpSetIntPar(scip->nlp, type, ival) );
28984 
28985  return SCIP_OKAY;
28986 }
28987 
28988 /** gets floating point parameter of NLP
28989  *
28990  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28991  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28992  *
28993  * @pre This method can be called if SCIP is in one of the following stages:
28994  * - \ref SCIP_STAGE_INITSOLVE
28995  * - \ref SCIP_STAGE_SOLVING
28996  */
28998  SCIP* scip, /**< SCIP data structure */
28999  SCIP_NLPPARAM type, /**< parameter number */
29000  SCIP_Real* dval /**< pointer to store the parameter value */
29001  )
29002 {
29003  SCIP_CALL( checkStage(scip, "SCIPgetNLPRealPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29004 
29005  if( scip->nlp == NULL )
29006  {
29007  SCIPerrorMessage("NLP has not been constructed.\n");
29008  return SCIP_INVALIDCALL;
29009  }
29010 
29011  SCIP_CALL( SCIPnlpGetRealPar(scip->nlp, type, dval) );
29012 
29013  return SCIP_OKAY;
29014 }
29015 
29016 /** sets floating point parameter of NLP
29017  *
29018  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29019  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29020  *
29021  * @pre This method can be called if SCIP is in one of the following stages:
29022  * - \ref SCIP_STAGE_INITSOLVE
29023  * - \ref SCIP_STAGE_SOLVING
29024  */
29026  SCIP* scip, /**< SCIP data structure */
29027  SCIP_NLPPARAM type, /**< parameter number */
29028  SCIP_Real dval /**< parameter value */
29029  )
29030 {
29031  SCIP_CALL( checkStage(scip, "SCIPsetNLPRealPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29032 
29033  if( scip->nlp == NULL )
29034  {
29035  SCIPerrorMessage("NLP has not been constructed.\n");
29036  return SCIP_INVALIDCALL;
29037  }
29038 
29039  SCIP_CALL( SCIPnlpSetRealPar(scip->nlp, type, dval) );
29040 
29041  return SCIP_OKAY;
29042 }
29043 
29044 /** gets string parameter of NLP
29045  *
29046  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29047  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29048  *
29049  * @pre This method can be called if SCIP is in one of the following stages:
29050  * - \ref SCIP_STAGE_INITSOLVE
29051  * - \ref SCIP_STAGE_SOLVING
29052  */
29054  SCIP* scip, /**< SCIP data structure */
29055  SCIP_NLPPARAM type, /**< parameter number */
29056  const char** sval /**< pointer to store the parameter value */
29057  )
29058 {
29059  SCIP_CALL( checkStage(scip, "SCIPgetNLPStringPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29060 
29061  if( scip->nlp == NULL )
29062  {
29063  SCIPerrorMessage("NLP has not been constructed.\n");
29064  return SCIP_INVALIDCALL;
29065  }
29066 
29067  SCIP_CALL( SCIPnlpGetStringPar(scip->nlp, type, sval) );
29068 
29069  return SCIP_OKAY;
29070 }
29071 
29072 /** sets string parameter of NLP
29073  *
29074  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29075  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29076  *
29077  * @pre This method can be called if SCIP is in one of the following stages:
29078  * - \ref SCIP_STAGE_INITSOLVE
29079  * - \ref SCIP_STAGE_SOLVING
29080  */
29082  SCIP* scip, /**< SCIP data structure */
29083  SCIP_NLPPARAM type, /**< parameter number */
29084  const char* sval /**< parameter value */
29085  )
29086 {
29087  SCIP_CALL( checkStage(scip, "SCIPsetNLPStringPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29088 
29089  if( scip->nlp == NULL )
29090  {
29091  SCIPerrorMessage("NLP has not been constructed.\n");
29092  return SCIP_INVALIDCALL;
29093  }
29094 
29095  SCIP_CALL( SCIPnlpSetStringPar(scip->nlp, type, sval) );
29096 
29097  return SCIP_OKAY;
29098 }
29099 
29100 /** writes current NLP to a file
29101  *
29102  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29103  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29104  *
29105  * @pre This method can be called if SCIP is in one of the following stages:
29106  * - \ref SCIP_STAGE_INITSOLVE
29107  * - \ref SCIP_STAGE_SOLVING
29108  */
29110  SCIP* scip, /**< SCIP data structure */
29111  const char* filename /**< file name */
29112  )
29113 {
29114  SCIP_CALL( checkStage(scip, "SCIPwriteNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29115 
29116  if( scip->nlp == NULL )
29117  {
29118  SCIPerrorMessage("NLP has not been constructed.\n");
29119  return SCIP_INVALIDCALL;
29120  }
29121 
29122  SCIP_CALL( SCIPnlpWrite(scip->nlp, scip->set, scip->messagehdlr, filename) );
29123 
29124  return SCIP_OKAY;
29125 }
29126 
29127 /** gets the NLP interface and problem used by the SCIP NLP;
29128  * with the NLPI and its problem you can use all of the methods defined in nlpi/nlpi.h;
29129  *
29130  * @warning You have to make sure, that the full internal state of the NLPI does not change or is recovered completely
29131  * after the end of the method that uses the NLPI. In particular, if you manipulate the NLP or its solution
29132  * (e.g. by calling one of the SCIPnlpiAdd...() or the SCIPnlpiSolve() method), you have to check in advance
29133  * whether the NLP is currently solved. If this is the case, you have to make sure, the internal solution
29134  * status is recovered completely at the end of your method. Additionally you have to resolve the NLP with
29135  * SCIPnlpiSolve() in order to reinstall the internal solution status.
29136  *
29137  * @warning Make also sure, that all parameter values that you have changed are set back to their original values.
29138  *
29139  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29140  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29141  *
29142  * @pre This method can be called if SCIP is in one of the following stages:
29143  * - \ref SCIP_STAGE_INITSOLVE
29144  * - \ref SCIP_STAGE_SOLVING
29145  */
29147  SCIP* scip, /**< SCIP data structure */
29148  SCIP_NLPI** nlpi, /**< pointer to store the NLP solver interface */
29149  SCIP_NLPIPROBLEM** nlpiproblem /**< pointer to store the NLP solver interface problem */
29150  )
29151 {
29152  assert(nlpi != NULL);
29153  assert(nlpiproblem != NULL);
29154 
29155  SCIP_CALL( checkStage(scip, "SCIPgetNLPI", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29156 
29157  if( scip->nlp == NULL )
29158  {
29159  SCIPerrorMessage("NLP has not been constructed.\n");
29160  return SCIP_INVALIDCALL;
29161  }
29162 
29163  *nlpi = SCIPnlpGetNLPI(scip->nlp);
29164  *nlpiproblem = SCIPnlpGetNLPIProblem(scip->nlp);
29165 
29166  return SCIP_OKAY;
29167 }
29168 
29169 
29170 /*
29171  * NLP diving methods
29172  */
29173 
29174 /**@name NLP Diving Methods */
29175 /**@{ */
29176 
29177 /** initiates NLP diving making methods SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), SCIPchgVarsBoundsDiveNLP(), and SCIPsolveDiveNLP() available
29178  *
29179  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29180  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29181  *
29182  * @pre This method can be called if SCIP is in one of the following stages:
29183  * - \ref SCIP_STAGE_INITSOLVE
29184  * - \ref SCIP_STAGE_SOLVING
29185  */
29187  SCIP* scip /**< SCIP data structure */
29188  )
29189 {
29190  SCIP_CALL( checkStage(scip, "SCIPstartDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29191 
29192  if( scip->nlp == NULL )
29193  {
29194  SCIPerrorMessage("NLP has not been constructed.\n");
29195  return SCIP_INVALIDCALL;
29196  }
29197 
29198  SCIP_CALL( SCIPnlpStartDive(scip->nlp, SCIPblkmem(scip), scip->set) );
29199 
29200  return SCIP_OKAY;
29201 }
29202 
29203 /** ends NLP diving
29204  *
29205  * Resets changes made by SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), and SCIPchgVarsBoundsDiveNLP().
29206  *
29207  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29208  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29209  *
29210  * @pre This method can be called if SCIP is in one of the following stages:
29211  * - \ref SCIP_STAGE_INITSOLVE
29212  * - \ref SCIP_STAGE_SOLVING
29213  */
29215  SCIP* scip /**< SCIP data structure */
29216  )
29217 {
29218  SCIP_CALL( checkStage(scip, "SCIPendDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29219 
29220  if( scip->nlp == NULL )
29221  {
29222  SCIPerrorMessage("NLP has not been constructed.\n");
29223  return SCIP_INVALIDCALL;
29224  }
29225 
29226  SCIP_CALL( SCIPnlpEndDive(scip->nlp, SCIPblkmem(scip), scip->set) );
29227 
29228  return SCIP_OKAY;
29229 }
29230 
29231 /** changes linear objective coefficient of a variable in diving NLP
29232  *
29233  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29234  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29235  *
29236  * @pre This method can be called if SCIP is in one of the following stages:
29237  * - \ref SCIP_STAGE_INITSOLVE
29238  * - \ref SCIP_STAGE_SOLVING
29239  */
29241  SCIP* scip, /**< SCIP data structure */
29242  SCIP_VAR* var, /**< variable which coefficient to change */
29243  SCIP_Real coef /**< new value for coefficient */
29244  )
29245 {
29246  SCIP_CALL( checkStage(scip, "SCIPchgVarObjDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29247 
29248  assert( var->scip == scip );
29249 
29250  if( scip->nlp == NULL )
29251  {
29252  SCIPerrorMessage("NLP has not been constructed.\n");
29253  return SCIP_INVALIDCALL;
29254  }
29255 
29256  SCIP_CALL( SCIPnlpChgVarObjDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, var, coef) );
29257 
29258  return SCIP_OKAY;
29259 }
29260 
29261 /** changes bounds of a variable in diving NLP
29262  *
29263  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29264  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29265  *
29266  * @pre This method can be called if SCIP is in one of the following stages:
29267  * - \ref SCIP_STAGE_INITSOLVE
29268  * - \ref SCIP_STAGE_SOLVING
29269  */
29271  SCIP* scip, /**< SCIP data structure */
29272  SCIP_VAR* var, /**< variable which bounds to change */
29273  SCIP_Real lb, /**< new lower bound */
29274  SCIP_Real ub /**< new upper bound */
29275  )
29276 {
29277  SCIP_CALL( checkStage(scip, "SCIPchgVarBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29278 
29279  assert( var->scip == scip );
29280 
29281  if( scip->nlp == NULL )
29282  {
29283  SCIPerrorMessage("NLP has not been constructed.\n");
29284  return SCIP_INVALIDCALL;
29285  }
29286 
29287  SCIP_CALL( SCIPnlpChgVarBoundsDive(scip->nlp, var, lb, ub) );
29288 
29289  return SCIP_OKAY;
29290 }
29291 
29292 /** changes bounds of a set of variables in diving NLP
29293  *
29294  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29295  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29296  *
29297  * @pre This method can be called if SCIP is in one of the following stages:
29298  * - \ref SCIP_STAGE_INITSOLVE
29299  * - \ref SCIP_STAGE_SOLVING
29300  */
29302  SCIP* scip, /**< SCIP data structure */
29303  int nvars, /**< number of variables which bounds to changes */
29304  SCIP_VAR** vars, /**< variables which bounds to change */
29305  SCIP_Real* lbs, /**< new lower bounds */
29306  SCIP_Real* ubs /**< new upper bounds */
29307  )
29308 {
29309  SCIP_CALL( checkStage(scip, "SCIPchgVarsBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29310 
29311  if( scip->nlp == NULL )
29312  {
29313  SCIPerrorMessage("NLP has not been constructed.\n");
29314  return SCIP_INVALIDCALL;
29315  }
29316 
29317  SCIP_CALL( SCIPnlpChgVarsBoundsDive(scip->nlp, scip->set, nvars, vars, lbs, ubs) );
29318 
29319  return SCIP_OKAY;
29320 }
29321 
29322 /** solves diving NLP
29323  *
29324  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29325  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29326  *
29327  * @pre This method can be called if SCIP is in one of the following stages:
29328  * - \ref SCIP_STAGE_INITSOLVE
29329  * - \ref SCIP_STAGE_SOLVING
29330  */
29332  SCIP* scip /**< SCIP data structure */
29333  )
29334 {
29335  SCIP_CALL( checkStage(scip, "SCIPsolveDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29336 
29337  if( scip->nlp == NULL )
29338  {
29339  SCIPerrorMessage("NLP has not been constructed.\n");
29340  return SCIP_INVALIDCALL;
29341  }
29342 
29343  SCIP_CALL( SCIPnlpSolveDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->messagehdlr, scip->stat) );
29344 
29345  return SCIP_OKAY;
29346 }
29347 
29348 /**@} */
29349 
29350 
29351 /*
29352  * NLP nonlinear row methods
29353  */
29354 
29355 /** creates and captures an NLP row
29356  *
29357  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29358  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29359  *
29360  * @pre This method can be called if SCIP is in one of the following stages:
29361  * - \ref SCIP_STAGE_PRESOLVED
29362  * - \ref SCIP_STAGE_INITSOLVE
29363  * - \ref SCIP_STAGE_SOLVING
29364  */
29366  SCIP* scip, /**< SCIP data structure */
29367  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
29368  const char* name, /**< name of nonlinear row */
29369  SCIP_Real constant, /**< constant */
29370  int nlinvars, /**< number of linear variables */
29371  SCIP_VAR** linvars, /**< linear variables, or NULL if nlinvars == 0 */
29372  SCIP_Real* lincoefs, /**< linear coefficients, or NULL if nlinvars == 0 */
29373  int nquadvars, /**< number variables in quadratic terms */
29374  SCIP_VAR** quadvars, /**< variables in quadratic terms, or NULL if nquadvars == 0 */
29375  int nquadelems, /**< number of elements in quadratic term */
29376  SCIP_QUADELEM* quadelems, /**< elements (i.e., monomials) in quadratic term, or NULL if nquadelems == 0 */
29377  SCIP_EXPRTREE* expression, /**< nonlinear expression, or NULL */
29378  SCIP_Real lhs, /**< left hand side */
29379  SCIP_Real rhs /**< right hand side */
29380  )
29381 {
29382  SCIP_CALL( checkStage(scip, "SCIPcreateNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29383 
29384  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set,
29385  name, constant, nlinvars, linvars, lincoefs, nquadvars, quadvars, nquadelems, quadelems, expression, lhs, rhs) );
29386 
29387  return SCIP_OKAY;
29388 }
29389 
29390 /** creates and captures an NLP nonlinear row without any coefficients
29391  *
29392  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29393  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29394  *
29395  * @pre This method can be called if SCIP is in one of the following stages:
29396  * - \ref SCIP_STAGE_PRESOLVED
29397  * - \ref SCIP_STAGE_INITSOLVE
29398  * - \ref SCIP_STAGE_SOLVING
29399  */
29401  SCIP* scip, /**< SCIP data structure */
29402  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
29403  const char* name, /**< name of nonlinear row */
29404  SCIP_Real lhs, /**< left hand side */
29405  SCIP_Real rhs /**< right hand side */
29406  )
29407 {
29408  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29409 
29410  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set,
29411  name, 0.0, 0, NULL, NULL, 0, NULL, 0, NULL, NULL, lhs, rhs) );
29412 
29413  return SCIP_OKAY;
29414 }
29415 
29416 /** creates and captures an NLP row from a linear row
29417  *
29418  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29419  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29420  *
29421  * @pre This method can be called if SCIP is in one of the following stages:
29422  * - \ref SCIP_STAGE_PRESOLVED
29423  * - \ref SCIP_STAGE_INITSOLVE
29424  * - \ref SCIP_STAGE_SOLVING
29425  */
29427  SCIP* scip, /**< SCIP data structure */
29428  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
29429  SCIP_ROW* row /**< the linear row to copy */
29430  )
29431 {
29432  SCIP_CALL( checkStage(scip, "SCIPcreateNlRowFromRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29433 
29434  SCIP_CALL( SCIPnlrowCreateFromRow(nlrow, scip->mem->probmem, scip->set, row) );
29435 
29436  return SCIP_OKAY;
29437 }
29438 
29439 /** increases usage counter of NLP nonlinear row
29440  *
29441  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29442  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29443  *
29444  * @pre This method can be called if SCIP is in one of the following stages:
29445  * - \ref SCIP_STAGE_PRESOLVED
29446  * - \ref SCIP_STAGE_INITSOLVE
29447  * - \ref SCIP_STAGE_SOLVING
29448  */
29450  SCIP* scip, /**< SCIP data structure */
29451  SCIP_NLROW* nlrow /**< nonlinear row to capture */
29452  )
29453 {
29454  SCIP_CALL( checkStage(scip, "SCIPcaptureNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29455 
29456  SCIPnlrowCapture(nlrow);
29457 
29458  return SCIP_OKAY;
29459 }
29460 
29461 /** decreases usage counter of NLP nonlinear row, and frees memory if necessary
29462  *
29463  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29464  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29465  *
29466  * @pre This method can be called if SCIP is in one of the following stages:
29467  * - \ref SCIP_STAGE_PRESOLVED
29468  * - \ref SCIP_STAGE_INITSOLVE
29469  * - \ref SCIP_STAGE_SOLVING
29470  * - \ref SCIP_STAGE_EXITSOLVE
29471  */
29473  SCIP* scip, /**< SCIP data structure */
29474  SCIP_NLROW** nlrow /**< pointer to nonlinear row */
29475  )
29476 {
29477  SCIP_CALL( checkStage(scip, "SCIPreleaseNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
29478 
29479  SCIP_CALL( SCIPnlrowRelease(nlrow, scip->mem->probmem, scip->set) );
29480 
29481  return SCIP_OKAY;
29482 }
29483 
29484 /** changes left hand side of NLP nonlinear row
29485  *
29486  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29487  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29488  *
29489  * @pre This method can be called if SCIP is in one of the following stages:
29490  * - \ref SCIP_STAGE_PRESOLVED
29491  * - \ref SCIP_STAGE_INITSOLVE
29492  * - \ref SCIP_STAGE_SOLVING
29493  */
29495  SCIP* scip, /**< SCIP data structure */
29496  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
29497  SCIP_Real lhs /**< new left hand side */
29498  )
29499 {
29500  SCIP_CALL( checkStage(scip, "SCIPchgNlRowLhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29501 
29502  SCIP_CALL( SCIPnlrowChgLhs(nlrow, scip->set, scip->stat, scip->nlp, lhs) );
29503 
29504  return SCIP_OKAY;
29505 }
29506 
29507 /** changes right hand side of NLP nonlinear row
29508  *
29509  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29510  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29511  *
29512  * @pre This method can be called if SCIP is in one of the following stages:
29513  * - \ref SCIP_STAGE_PRESOLVED
29514  * - \ref SCIP_STAGE_INITSOLVE
29515  * - \ref SCIP_STAGE_SOLVING
29516  */
29518  SCIP* scip, /**< SCIP data structure */
29519  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
29520  SCIP_Real rhs /**< new right hand side */
29521  )
29522 {
29523  SCIP_CALL( checkStage(scip, "SCIPchgNlRowRhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29524 
29525  SCIP_CALL( SCIPnlrowChgRhs(nlrow, scip->set, scip->stat, scip->nlp, rhs) );
29526 
29527  return SCIP_OKAY;
29528 }
29529 
29530 /** changes constant of NLP nonlinear row
29531  *
29532  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29533  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29534  *
29535  * @pre This method can be called if SCIP is in one of the following stages:
29536  * - \ref SCIP_STAGE_PRESOLVED
29537  * - \ref SCIP_STAGE_INITSOLVE
29538  * - \ref SCIP_STAGE_SOLVING
29539  */
29541  SCIP* scip, /**< SCIP data structure */
29542  SCIP_NLROW* nlrow, /**< NLP row */
29543  SCIP_Real constant /**< new value for constant */
29544  )
29545 {
29546  SCIP_CALL( checkStage(scip, "SCIPchgNlRowConstant", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29547 
29548  SCIP_CALL( SCIPnlrowChgConstant(nlrow, scip->set, scip->stat, scip->nlp, constant) );
29549 
29550  return SCIP_OKAY;
29551 }
29552 
29553 /** adds variable with a linear coefficient to the nonlinear row
29554  *
29555  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29556  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29557  *
29558  * @pre This method can be called if SCIP is in one of the following stages:
29559  * - \ref SCIP_STAGE_PRESOLVED
29560  * - \ref SCIP_STAGE_INITSOLVE
29561  * - \ref SCIP_STAGE_SOLVING
29562  */
29564  SCIP* scip, /**< SCIP data structure */
29565  SCIP_NLROW* nlrow, /**< NLP row */
29566  SCIP_VAR* var, /**< problem variable */
29567  SCIP_Real val /**< value of coefficient in linear part of row */
29568  )
29569 {
29570  SCIP_CALL( checkStage(scip, "SCIPaddLinearCoefToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29571 
29572  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, val) );
29573 
29574  return SCIP_OKAY;
29575 }
29576 
29577 /** adds variables with linear coefficients to the row
29578  *
29579  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29580  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29581  *
29582  * @pre This method can be called if SCIP is in one of the following stages:
29583  * - \ref SCIP_STAGE_PRESOLVED
29584  * - \ref SCIP_STAGE_INITSOLVE
29585  * - \ref SCIP_STAGE_SOLVING
29586  */
29588  SCIP* scip, /**< SCIP data structure */
29589  SCIP_NLROW* nlrow, /**< NLP row */
29590  int nvars, /**< number of variables to add to the row */
29591  SCIP_VAR** vars, /**< problem variables to add */
29592  SCIP_Real* vals /**< values of coefficients in linear part of row */
29593  )
29594 {
29595  int v;
29596 
29597  assert(nvars == 0 || vars != NULL);
29598  assert(nvars == 0 || vals != NULL);
29599 
29600  SCIP_CALL( checkStage(scip, "SCIPaddLinearCoefsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29601 
29602  /* add the variables to the row */
29603  for( v = 0; v < nvars; ++v )
29604  {
29605  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, vars[v], vals[v]) );
29606  }
29607 
29608  return SCIP_OKAY;
29609 }
29610 
29611 /** changes linear coefficient of a variables in a row
29612  *
29613  * Setting the coefficient to 0.0 means that it is removed from the row
29614  * the variable does not need to exists before.
29615  *
29616  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29617  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29618  *
29619  * @pre This method can be called if SCIP is in one of the following stages:
29620  * - \ref SCIP_STAGE_PRESOLVED
29621  * - \ref SCIP_STAGE_INITSOLVE
29622  * - \ref SCIP_STAGE_SOLVING
29623  */
29625  SCIP* scip, /**< SCIP data structure */
29626  SCIP_NLROW* nlrow, /**< NLP row */
29627  SCIP_VAR* var, /**< variable */
29628  SCIP_Real coef /**< new value of coefficient */
29629  )
29630 {
29631  assert(var != NULL);
29632 
29633  SCIP_CALL( checkStage(scip, "SCIPchgNlRowLinearCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29634 
29635  SCIP_CALL( SCIPnlrowChgLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, coef) );
29636 
29637  return SCIP_OKAY;
29638 }
29639 
29640 /** adds quadratic variable to the nonlinear row
29641  *
29642  * After adding a quadratic variable, it can be used to add quadratic elements.
29643  *
29644  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29645  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29646  *
29647  * @pre This method can be called if SCIP is in one of the following stages:
29648  * - \ref SCIP_STAGE_PRESOLVED
29649  * - \ref SCIP_STAGE_INITSOLVE
29650  * - \ref SCIP_STAGE_SOLVING
29651  */
29653  SCIP* scip, /**< SCIP data structure */
29654  SCIP_NLROW* nlrow, /**< NLP row */
29655  SCIP_VAR* var /**< problem variable */
29656  )
29657 {
29658  SCIP_CALL( checkStage(scip, "SCIPaddQuadVarToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29659 
29660  SCIP_CALL( SCIPnlrowAddQuadVar(nlrow, scip->mem->probmem, scip->set, var) );
29661 
29662  return SCIP_OKAY;
29663 }
29664 
29665 /** adds quadratic variables to the nonlinear row
29666  *
29667  * After adding quadratic variables, they can be used to add quadratic elements.
29668  *
29669  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29670  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29671  *
29672  * @pre This method can be called if SCIP is in one of the following stages:
29673  * - \ref SCIP_STAGE_PRESOLVED
29674  * - \ref SCIP_STAGE_INITSOLVE
29675  * - \ref SCIP_STAGE_SOLVING
29676  */
29678  SCIP* scip, /**< SCIP data structure */
29679  SCIP_NLROW* nlrow, /**< NLP row */
29680  int nvars, /**< number of problem variables */
29681  SCIP_VAR** vars /**< problem variables */
29682  )
29683 {
29684  int v;
29685 
29686  assert(nvars == 0 || vars != NULL);
29687 
29688  SCIP_CALL( checkStage(scip, "SCIPaddQuadVarsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29689 
29690  SCIP_CALL( SCIPnlrowEnsureQuadVarsSize(nlrow, scip->mem->probmem, scip->set, SCIPnlrowGetNQuadVars(nlrow) + nvars) );
29691  for( v = 0; v < nvars; ++v )
29692  {
29693  SCIP_CALL( SCIPnlrowAddQuadVar(nlrow, scip->mem->probmem, scip->set, vars[v]) );
29694  }
29695 
29696  return SCIP_OKAY;
29697 }
29698 
29699 /** add a quadratic element to the nonlinear row
29700  *
29701  * Variable indices of the quadratic element need to be relative to quadratic variables array of row.
29702  *
29703  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29704  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29705  *
29706  * @pre This method can be called if SCIP is in one of the following stages:
29707  * - \ref SCIP_STAGE_PRESOLVED
29708  * - \ref SCIP_STAGE_INITSOLVE
29709  * - \ref SCIP_STAGE_SOLVING
29710  */
29712  SCIP* scip, /**< SCIP data structure */
29713  SCIP_NLROW* nlrow, /**< NLP row */
29714  SCIP_QUADELEM quadelem /**< quadratic element */
29715  )
29716 {
29717  SCIP_CALL( checkStage(scip, "SCIPaddQuadElementToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29718 
29719  SCIP_CALL( SCIPnlrowAddQuadElement(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelem) );
29720 
29721  return SCIP_OKAY;
29722 }
29723 
29724 /** adds quadratic elements to the nonlinear row
29725  *
29726  * Variable indices of the quadratic elements need to be relative to quadratic variables array of row.
29727  *
29728  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29729  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29730  *
29731  * @pre This method can be called if SCIP is in one of the following stages:
29732  * - \ref SCIP_STAGE_PRESOLVED
29733  * - \ref SCIP_STAGE_INITSOLVE
29734  * - \ref SCIP_STAGE_SOLVING
29735  */
29737  SCIP* scip, /**< SCIP data structure */
29738  SCIP_NLROW* nlrow, /**< NLP row */
29739  int nquadelems, /**< number of quadratic elements */
29740  SCIP_QUADELEM* quadelems /**< quadratic elements */
29741  )
29742 {
29743  int v;
29744 
29745  assert(nquadelems == 0 || quadelems != NULL);
29746 
29747  SCIP_CALL( checkStage(scip, "SCIPaddQuadElementsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29748 
29749  SCIP_CALL( SCIPnlrowEnsureQuadElementsSize(nlrow, scip->mem->probmem, scip->set, SCIPnlrowGetNQuadElems(nlrow) + nquadelems) );
29750  for( v = 0; v < nquadelems; ++v )
29751  {
29752  SCIP_CALL( SCIPnlrowAddQuadElement(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelems[v]) );
29753  }
29754 
29755  return SCIP_OKAY;
29756 }
29757 
29758 /** changes coefficient in quadratic part of a row
29759  *
29760  * Setting the coefficient in the quadelement to 0.0 means that it is removed from the row
29761  * the element does not need to exists before.
29762  *
29763  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29764  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29765  *
29766  * @pre This method can be called if SCIP is in one of the following stages:
29767  * - \ref SCIP_STAGE_PRESOLVED
29768  * - \ref SCIP_STAGE_INITSOLVE
29769  * - \ref SCIP_STAGE_SOLVING
29770  */
29772  SCIP* scip, /**< SCIP data structure */
29773  SCIP_NLROW* nlrow, /**< NLP row */
29774  SCIP_QUADELEM quadelement /**< new quadratic element, or update for existing one */
29775  )
29776 {
29777  SCIP_CALL( checkStage(scip, "SCIPchgNlRowQuadElement", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29778 
29779  SCIP_CALL( SCIPnlrowChgQuadElem(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelement) );
29780 
29781  return SCIP_OKAY;
29782 }
29783 
29784 /** sets or deletes expression tree in the nonlinear row
29785  *
29786  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29787  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29788  *
29789  * @pre This method can be called if SCIP is in one of the following stages:
29790  * - \ref SCIP_STAGE_PRESOLVED
29791  * - \ref SCIP_STAGE_INITSOLVE
29792  * - \ref SCIP_STAGE_SOLVING
29793  */
29795  SCIP* scip, /**< SCIP data structure */
29796  SCIP_NLROW* nlrow, /**< NLP row */
29797  SCIP_EXPRTREE* exprtree /**< expression tree, or NULL */
29798  )
29799 {
29800  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtree", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29801 
29802  SCIP_CALL( SCIPnlrowChgExprtree(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, exprtree) );
29803 
29804  return SCIP_OKAY;
29805 }
29806 
29807 /** sets a parameter of expression tree in the nonlinear row
29808  *
29809  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29810  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29811  *
29812  * @pre This method can be called if SCIP is in one of the following stages:
29813  * - \ref SCIP_STAGE_PRESOLVED
29814  * - \ref SCIP_STAGE_INITSOLVE
29815  * - \ref SCIP_STAGE_SOLVING
29816  */
29818  SCIP* scip, /**< SCIP data structure */
29819  SCIP_NLROW* nlrow, /**< NLP row */
29820  int paramidx, /**< index of parameter in expression tree */
29821  SCIP_Real paramval /**< new value of parameter in expression tree */
29822  )
29823 {
29824  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtreeParam", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29825 
29826  SCIP_CALL( SCIPnlrowChgExprtreeParam(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, paramidx, paramval) );
29827 
29828  return SCIP_OKAY;
29829 }
29830 
29831 /** sets parameters of expression tree in the nonlinear row
29832  *
29833  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29834  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29835  *
29836  * @pre This method can be called if SCIP is in one of the following stages:
29837  * - \ref SCIP_STAGE_PRESOLVED
29838  * - \ref SCIP_STAGE_INITSOLVE
29839  * - \ref SCIP_STAGE_SOLVING
29840  */
29842  SCIP* scip, /**< SCIP data structure */
29843  SCIP_NLROW* nlrow, /**< NLP row */
29844  SCIP_Real* paramvals /**< new values of parameter in expression tree */
29845  )
29846 {
29847  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtreeParams", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29848 
29849  SCIP_CALL( SCIPnlrowChgExprtreeParams(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, paramvals) );
29850 
29851  return SCIP_OKAY;
29852 }
29853 
29854 /** recalculates the activity of a nonlinear row in the last NLP solution
29855  *
29856  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29857  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29858  *
29859  * @pre This method can be called if SCIP is in one of the following stages:
29860  * - \ref SCIP_STAGE_PRESOLVED
29861  * - \ref SCIP_STAGE_INITSOLVE
29862  * - \ref SCIP_STAGE_SOLVING
29863  */
29865  SCIP* scip, /**< SCIP data structure */
29866  SCIP_NLROW* nlrow /**< NLP nonlinear row */
29867  )
29868 {
29869  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29870 
29871  if( scip->nlp == NULL )
29872  {
29873  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
29874  return SCIP_INVALIDCALL;
29875  }
29876 
29877  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->set, scip->stat, scip->nlp) );
29878 
29879  return SCIP_OKAY;
29880 }
29881 
29882 /** returns the activity of a nonlinear row in the last NLP solution
29883  *
29884  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29885  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29886  *
29887  * @pre This method can be called if SCIP is in one of the following stages:
29888  * - \ref SCIP_STAGE_INITSOLVE
29889  * - \ref SCIP_STAGE_SOLVING
29890  */
29892  SCIP* scip, /**< SCIP data structure */
29893  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
29894  SCIP_Real* activity /**< pointer to store activity value */
29895  )
29896 {
29897  SCIP_CALL( checkStage(scip, "SCIPgetNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29898 
29899  if( scip->nlp == NULL )
29900  {
29901  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
29902  return SCIP_INVALIDCALL;
29903  }
29904 
29905  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
29906 
29907  return SCIP_OKAY;
29908 }
29909 
29910 /** gives the feasibility of a nonlinear row in the last NLP solution: negative value means infeasibility
29911  *
29912  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29913  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29914  *
29915  * @pre This method can be called if SCIP is in one of the following stages:
29916  * - \ref SCIP_STAGE_INITSOLVE
29917  * - \ref SCIP_STAGE_SOLVING
29918  */
29920  SCIP* scip, /**< SCIP data structure */
29921  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
29922  SCIP_Real* feasibility /**< pointer to store feasibility value */
29923  )
29924 {
29925  SCIP_CALL( checkStage(scip, "SCIPgetNlRowNLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29926 
29927  if( scip->nlp == NULL )
29928  {
29929  SCIPerrorMessage("do not have NLP for computing NLP feasibility\n");
29930  return SCIP_INVALIDCALL;
29931  }
29932 
29933  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
29934 
29935  return SCIP_OKAY;
29936 }
29937 
29938 /** recalculates the activity of a nonlinear row for the current pseudo solution
29939  *
29940  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29941  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29942  *
29943  * @pre This method can be called if SCIP is in one of the following stages:
29944  * - \ref SCIP_STAGE_INITSOLVE
29945  * - \ref SCIP_STAGE_SOLVING
29946  */
29948  SCIP* scip, /**< SCIP data structure */
29949  SCIP_NLROW* nlrow /**< NLP nonlinear row */
29950  )
29951 {
29952  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29953 
29954  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->set, scip->stat) );
29955 
29956  return SCIP_OKAY;
29957 }
29958 
29959 /** gives the activity of a nonlinear row for the current pseudo solution
29960  *
29961  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29962  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29963  *
29964  * @pre This method can be called if SCIP is in one of the following stages:
29965  * - \ref SCIP_STAGE_INITSOLVE
29966  * - \ref SCIP_STAGE_SOLVING
29967  */
29969  SCIP* scip, /**< SCIP data structure */
29970  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
29971  SCIP_Real* pseudoactivity /**< pointer to store pseudo activity value */
29972  )
29973 {
29974  SCIP_CALL( checkStage(scip, "SCIPgetNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29975 
29976  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, pseudoactivity) );
29977 
29978  return SCIP_OKAY;
29979 }
29980 
29981 /** gives the feasibility of a nonlinear row for the current pseudo solution: negative value means infeasibility
29982  *
29983  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29984  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29985  *
29986  * @pre This method can be called if SCIP is in one of the following stages:
29987  * - \ref SCIP_STAGE_INITSOLVE
29988  * - \ref SCIP_STAGE_SOLVING
29989  */
29991  SCIP* scip, /**< SCIP data structure */
29992  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
29993  SCIP_Real* pseudofeasibility /**< pointer to store pseudo feasibility value */
29994  )
29995 {
29996  SCIP_CALL( checkStage(scip, "SCIPgetNlRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29997 
29998  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, pseudofeasibility) );
29999 
30000  return SCIP_OKAY;
30001 }
30002 
30003 /** recalculates the activity of a nonlinear row in the last NLP or pseudo solution
30004  *
30005  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30006  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30007  *
30008  * @pre This method can be called if SCIP is in one of the following stages:
30009  * - \ref SCIP_STAGE_INITSOLVE
30010  * - \ref SCIP_STAGE_SOLVING
30011  */
30013  SCIP* scip, /**< SCIP data structure */
30014  SCIP_NLROW* nlrow /**< NLP nonlinear row */
30015  )
30016 {
30017  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30018 
30019  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
30020  {
30021  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->set, scip->stat, scip->nlp) );
30022  }
30023  else
30024  {
30025  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->set, scip->stat) );
30026  }
30027 
30028  return SCIP_OKAY;
30029 }
30030 
30031 /** gives the activity of a nonlinear row in the last NLP or pseudo solution
30032  *
30033  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30034  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30035  *
30036  * @pre This method can be called if SCIP is in one of the following stages:
30037  * - \ref SCIP_STAGE_INITSOLVE
30038  * - \ref SCIP_STAGE_SOLVING
30039  */
30041  SCIP* scip, /**< SCIP data structure */
30042  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
30043  SCIP_Real* activity /**< pointer to store activity value */
30044  )
30045 {
30046  SCIP_CALL( checkStage(scip, "SCIPgetNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30047 
30048  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
30049  {
30050  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
30051  }
30052  else
30053  {
30054  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, activity) );
30055  }
30056 
30057  return SCIP_OKAY;
30058 }
30059 
30060 /** gives the feasibility of a nonlinear row in the last NLP or pseudo solution
30061  *
30062  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30063  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30064  *
30065  * @pre This method can be called if SCIP is in one of the following stages:
30066  * - \ref SCIP_STAGE_INITSOLVE
30067  * - \ref SCIP_STAGE_SOLVING
30068  */
30070  SCIP* scip, /**< SCIP data structure */
30071  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
30072  SCIP_Real* feasibility /**< pointer to store feasibility value */
30073  )
30074 {
30075  SCIP_CALL( checkStage(scip, "SCIPgetNlRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30076 
30077  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
30078  {
30079  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
30080  }
30081  else
30082  {
30083  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, feasibility) );
30084  }
30085 
30086  return SCIP_OKAY;
30087 }
30088 
30089 /** gives the activity of a nonlinear row for the given primal solution or NLP solution or pseudo solution
30090  *
30091  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30092  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30093  *
30094  * @pre This method can be called if SCIP is in one of the following stages:
30095  * - \ref SCIP_STAGE_INITSOLVE
30096  * - \ref SCIP_STAGE_SOLVING
30097  */
30099  SCIP* scip, /**< SCIP data structure */
30100  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
30101  SCIP_SOL* sol, /**< primal CIP solution, or NULL for NLP solution of pseudo solution */
30102  SCIP_Real* activity /**< pointer to store activity value */
30103  )
30104 {
30105  SCIP_CALL( checkStage(scip, "SCIPgetNlRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30106 
30107  if( sol != NULL )
30108  {
30109  SCIP_CALL( SCIPnlrowGetSolActivity(nlrow, scip->set, scip->stat, sol, activity) );
30110  }
30111  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
30112  {
30113  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
30114  }
30115  else
30116  {
30117  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, activity) );
30118  }
30119 
30120  return SCIP_OKAY;
30121 }
30122 
30123 /** gives the feasibility of a nonlinear row for the given primal solution
30124  *
30125  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30126  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30127  *
30128  * @pre This method can be called if SCIP is in one of the following stages:
30129  * - \ref SCIP_STAGE_INITSOLVE
30130  * - \ref SCIP_STAGE_SOLVING
30131  */
30133  SCIP* scip, /**< SCIP data structure */
30134  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
30135  SCIP_SOL* sol, /**< primal CIP solution */
30136  SCIP_Real* feasibility /**< pointer to store feasibility value */
30137  )
30138 {
30139  SCIP_CALL( checkStage(scip, "SCIPgetNlRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30140 
30141  if( sol != NULL )
30142  {
30143  SCIP_CALL( SCIPnlrowGetSolFeasibility(nlrow, scip->set, scip->stat, sol, feasibility) );
30144  }
30145  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
30146  {
30147  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
30148  }
30149  else
30150  {
30151  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, feasibility) );
30152  }
30153 
30154  return SCIP_OKAY;
30155 }
30156 
30157 /** gives the minimal and maximal activity of a nonlinear row w.r.t. the variable's bounds
30158  *
30159  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30160  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30161  *
30162  * @pre This method can be called if SCIP is in one of the following stages:
30163  * - \ref SCIP_STAGE_PRESOLVED
30164  * - \ref SCIP_STAGE_INITSOLVE
30165  * - \ref SCIP_STAGE_SOLVING
30166  */
30168  SCIP* scip, /**< SCIP data structure */
30169  SCIP_NLROW* nlrow, /**< NLP row */
30170  SCIP_Real* minactivity, /**< buffer to store minimal activity, or NULL */
30171  SCIP_Real* maxactivity /**< buffer to store maximal activity, or NULL */
30172  )
30173 {
30174  SCIP_CALL( checkStage(scip, "SCIPgetNlRowActivityBounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30175 
30176  SCIP_CALL( SCIPnlrowGetActivityBounds(nlrow, scip->set, scip->stat, minactivity, maxactivity) );
30177 
30178  return SCIP_OKAY;
30179 }
30180 
30181 /** output nonlinear row to file stream
30182  *
30183  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30184  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30185  *
30186  * @pre This method can be called if SCIP is in one of the following stages:
30187  * - \ref SCIP_STAGE_PRESOLVED
30188  * - \ref SCIP_STAGE_INITSOLVE
30189  * - \ref SCIP_STAGE_SOLVING
30190  */
30192  SCIP* scip, /**< SCIP data structure */
30193  SCIP_NLROW* nlrow, /**< NLP row */
30194  FILE* file /**< output file (or NULL for standard output) */
30195  )
30196 {
30197  assert(nlrow != NULL);
30198 
30199  SCIP_CALL( checkStage(scip, "SCIPprintNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30200 
30201  SCIP_CALL( SCIPnlrowPrint(nlrow, scip->messagehdlr, file) );
30202 
30203  return SCIP_OKAY;
30204 }
30205 
30206 /**@name Expression tree methods */
30207 /**@{ */
30208 
30209 /** translate from one value of infinity to another
30210  *
30211  * if val is >= infty1, then give infty2, else give val
30212  */
30213 #define infty2infty(infty1, infty2, val) (val >= infty1 ? infty2 : val)
30214 
30215 /** replaces array of variables in expression tree by corresponding transformed variables
30216  *
30217  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30218  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30219  *
30220  * @pre This method can be called if @p scip is in one of the following stages:
30221  * - \ref SCIP_STAGE_TRANSFORMING
30222  * - \ref SCIP_STAGE_TRANSFORMED
30223  * - \ref SCIP_STAGE_INITPRESOLVE
30224  * - \ref SCIP_STAGE_PRESOLVING
30225  * - \ref SCIP_STAGE_EXITPRESOLVE
30226  * - \ref SCIP_STAGE_PRESOLVED
30227  * - \ref SCIP_STAGE_INITSOLVE
30228  * - \ref SCIP_STAGE_SOLVING
30229  * - \ref SCIP_STAGE_SOLVED
30230  * - \ref SCIP_STAGE_EXITSOLVE
30231  * - \ref SCIP_STAGE_FREETRANS
30232  *
30233  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
30234  */
30236  SCIP* scip, /**< SCIP data structure */
30237  SCIP_EXPRTREE* tree /**< expression tree */
30238  )
30239 {
30240  assert(scip != NULL);
30241  assert(tree != NULL);
30242 
30243  SCIP_CALL( checkStage(scip, "SCIPgetExprtreeTransformedVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
30244 
30245  if( SCIPexprtreeGetNVars(tree) == 0 )
30246  return SCIP_OKAY;
30247 
30249 
30250  return SCIP_OKAY;
30251 }
30252 
30253 /** evaluates an expression tree for a primal solution or LP solution
30254  *
30255  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30256  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30257  *
30258  * @pre This method can be called if @p scip is in one of the following stages:
30259  * - \ref SCIP_STAGE_PROBLEM
30260  * - \ref SCIP_STAGE_TRANSFORMING
30261  * - \ref SCIP_STAGE_TRANSFORMED
30262  * - \ref SCIP_STAGE_INITPRESOLVE
30263  * - \ref SCIP_STAGE_PRESOLVING
30264  * - \ref SCIP_STAGE_EXITPRESOLVE
30265  * - \ref SCIP_STAGE_PRESOLVED
30266  * - \ref SCIP_STAGE_INITSOLVE
30267  * - \ref SCIP_STAGE_SOLVING
30268  * - \ref SCIP_STAGE_SOLVED
30269  * - \ref SCIP_STAGE_EXITSOLVE
30270  * - \ref SCIP_STAGE_FREETRANS
30271  *
30272  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
30273  */
30275  SCIP* scip, /**< SCIP data structure */
30276  SCIP_EXPRTREE* tree, /**< expression tree */
30277  SCIP_SOL* sol, /**< a solution, or NULL for current LP solution */
30278  SCIP_Real* val /**< buffer to store value */
30279  )
30280 {
30281  SCIP_Real* varvals;
30282  int nvars;
30283 
30284  assert(scip != NULL);
30285  assert(tree != NULL);
30286  assert(val != NULL);
30287 
30288  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
30289 
30290  nvars = SCIPexprtreeGetNVars(tree);
30291 
30292  if( nvars == 0 )
30293  {
30294  SCIP_CALL( SCIPexprtreeEval(tree, NULL, val) );
30295  return SCIP_OKAY;
30296  }
30297 
30298  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
30299  SCIP_CALL( SCIPgetSolVals(scip, sol, nvars, SCIPexprtreeGetVars(tree), varvals) );
30300 
30301  SCIP_CALL( SCIPexprtreeEval(tree, varvals, val) );
30302 
30303  SCIPfreeBufferArray(scip, &varvals);
30304 
30305  return SCIP_OKAY;
30306 }
30307 
30308 /** evaluates an expression tree w.r.t. current global bounds
30309  *
30310  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30311  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30312  *
30313  * @pre This method can be called if @p scip is in one of the following stages:
30314  * - \ref SCIP_STAGE_PROBLEM
30315  * - \ref SCIP_STAGE_TRANSFORMING
30316  * - \ref SCIP_STAGE_TRANSFORMED
30317  * - \ref SCIP_STAGE_INITPRESOLVE
30318  * - \ref SCIP_STAGE_PRESOLVING
30319  * - \ref SCIP_STAGE_EXITPRESOLVE
30320  * - \ref SCIP_STAGE_PRESOLVED
30321  * - \ref SCIP_STAGE_INITSOLVE
30322  * - \ref SCIP_STAGE_SOLVING
30323  * - \ref SCIP_STAGE_SOLVED
30324  * - \ref SCIP_STAGE_EXITSOLVE
30325  * - \ref SCIP_STAGE_FREETRANS
30326  *
30327  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
30328  */
30330  SCIP* scip, /**< SCIP data structure */
30331  SCIP_EXPRTREE* tree, /**< expression tree */
30332  SCIP_Real infinity, /**< value to use for infinity */
30333  SCIP_INTERVAL* val /**< buffer to store result */
30334  )
30335 {
30336  SCIP_INTERVAL* varvals;
30337  SCIP_VAR** vars;
30338  int nvars;
30339  int i;
30340 
30341  assert(scip != NULL);
30342  assert(tree != NULL);
30343  assert(val != NULL);
30344 
30345  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeGlobalBounds", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
30346 
30347  nvars = SCIPexprtreeGetNVars(tree);
30348 
30349  if( nvars == 0 )
30350  {
30351  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, NULL, val) );
30352  return SCIP_OKAY;
30353  }
30354 
30355  vars = SCIPexprtreeGetVars(tree);
30356  assert(vars != NULL);
30357 
30358  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
30359  for( i = 0; i < nvars; ++i )
30360  {
30361  SCIPintervalSetBounds(&varvals[i],
30362  -infty2infty(SCIPinfinity(scip), infinity, -SCIPvarGetLbGlobal(vars[i])), /*lint !e666*/
30363  infty2infty(SCIPinfinity(scip), infinity, SCIPvarGetUbGlobal(vars[i]))); /*lint !e666*/
30364  }
30365 
30366  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, varvals, val) );
30367 
30368  SCIPfreeBufferArray(scip, &varvals);
30369 
30370  return SCIP_OKAY;
30371 }
30372 
30373 /** evaluates an expression tree w.r.t. current local bounds
30374  *
30375  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30376  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30377  *
30378  * @pre This method can be called if @p scip is in one of the following stages:
30379  * - \ref SCIP_STAGE_PROBLEM
30380  * - \ref SCIP_STAGE_TRANSFORMING
30381  * - \ref SCIP_STAGE_TRANSFORMED
30382  * - \ref SCIP_STAGE_INITPRESOLVE
30383  * - \ref SCIP_STAGE_PRESOLVING
30384  * - \ref SCIP_STAGE_EXITPRESOLVE
30385  * - \ref SCIP_STAGE_PRESOLVED
30386  * - \ref SCIP_STAGE_INITSOLVE
30387  * - \ref SCIP_STAGE_SOLVING
30388  * - \ref SCIP_STAGE_SOLVED
30389  * - \ref SCIP_STAGE_EXITSOLVE
30390  * - \ref SCIP_STAGE_FREETRANS
30391  *
30392  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
30393  */
30395  SCIP* scip, /**< SCIP data structure */
30396  SCIP_EXPRTREE* tree, /**< expression tree */
30397  SCIP_Real infinity, /**< value to use for infinity */
30398  SCIP_INTERVAL* val /**< buffer to store result */
30399  )
30400 {
30401  SCIP_INTERVAL* varvals;
30402  SCIP_VAR** vars;
30403  int nvars;
30404  int i;
30405 
30406  assert(scip != NULL);
30407  assert(tree != NULL);
30408  assert(val != NULL);
30409 
30410  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeLocalBounds", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
30411 
30412  nvars = SCIPexprtreeGetNVars(tree);
30413 
30414  if( nvars == 0 )
30415  {
30416  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, NULL, val) );
30417  return SCIP_OKAY;
30418  }
30419 
30420  vars = SCIPexprtreeGetVars(tree);
30421  assert(vars != NULL);
30422 
30423  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
30424  for( i = 0; i < nvars; ++i )
30425  {
30426  /* due to numerics, the lower bound on a variable in SCIP can be slightly higher than the upper bound
30427  * in this case, we take the most conservative way and switch the bounds
30428  * further, we translate SCIP's value for infinity to the users value for infinity
30429  */
30430  SCIPintervalSetBounds(&varvals[i],
30431  -infty2infty(SCIPinfinity(scip), infinity, -MIN(SCIPvarGetLbLocal(vars[i]), SCIPvarGetUbLocal(vars[i]))), /*lint !e666*/
30432  infty2infty(SCIPinfinity(scip), infinity, MAX(SCIPvarGetLbLocal(vars[i]), SCIPvarGetUbLocal(vars[i])))); /*lint !e666*/
30433  }
30434 
30435  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, varvals, val) );
30436 
30437  SCIPfreeBufferArray(scip, &varvals);
30438 
30439  return SCIP_OKAY;
30440 }
30441 
30442 #undef infty2infty
30443 
30444 /**@} */
30445 
30446 /*
30447  * nonlinear methods
30448  */
30449 
30450 /**@name Nonlinear Methods */
30451 /**@{ */
30452 
30453 /** computes coefficients of linearization of a square term in a reference point */
30455  SCIP* scip, /**< SCIP data structure */
30456  SCIP_Real sqrcoef, /**< coefficient of square term */
30457  SCIP_Real refpoint, /**< point where to linearize */
30458  SCIP_Bool isint, /**< whether corresponding variable is a discrete variable, and thus linearization could be moved */
30459  SCIP_Real* lincoef, /**< buffer to add coefficient of linearization */
30460  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
30461  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
30462  )
30463 {
30464  assert(scip != NULL);
30465  assert(lincoef != NULL);
30466  assert(linconstant != NULL);
30467  assert(success != NULL);
30468 
30469  if( sqrcoef == 0.0 )
30470  return;
30471 
30472  if( SCIPisInfinity(scip, REALABS(refpoint)) )
30473  {
30474  *success = FALSE;
30475  return;
30476  }
30477 
30478  if( !isint || SCIPisIntegral(scip, refpoint) )
30479  {
30480  SCIP_Real tmp;
30481 
30482  /* sqrcoef * x^2 -> tangent in refpoint = sqrcoef * 2 * refpoint * (x - refpoint) */
30483 
30484  tmp = sqrcoef * refpoint;
30485 
30486  if( SCIPisInfinity(scip, 2.0 * REALABS(tmp)) )
30487  {
30488  *success = FALSE;
30489  return;
30490  }
30491 
30492  *lincoef += 2.0 * tmp;
30493  tmp *= refpoint;
30494  *linconstant -= tmp;
30495  }
30496  else
30497  {
30498  /* sqrcoef * x^2 -> secant between f=floor(refpoint) and f+1 = sqrcoef * (f^2 + ((f+1)^2 - f^2) * (x-f))
30499  * = sqrcoef * (-f*(f+1) + (2*f+1)*x)
30500  */
30501  SCIP_Real f;
30502  SCIP_Real coef;
30503  SCIP_Real constant;
30504 
30505  f = SCIPfloor(scip, refpoint);
30506 
30507  coef = sqrcoef * (2.0 * f + 1.0);
30508  constant = -sqrcoef * f * (f + 1.0);
30509 
30510  if( SCIPisInfinity(scip, REALABS(coef)) || SCIPisInfinity(scip, REALABS(constant)) )
30511  {
30512  *success = FALSE;
30513  return;
30514  }
30515 
30516  *lincoef += coef;
30517  *linconstant += constant;
30518  }
30519 }
30520 
30521 /** computes coefficients of secant of a square term */
30523  SCIP* scip, /**< SCIP data structure */
30524  SCIP_Real sqrcoef, /**< coefficient of square term */
30525  SCIP_Real lb, /**< lower bound on variable */
30526  SCIP_Real ub, /**< upper bound on variable */
30527  SCIP_Real refpoint, /**< point for which to compute value of linearization */
30528  SCIP_Real* lincoef, /**< buffer to add coefficient of secant */
30529  SCIP_Real* linconstant, /**< buffer to add constant of secant */
30530  SCIP_Bool* success /**< buffer to set to FALSE if secant has failed due to large numbers or unboundedness */
30531  )
30532 {
30533  SCIP_Real coef;
30534  SCIP_Real constant;
30535 
30536  assert(scip != NULL);
30537  assert(!SCIPisInfinity(scip, lb));
30538  assert(!SCIPisInfinity(scip, -ub));
30539  assert(SCIPisLE(scip, lb, ub));
30540  assert(SCIPisLE(scip, lb, refpoint));
30541  assert(SCIPisGE(scip, ub, refpoint));
30542  assert(lincoef != NULL);
30543  assert(linconstant != NULL);
30544  assert(success != NULL);
30545 
30546  if( sqrcoef == 0.0 )
30547  return;
30548 
30549  if( SCIPisInfinity(scip, -lb) || SCIPisInfinity(scip, ub) )
30550  {
30551  /* unboundedness */
30552  *success = FALSE;
30553  return;
30554  }
30555 
30556  /* sqrcoef * x^2 -> sqrcoef * (lb * lb + (ub*ub - lb*lb)/(ub-lb) * (x-lb)) = sqrcoef * (lb*lb + (ub+lb)*(x-lb))
30557  * = sqrcoef * ((lb+ub)*x - lb*ub)
30558  */
30559  coef = sqrcoef * (lb + ub);
30560  constant = -sqrcoef * lb * ub;
30561  if( SCIPisInfinity(scip, REALABS(coef)) || SCIPisInfinity(scip, REALABS(constant)) )
30562  {
30563  *success = FALSE;
30564  return;
30565  }
30566 
30567  *lincoef += coef;
30568  *linconstant += constant;
30569 }
30570 
30571 /** computes coefficients of linearization of a bilinear term in a reference point */
30573  SCIP* scip, /**< SCIP data structure */
30574  SCIP_Real bilincoef, /**< coefficient of bilinear term */
30575  SCIP_Real refpointx, /**< point where to linearize first variable */
30576  SCIP_Real refpointy, /**< point where to linearize second variable */
30577  SCIP_Real* lincoefx, /**< buffer to add coefficient of first variable in linearization */
30578  SCIP_Real* lincoefy, /**< buffer to add coefficient of second variable in linearization */
30579  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
30580  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
30581  )
30582 {
30583  SCIP_Real constant;
30584 
30585  assert(scip != NULL);
30586  assert(lincoefx != NULL);
30587  assert(lincoefy != NULL);
30588  assert(linconstant != NULL);
30589  assert(success != NULL);
30590 
30591  if( bilincoef == 0.0 )
30592  return;
30593 
30594  if( SCIPisInfinity(scip, REALABS(refpointx)) || SCIPisInfinity(scip, REALABS(refpointy)) )
30595  {
30596  *success = FALSE;
30597  return;
30598  }
30599 
30600  /* bilincoef * x * y -> bilincoef * (refpointx * refpointy + refpointy * (x - refpointx) + refpointx * (y - refpointy))
30601  * = -bilincoef * refpointx * refpointy + bilincoef * refpointy * x + bilincoef * refpointx * y
30602  */
30603 
30604  constant = -bilincoef * refpointx * refpointy;
30605 
30606  if( SCIPisInfinity(scip, REALABS(bilincoef * refpointx)) || SCIPisInfinity(scip, REALABS(bilincoef * refpointy))
30607  || SCIPisInfinity(scip, REALABS(constant)) )
30608  {
30609  *success = FALSE;
30610  return;
30611  }
30612 
30613  *lincoefx += bilincoef * refpointy;
30614  *lincoefy += bilincoef * refpointx;
30615  *linconstant += constant;
30616 }
30617 
30618 /** computes coefficients of McCormick under- or overestimation of a bilinear term */
30620  SCIP* scip, /**< SCIP data structure */
30621  SCIP_Real bilincoef, /**< coefficient of bilinear term */
30622  SCIP_Real lbx, /**< lower bound on first variable */
30623  SCIP_Real ubx, /**< upper bound on first variable */
30624  SCIP_Real refpointx, /**< reference point for first variable */
30625  SCIP_Real lby, /**< lower bound on second variable */
30626  SCIP_Real uby, /**< upper bound on second variable */
30627  SCIP_Real refpointy, /**< reference point for second variable */
30628  SCIP_Bool overestimate, /**< whether to compute an overestimator instead of an underestimator */
30629  SCIP_Real* lincoefx, /**< buffer to add coefficient of first variable in linearization */
30630  SCIP_Real* lincoefy, /**< buffer to add coefficient of second variable in linearization */
30631  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
30632  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
30633  )
30634 {
30635  SCIP_Real constant;
30636  SCIP_Real coefx;
30637  SCIP_Real coefy;
30638 
30639  assert(scip != NULL);
30640  assert(!SCIPisInfinity(scip, lbx));
30641  assert(!SCIPisInfinity(scip, -ubx));
30642  assert(!SCIPisInfinity(scip, lby));
30643  assert(!SCIPisInfinity(scip, -uby));
30644  assert(SCIPisLE(scip, lbx, ubx));
30645  assert(SCIPisLE(scip, lby, uby));
30646  assert(SCIPisLE(scip, lbx, refpointx));
30647  assert(SCIPisGE(scip, ubx, refpointx));
30648  assert(SCIPisLE(scip, lby, refpointy));
30649  assert(SCIPisGE(scip, uby, refpointy));
30650  assert(lincoefx != NULL);
30651  assert(lincoefy != NULL);
30652  assert(linconstant != NULL);
30653  assert(success != NULL);
30654 
30655  if( bilincoef == 0.0 )
30656  return;
30657 
30658  if( overestimate )
30659  bilincoef = -bilincoef;
30660 
30661  if( SCIPisRelEQ(scip, lbx, ubx) && SCIPisRelEQ(scip, lby, uby) )
30662  {
30663  /* both x and y are mostly fixed */
30664  SCIP_Real cand1;
30665  SCIP_Real cand2;
30666  SCIP_Real cand3;
30667  SCIP_Real cand4;
30668 
30669  coefx = 0.0;
30670  coefy = 0.0;
30671 
30672  /* estimate x * y by constant */
30673  cand1 = lbx * lby;
30674  cand2 = lbx * uby;
30675  cand3 = ubx * lby;
30676  cand4 = ubx * uby;
30677 
30678  /* take most conservative value for underestimator */
30679  if( bilincoef < 0.0 )
30680  constant = bilincoef * MAX( MAX(cand1, cand2), MAX(cand3, cand4) );
30681  else
30682  constant = bilincoef * MIN( MIN(cand1, cand2), MIN(cand3, cand4) );
30683  }
30684  else if( bilincoef > 0.0 )
30685  {
30686  /* either x or y is not fixed and coef > 0.0 */
30687  if( !SCIPisInfinity(scip, -lbx) && !SCIPisInfinity(scip, -lby) &&
30688  (SCIPisInfinity(scip, ubx) || SCIPisInfinity(scip, uby)
30689  || (uby - refpointy) * (ubx - refpointx) >= (refpointy - lby) * (refpointx - lbx)) )
30690  {
30691  if( SCIPisRelEQ(scip, lbx, ubx) )
30692  {
30693  /* x*y = lbx * y + (x-lbx) * y >= lbx * y + (x-lbx) * lby >= lbx * y + min{(ubx-lbx) * lby, 0 * lby} */
30694  coefx = 0.0;
30695  coefy = bilincoef * lbx;
30696  constant = bilincoef * (lby < 0.0 ? (ubx-lbx) * lby : 0.0);
30697  }
30698  else if( SCIPisRelEQ(scip, lby, uby) )
30699  {
30700  /* x*y = lby * x + (y-lby) * x >= lby * x + (y-lby) * lbx >= lby * x + min{(uby-lby) * lbx, 0 * lbx} */
30701  coefx = bilincoef * lby;
30702  coefy = 0.0;
30703  constant = bilincoef * (lbx < 0.0 ? (uby-lby) * lbx : 0.0);
30704  }
30705  else
30706  {
30707  coefx = bilincoef * lby;
30708  coefy = bilincoef * lbx;
30709  constant = -bilincoef * lbx * lby;
30710  }
30711  }
30712  else if( !SCIPisInfinity(scip, ubx) && !SCIPisInfinity(scip, uby) )
30713  {
30714  if( SCIPisRelEQ(scip, lbx, ubx) )
30715  {
30716  /* x*y = ubx * y + (x-ubx) * y >= ubx * y + (x-ubx) * uby >= ubx * y + min{(lbx-ubx) * uby, 0 * uby} */
30717  coefx = 0.0;
30718  coefy = bilincoef * ubx;
30719  constant = bilincoef * (uby > 0.0 ? (lbx-ubx) * uby : 0.0);
30720  }
30721  else if( SCIPisRelEQ(scip, lby, uby) )
30722  {
30723  /* x*y = uby * x + (y-uby) * x >= uby * x + (y-uby) * ubx >= uby * x + min{(lby-uby) * ubx, 0 * ubx} */
30724  coefx = bilincoef * uby;
30725  coefy = 0.0;
30726  constant = bilincoef * (ubx > 0.0 ? (lby-uby) * ubx : 0.0);
30727  }
30728  else
30729  {
30730  coefx = bilincoef * uby;
30731  coefy = bilincoef * ubx;
30732  constant = -bilincoef * ubx * uby;
30733  }
30734  }
30735  else
30736  {
30737  *success = FALSE;
30738  return;
30739  }
30740  }
30741  else
30742  {
30743  /* either x or y is not fixed and coef < 0.0 */
30744  if( !SCIPisInfinity(scip, ubx) && !SCIPisInfinity(scip, -lby) &&
30745  (SCIPisInfinity(scip, -lbx) || SCIPisInfinity(scip, uby)
30746  || (ubx - lbx) * (refpointy - lby) <= (uby - lby) * (refpointx - lbx)) )
30747  {
30748  if( SCIPisRelEQ(scip, lbx, ubx) )
30749  {
30750  /* x*y = ubx * y + (x-ubx) * y <= ubx * y + (x-ubx) * lby <= ubx * y + max{(lbx-ubx) * lby, 0 * lby} */
30751  coefx = 0.0;
30752  coefy = bilincoef * ubx;
30753  constant = bilincoef * (lby < 0.0 ? (lbx - ubx) * lby : 0.0);
30754  }
30755  else if( SCIPisRelEQ(scip, lby, uby) )
30756  {
30757  /* x*y = lby * x + (y-lby) * x <= lby * x + (y-lby) * ubx <= lby * x + max{(uby-lby) * ubx, 0 * ubx} */
30758  coefx = bilincoef * lby;
30759  coefy = 0.0;
30760  constant = bilincoef * (ubx > 0.0 ? (uby - lby) * ubx : 0.0);
30761  }
30762  else
30763  {
30764  coefx = bilincoef * lby;
30765  coefy = bilincoef * ubx;
30766  constant = -bilincoef * ubx * lby;
30767  }
30768  }
30769  else if( !SCIPisInfinity(scip, -lbx) && !SCIPisInfinity(scip, uby) )
30770  {
30771  if( SCIPisRelEQ(scip, lbx, ubx) )
30772  {
30773  /* x*y = lbx * y + (x-lbx) * y <= lbx * y + (x-lbx) * uby <= lbx * y + max{(ubx-lbx) * uby, 0 * uby} */
30774  coefx = 0.0;
30775  coefy = bilincoef * lbx;
30776  constant = bilincoef * (uby > 0.0 ? (ubx-lbx) * uby : 0.0);
30777  }
30778  else if( SCIPisRelEQ(scip, lby, uby) )
30779  {
30780  /* x*y = uby * x + (y-uby) * x <= uby * x + (y-uby) * lbx <= uby * x + max{(lby-uby) * lbx, 0 * lbx} */
30781  coefx = bilincoef * uby;
30782  coefy = 0.0;
30783  constant = bilincoef * (lbx < 0.0 ? (lby-uby) * lbx : 0.0);
30784  }
30785  else
30786  {
30787  coefx = bilincoef * uby;
30788  coefy = bilincoef * lbx;
30789  constant = -bilincoef * lbx * uby;
30790  }
30791  }
30792  else
30793  {
30794  *success = FALSE;
30795  return;
30796  }
30797  }
30798 
30799  if( SCIPisInfinity(scip, REALABS(coefx)) || SCIPisInfinity(scip, REALABS(coefy))
30800  || SCIPisInfinity(scip, REALABS(constant)) )
30801  {
30802  *success = FALSE;
30803  return;
30804  }
30805 
30806  if( overestimate )
30807  {
30808  coefx = -coefx;
30809  coefy = -coefy;
30810  constant = -constant;
30811  }
30812 
30813  SCIPdebugMessage("%.20g * x[%.20g,%.20g] * y[%.20g,%.20g] %c= %.20g * x %+.20g * y %+.20g\n", bilincoef, lbx, ubx,
30814  lby, uby, overestimate ? '<' : '>', coefx, coefy, constant);
30815 
30816  *lincoefx += coefx;
30817  *lincoefy += coefy;
30818  *linconstant += constant;
30819 }
30820 
30821 /**@} */
30822 
30823 /*
30824  * cutting plane methods
30825  */
30826 
30827 /** returns efficacy of the cut with respect to the given primal solution or the current LP solution:
30828  * e = -feasibility/norm
30829  *
30830  * @return the efficacy of the cut with respect to the given primal solution or the current LP solution:
30831  * e = -feasibility/norm
30832  *
30833  * @pre This method can be called if @p scip is in one of the following stages:
30834  * - \ref SCIP_STAGE_SOLVING
30835  */
30837  SCIP* scip, /**< SCIP data structure */
30838  SCIP_SOL* sol, /**< primal CIP solution, or NULL for current LP solution */
30839  SCIP_ROW* cut /**< separated cut */
30840  )
30841 {
30842  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutEfficacy", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30843 
30844  if( sol == NULL )
30845  return SCIProwGetLPEfficacy(cut, scip->set, scip->stat, scip->lp);
30846  else
30847  return SCIProwGetSolEfficacy(cut, scip->set, scip->stat, sol);
30848 }
30849 
30850 /** returns whether the cut's efficacy with respect to the given primal solution or the current LP solution is greater
30851  * than the minimal cut efficacy
30852  *
30853  * @return TRUE if the cut's efficacy with respect to the given primal solution or the current LP solution is greater
30854  * than the minimal cut efficacy, otherwise FALSE
30855  *
30856  * @pre This method can be called if @p scip is in one of the following stages:
30857  * - \ref SCIP_STAGE_SOLVING
30858  */
30860  SCIP* scip, /**< SCIP data structure */
30861  SCIP_SOL* sol, /**< primal CIP solution, or NULL for current LP solution */
30862  SCIP_ROW* cut /**< separated cut */
30863  )
30864 {
30865  SCIP_CALL_ABORT( checkStage(scip, "SCIPisCutEfficacious", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30866 
30867  if( sol == NULL )
30868  return SCIProwIsLPEfficacious(cut, scip->set, scip->stat, scip->lp, (SCIPtreeGetCurrentDepth(scip->tree) == 0));
30869  else
30870  return SCIProwIsSolEfficacious(cut, scip->set, scip->stat, sol, (SCIPtreeGetCurrentDepth(scip->tree) == 0));
30871 }
30872 
30873 /** checks, if the given cut's efficacy is larger than the minimal cut efficacy
30874  *
30875  * @return TRUE if the given cut's efficacy is larger than the minimal cut efficacy, otherwise FALSE
30876  */
30878  SCIP* scip, /**< SCIP data structure */
30879  SCIP_Real efficacy /**< efficacy of the cut */
30880  )
30881 {
30882  assert(scip != NULL);
30883 
30884  return SCIPsetIsEfficacious(scip->set, (SCIPtreeGetCurrentDepth(scip->tree) == 0), efficacy);
30885 }
30886 
30887 /** calculates the efficacy norm of the given vector, which depends on the "separating/efficacynorm" parameter
30888  *
30889  * @return the efficacy norm of the given vector, which depends on the "separating/efficacynorm" parameter
30890  */
30892  SCIP* scip, /**< SCIP data structure */
30893  SCIP_Real* vals, /**< array of values */
30894  int nvals /**< number of values */
30895  )
30896 {
30897  SCIP_Real norm;
30898  int i;
30899 
30900  assert(scip != NULL);
30901  assert(scip->set != NULL);
30902 
30903  norm = 0.0;
30904  switch( scip->set->sepa_efficacynorm )
30905  {
30906  case 'e':
30907  for( i = 0; i < nvals; ++i )
30908  norm += SQR(vals[i]);
30909  norm = SQRT(norm);
30910  break;
30911  case 'm':
30912  for( i = 0; i < nvals; ++i )
30913  {
30914  SCIP_Real absval;
30915 
30916  absval = REALABS(vals[i]);
30917  norm = MAX(norm, absval);
30918  }
30919  break;
30920  case 's':
30921  for( i = 0; i < nvals; ++i )
30922  norm += REALABS(vals[i]);
30923  break;
30924  case 'd':
30925  for( i = 0; i < nvals; ++i )
30926  {
30927  if( !SCIPisZero(scip, vals[i]) )
30928  {
30929  norm = 1.0;
30930  break;
30931  }
30932  }
30933  break;
30934  default:
30935  SCIPerrorMessage("invalid efficacy norm parameter '%c'\n", scip->set->sepa_efficacynorm);
30936  assert(FALSE);
30937  }
30938 
30939  return norm;
30940 }
30941 
30942 /** indicates whether a cut is applicable, i.e., will modify the LP when applied
30943  *
30944  * @pre This method can be called if @p scip is in one of the following stages:
30945  * - \ref SCIP_STAGE_SOLVING
30946  *
30947  * @return whether the cut is modifiable, not a bound change, or a bound change that changes bounds by at least epsilon
30948  */
30950  SCIP* scip, /**< SCIP data structure */
30951  SCIP_ROW* cut /**< separated cut */
30952  )
30953 {
30954  SCIP_CALL_ABORT( checkStage(scip, "SCIPisCutApplicable", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30955 
30956  return SCIPsepastoreIsCutApplicable(scip->set, cut);
30957 }
30958 
30959 /** adds cut to separation storage
30960  *
30961  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30962  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30963  *
30964  * @pre This method can be called if @p scip is in one of the following stages:
30965  * - \ref SCIP_STAGE_SOLVING
30966  */
30968  SCIP* scip, /**< SCIP data structure */
30969  SCIP_SOL* sol, /**< primal solution that was separated, or NULL for LP solution */
30970  SCIP_ROW* cut, /**< separated cut */
30971  SCIP_Bool forcecut, /**< should the cut be forced to enter the LP? */
30972  SCIP_Bool* infeasible /**< pointer to store whether cut has been detected to be infeasible for local bounds */
30973  )
30974 {
30975  SCIP_CALL( checkStage(scip, "SCIPaddCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30976 
30977  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
30978 
30979  SCIP_CALL( SCIPsepastoreAddCut(scip->sepastore, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
30980  scip->eventfilter, scip->lp, sol, cut, forcecut, (SCIPtreeGetCurrentDepth(scip->tree) == 0), infeasible) );
30981 
30982  /* possibly run conflict analysis */
30983  if ( *infeasible && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && SCIPisConflictAnalysisApplicable(scip) )
30984  {
30985  SCIP_Real act;
30986  SCIP_VAR* var;
30987  SCIP_Real val;
30988  int ncols;
30989  int j;
30990 
30991  /* initialize conflict analysis */
30993 
30994  if ( ! SCIPisInfinity(scip, -cut->lhs) )
30995  {
30996  act = SCIProwGetMaxActivity(cut, scip->set, scip->stat);
30997  if ( SCIPisLT(scip, act, cut->lhs) )
30998  {
30999  ncols = SCIProwGetNNonz(cut);
31000  for (j = 0; j < ncols; ++j)
31001  {
31002  val = cut->vals[j];
31003  if ( ! SCIPisZero(scip, val) )
31004  {
31005  var = SCIPcolGetVar(cut->cols[j]);
31006  assert( var != NULL );
31007 
31008  if ( val > 0.0 )
31009  {
31010  SCIP_CALL( SCIPaddConflictUb(scip, var, NULL) );
31011  }
31012  else
31013  {
31014  SCIP_CALL( SCIPaddConflictLb(scip, var, NULL) );
31015  }
31016  }
31017  }
31018  }
31019  }
31020  else if ( ! SCIPisInfinity(scip, cut->rhs) )
31021  {
31022  act = SCIProwGetMinActivity(cut, scip->set, scip->stat);
31023  if ( SCIPisGT(scip, act, cut->rhs) )
31024  {
31025  ncols = SCIProwGetNNonz(cut);
31026  for (j = 0; j < ncols; ++j)
31027  {
31028  val = cut->vals[j];
31029  if ( ! SCIPisZero(scip, val) )
31030  {
31031  var = SCIPcolGetVar(cut->cols[j]);
31032  assert( var != NULL );
31033 
31034  if ( val > 0.0 )
31035  {
31036  SCIP_CALL( SCIPaddConflictLb(scip, var, NULL) );
31037  }
31038  else
31039  {
31040  SCIP_CALL( SCIPaddConflictUb(scip, var, NULL) );
31041  }
31042  }
31043  }
31044  }
31045  }
31046 
31047  /* analyze the conflict */
31049  }
31050 
31051  return SCIP_OKAY;
31052 }
31053 
31054 /** if not already existing, adds row to global cut pool
31055  *
31056  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31057  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31058  *
31059  * @pre This method can be called if @p scip is in one of the following stages:
31060  * - \ref SCIP_STAGE_SOLVING
31061  */
31063  SCIP* scip, /**< SCIP data structure */
31064  SCIP_ROW* row /**< cutting plane to add */
31065  )
31066 {
31067  SCIP_CALL( checkStage(scip, "SCIPaddPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31068 
31069  SCIP_CALL( SCIPcutpoolAddRow(scip->cutpool, scip->mem->probmem, scip->set, row) );
31070 
31071  return SCIP_OKAY;
31072 }
31073 
31074 /** removes the row from the global cut pool
31075  *
31076  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31077  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31078  *
31079  * @pre This method can be called if @p scip is in one of the following stages:
31080  * - \ref SCIP_STAGE_SOLVING
31081  */
31083  SCIP* scip, /**< SCIP data structure */
31084  SCIP_ROW* row /**< cutting plane to add */
31085  )
31086 {
31087  SCIP_CALL( checkStage(scip, "SCIPdelPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31088 
31089  SCIP_CALL( SCIPcutpoolDelRow(scip->cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
31090 
31091  return SCIP_OKAY;
31092 }
31093 
31094 /** gets current cuts in the global cut pool
31095  *
31096  * @return the current cuts in the global cut pool
31097  *
31098  * @pre This method can be called if @p scip is in one of the following stages:
31099  * - \ref SCIP_STAGE_SOLVING
31100  * - \ref SCIP_STAGE_SOLVED
31101  * - \ref SCIP_STAGE_EXITSOLVE
31102  */
31104  SCIP* scip /**< SCIP data structure */
31105  )
31106 {
31107  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
31108 
31109  return SCIPcutpoolGetCuts(scip->cutpool);
31110 }
31111 
31112 /** gets current number of rows in the global cut pool
31113  *
31114  * @return the current number of rows in the global cut pool
31115  *
31116  * @pre This method can be called if @p scip is in one of the following stages:
31117  * - \ref SCIP_STAGE_SOLVING
31118  * - \ref SCIP_STAGE_SOLVED
31119  * - \ref SCIP_STAGE_EXITSOLVE
31120  */
31122  SCIP* scip /**< SCIP data structure */
31123  )
31124 {
31125  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
31126 
31127  return SCIPcutpoolGetNCuts(scip->cutpool);
31128 }
31129 
31130 /** gets the global cut pool used by SCIP
31131  *
31132  * @return the global cut pool used by SCIP
31133  *
31134  * @pre This method can be called if @p scip is in one of the following stages:
31135  * - \ref SCIP_STAGE_SOLVING
31136  * - \ref SCIP_STAGE_SOLVED
31137  * - \ref SCIP_STAGE_EXITSOLVE
31138  */
31140  SCIP* scip /**< SCIP data structure */
31141  )
31142 {
31143  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGlobalCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
31144 
31145  return scip->cutpool;
31146 }
31147 
31148 /** creates a cut pool
31149  *
31150  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31151  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31152  *
31153  * @pre This method can be called if @p scip is in one of the following stages:
31154  * - \ref SCIP_STAGE_TRANSFORMING
31155  * - \ref SCIP_STAGE_TRANSFORMED
31156  * - \ref SCIP_STAGE_INITPRESOLVE
31157  * - \ref SCIP_STAGE_PRESOLVING
31158  * - \ref SCIP_STAGE_EXITPRESOLVE
31159  * - \ref SCIP_STAGE_PRESOLVED
31160  * - \ref SCIP_STAGE_INITSOLVE
31161  * - \ref SCIP_STAGE_SOLVING
31162  */
31164  SCIP* scip, /**< SCIP data structure */
31165  SCIP_CUTPOOL** cutpool, /**< pointer to store cut pool */
31166  int agelimit /**< maximum age a cut can reach before it is deleted from the pool */
31167  )
31168 {
31169  SCIP_CALL( checkStage(scip, "SCIPcreateCutpool", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31170 
31171  SCIP_CALL( SCIPcutpoolCreate(cutpool, scip->mem->probmem, scip->set, agelimit, FALSE) );
31172 
31173  return SCIP_OKAY;
31174 }
31175 
31176 /** frees a cut pool
31177  *
31178  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31179  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31180  *
31181  * @pre This method can be called if @p scip is in one of the following stages:
31182  * - \ref SCIP_STAGE_TRANSFORMING
31183  * - \ref SCIP_STAGE_TRANSFORMED
31184  * - \ref SCIP_STAGE_INITPRESOLVE
31185  * - \ref SCIP_STAGE_PRESOLVING
31186  * - \ref SCIP_STAGE_EXITPRESOLVE
31187  * - \ref SCIP_STAGE_PRESOLVED
31188  * - \ref SCIP_STAGE_INITSOLVE
31189  * - \ref SCIP_STAGE_SOLVING
31190  * - \ref SCIP_STAGE_SOLVED
31191  * - \ref SCIP_STAGE_EXITSOLVE
31192  * - \ref SCIP_STAGE_FREETRANS
31193  */
31195  SCIP* scip, /**< SCIP data structure */
31196  SCIP_CUTPOOL** cutpool /**< pointer to store cut pool */
31197  )
31198 {
31199  SCIP_CALL( checkStage(scip, "SCIPfreeCutpool", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
31200 
31201  SCIP_CALL( SCIPcutpoolFree(cutpool, scip->mem->probmem, scip->set, scip->lp) );
31202 
31203  return SCIP_OKAY;
31204 }
31205 
31206 /** if not already existing, adds row to a cut pool and captures it
31207  *
31208  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31209  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31210  *
31211  * @pre This method can be called if @p scip is in one of the following stages:
31212  * - \ref SCIP_STAGE_INITSOLVE
31213  * - \ref SCIP_STAGE_SOLVING
31214  */
31216  SCIP* scip, /**< SCIP data structure */
31217  SCIP_CUTPOOL* cutpool, /**< cut pool */
31218  SCIP_ROW* row /**< cutting plane to add */
31219  )
31220 {
31221  SCIP_CALL( checkStage(scip, "SCIPaddRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31222 
31223  SCIP_CALL( SCIPcutpoolAddRow(cutpool, scip->mem->probmem, scip->set, row) );
31224 
31225  return SCIP_OKAY;
31226 }
31227 
31228 /** adds row to a cut pool and captures it; doesn't check for multiple cuts
31229  *
31230  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31231  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31232  *
31233  * @pre This method can be called if @p scip is in one of the following stages:
31234  * - \ref SCIP_STAGE_INITSOLVE
31235  * - \ref SCIP_STAGE_SOLVING
31236  */
31238  SCIP* scip, /**< SCIP data structure */
31239  SCIP_CUTPOOL* cutpool, /**< cut pool */
31240  SCIP_ROW* row /**< cutting plane to add */
31241  )
31242 {
31243  SCIP_CALL( checkStage(scip, "SCIPaddNewRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31244 
31245  SCIP_CALL( SCIPcutpoolAddNewRow(cutpool, scip->mem->probmem, scip->set, row) );
31246 
31247  return SCIP_OKAY;
31248 }
31249 
31250 /** removes the LP row from a cut pool
31251  *
31252  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31253  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31254  *
31255  * @pre This method can be called if @p scip is in one of the following stages:
31256  * - \ref SCIP_STAGE_INITSOLVE
31257  * - \ref SCIP_STAGE_SOLVING
31258  * - \ref SCIP_STAGE_SOLVED
31259  */
31261  SCIP* scip, /**< SCIP data structure */
31262  SCIP_CUTPOOL* cutpool, /**< cut pool */
31263  SCIP_ROW* row /**< row to remove */
31264  )
31265 {
31266  SCIP_CALL( checkStage(scip, "SCIPdelRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
31267 
31268  SCIP_CALL( SCIPcutpoolDelRow(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
31269 
31270  return SCIP_OKAY;
31271 }
31272 
31273 /** separates cuts from a cut pool
31274  *
31275  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31276  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31277  *
31278  * @pre This method can be called if @p scip is in one of the following stages:
31279  * - \ref SCIP_STAGE_SOLVING
31280  */
31282  SCIP* scip, /**< SCIP data structure */
31283  SCIP_CUTPOOL* cutpool, /**< cut pool */
31284  SCIP_RESULT* result /**< pointer to store the result of the separation call */
31285  )
31286 {
31287  SCIP_CALL( checkStage(scip, "SCIPseparateCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31288 
31289  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
31290 
31291  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
31292  {
31293  SCIPerrorMessage("cannot add cuts, because node LP is not processed\n");
31294  return SCIP_INVALIDCALL;
31295  }
31296 
31297  SCIP_CALL( SCIPcutpoolSeparate(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter,
31298  scip->lp, scip->sepastore, NULL, FALSE, (SCIPtreeGetCurrentDepth(scip->tree) == 0), result) );
31299 
31300  return SCIP_OKAY;
31301 }
31302 
31303 /** separates cuts w.r.t. given solution from a cut pool
31304  *
31305  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31306  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31307  *
31308  * @pre This method can be called if @p scip is in one of the following stages:
31309  * - \ref SCIP_STAGE_SOLVING
31310  */
31312  SCIP* scip, /**< SCIP data structure */
31313  SCIP_CUTPOOL* cutpool, /**< cut pool */
31314  SCIP_SOL* sol, /**< solution to be separated */
31315  SCIP_RESULT* result /**< pointer to store the result of the separation call */
31316  )
31317 {
31318  SCIP_CALL( checkStage(scip, "SCIPseparateSolCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31319 
31320  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
31321 
31322  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
31323  {
31324  SCIPerrorMessage("cannot add cuts, because node LP is not processed\n");
31325  return SCIP_INVALIDCALL;
31326  }
31327 
31328  SCIP_CALL( SCIPcutpoolSeparate(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter,
31329  scip->lp, scip->sepastore, sol, FALSE, (SCIPtreeGetCurrentDepth(scip->tree) == 0), result) );
31330 
31331  return SCIP_OKAY;
31332 }
31333 
31334 /** if not already existing, adds row to delayed global cut pool
31335  *
31336  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31337  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31338  *
31339  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
31340  */
31342  SCIP* scip, /**< SCIP data structure */
31343  SCIP_ROW* row /**< cutting plane to add */
31344  )
31345 {
31346  SCIP_CALL( checkStage(scip, "SCIPaddDelayedPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31347 
31348  SCIP_CALL( SCIPcutpoolAddRow(scip->delayedcutpool, scip->mem->probmem, scip->set, row) );
31349 
31350  return SCIP_OKAY;
31351 }
31352 
31353 /** removes the row from the delayed global cut pool
31354  *
31355  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31356  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31357  *
31358  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
31359  */
31361  SCIP* scip, /**< SCIP data structure */
31362  SCIP_ROW* row /**< cutting plane to add */
31363  )
31364 {
31365  SCIP_CALL( checkStage(scip, "SCIPdelDelayedPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31366 
31367  SCIP_CALL( SCIPcutpoolDelRow(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
31368 
31369  return SCIP_OKAY;
31370 }
31371 
31372 /** gets current cuts in the delayed global cut pool
31373  *
31374  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31375  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31376  *
31377  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
31378  */
31380  SCIP* scip /**< SCIP data structure */
31381  )
31382 {
31383  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDelayedPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
31384 
31385  return SCIPcutpoolGetCuts(scip->delayedcutpool);
31386 }
31387 
31388 /** gets current number of rows in the delayed global cut pool
31389  *
31390  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31391  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31392  *
31393  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
31394  */
31396  SCIP* scip /**< SCIP data structure */
31397  )
31398 {
31399  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDelayedPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
31400 
31401  return SCIPcutpoolGetNCuts(scip->delayedcutpool);
31402 }
31403 
31404 /** gets the delayed global cut pool used by SCIP
31405  *
31406  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31407  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31408  *
31409  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
31410  */
31412  SCIP* scip /**< SCIP data structure */
31413  )
31414 {
31415  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDelayedGlobalCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
31416 
31417  return scip->delayedcutpool;
31418 }
31419 
31420 /** separates the given primal solution or the current LP solution by calling the separators and constraint handlers'
31421  * separation methods;
31422  * the generated cuts are stored in the separation storage and can be accessed with the methods SCIPgetCuts() and
31423  * SCIPgetNCuts();
31424  * after evaluating the cuts, you have to call SCIPclearCuts() in order to remove the cuts from the
31425  * separation storage;
31426  * it is possible to call SCIPseparateSol() multiple times with different solutions and evaluate the found cuts
31427  * afterwards
31428  *
31429  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31430  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31431  *
31432  * @pre This method can be called if @p scip is in one of the following stages:
31433  * - \ref SCIP_STAGE_SOLVING
31434  */
31436  SCIP* scip, /**< SCIP data structure */
31437  SCIP_SOL* sol, /**< primal solution that should be separated, or NULL for LP solution */
31438  SCIP_Bool pretendroot, /**< should the cut separators be called as if we are at the root node? */
31439  SCIP_Bool onlydelayed, /**< should only separators be called that were delayed in the previous round? */
31440  SCIP_Bool* delayed, /**< pointer to store whether a separator was delayed */
31441  SCIP_Bool* cutoff /**< pointer to store whether the node can be cut off */
31442  )
31443 {
31444  int actdepth;
31445 
31446  SCIP_CALL( checkStage(scip, "SCIPseparateSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31447 
31448  /* get current depth */
31449  actdepth = (pretendroot ? 0 : SCIPtreeGetCurrentDepth(scip->tree));
31450 
31451  /* apply separation round */
31452  SCIP_CALL( SCIPseparationRound(scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->eventqueue, scip->eventfilter, scip->transprob, scip->primal, scip->tree, scip->lp, scip->sepastore,
31453  sol, actdepth, onlydelayed, delayed, cutoff) );
31454 
31455  return SCIP_OKAY;
31456 }
31457 
31458 /** gets the array of cuts currently stored in the separation storage
31459  *
31460  * @return the array of cuts currently stored in the separation storage
31461  *
31462  * @pre This method can be called if @p scip is in one of the following stages:
31463  * - \ref SCIP_STAGE_PRESOLVED
31464  * - \ref SCIP_STAGE_SOLVING
31465  * - \ref SCIP_STAGE_SOLVED
31466  */
31468  SCIP* scip /**< SCIP data structure */
31469  )
31470 {
31471  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
31472 
31473  return SCIPsepastoreGetCuts(scip->sepastore);
31474 }
31475 
31476 /** get current number of cuts in the separation storage
31477  *
31478  * @return the current number of cuts in the separation storage
31479  *
31480  * @pre This method can be called if @p scip is in one of the following stages:
31481  * - \ref SCIP_STAGE_PRESOLVED
31482  * - \ref SCIP_STAGE_SOLVING
31483  * - \ref SCIP_STAGE_SOLVED
31484  */
31486  SCIP* scip /**< SCIP data structure */
31487  )
31488 {
31489  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
31490 
31491  return SCIPsepastoreGetNCuts(scip->sepastore);
31492 }
31493 
31494 /** clears the separation storage
31495  *
31496  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31497  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31498  *
31499  * @pre This method can be called if @p scip is in one of the following stages:
31500  * - \ref SCIP_STAGE_SOLVING
31501  */
31503  SCIP* scip /**< SCIP data structure */
31504  )
31505 {
31506  SCIP_CALL( checkStage(scip, "SCIPclearCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31507 
31508  SCIP_CALL( SCIPsepastoreClearCuts(scip->sepastore, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, scip->lp) );
31509 
31510  return SCIP_OKAY;
31511 }
31512 
31513 /** removes cuts that are inefficacious w.r.t. the current LP solution from separation storage without adding the cuts to the LP
31514  *
31515  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31516  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31517  *
31518  * @pre This method can be called if @p scip is in one of the following stages:
31519  * - \ref SCIP_STAGE_SOLVING
31520  */
31522  SCIP* scip /**< SCIP data structure */
31523  )
31524 {
31525  SCIP_Bool isroot;
31526 
31527  SCIP_CALL( checkStage(scip, "SCIPremoveInefficaciousCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31528 
31529  isroot = FALSE;
31530  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
31531  isroot = TRUE;
31533  scip->eventqueue, scip->eventfilter, scip->lp, isroot, SCIP_EFFICIACYCHOICE_LP) );
31534 
31535  return SCIP_OKAY;
31536 }
31537 
31538 /** returns current factor on cut infeasibility to limit feasibility tolerance for relaxation solver
31539  *
31540  * Gives value of separating/feastolfac parameter.
31541  *
31542  * @return factor on cut infeasibility to limit feasibility tolerance for relaxation solver
31543  *
31544  * @pre This method can be called if @p scip is in one of the following stages:
31545  * - \ref SCIP_STAGE_SOLVING
31546  */
31548  SCIP* scip /**< SCIP data structure */
31549  )
31550 {
31551  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRelaxFeastolFactor", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31552 
31553  return scip->set->sepa_feastolfac;
31554 }
31555 
31556 /*
31557  * LP diving methods
31558  */
31559 
31560 /** initiates LP diving, making methods SCIPchgVarObjDive(), SCIPchgVarLbDive(), and SCIPchgVarUbDive() available
31561  *
31562  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31563  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31564  *
31565  * @pre This method can be called if @p scip is in one of the following stages:
31566  * - \ref SCIP_STAGE_SOLVING
31567  *
31568  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31569  *
31570  * @note diving is allowed even if the current LP is not flushed, not solved, or not solved to optimality; be aware
31571  * that solving the (first) diving LP may take longer than expect and that the latter two cases could stem from
31572  * numerical troubles during the last LP solve; because of this, most users will want to call this method only if
31573  * SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL
31574  */
31576  SCIP* scip /**< SCIP data structure */
31577  )
31578 {
31579  assert(scip != NULL);
31580 
31581  SCIP_CALL( checkStage(scip, "SCIPstartDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31583 
31584  if( SCIPlpDiving(scip->lp) )
31585  {
31586  SCIPerrorMessage("already in diving mode\n");
31587  return SCIP_INVALIDCALL;
31588  }
31589 
31590  if( SCIPtreeProbing(scip->tree) )
31591  {
31592  SCIPerrorMessage("cannot start diving while being in probing mode\n");
31593  return SCIP_INVALIDCALL;
31594  }
31595 
31597  {
31598  SCIPerrorMessage("cannot start diving if LP has not been constructed\n");
31599  return SCIP_INVALIDCALL;
31600  }
31601  assert(SCIPtreeHasCurrentNodeLP(scip->tree));
31602 
31603  SCIP_CALL( SCIPlpStartDive(scip->lp, scip->mem->probmem, scip->set, scip->stat) );
31604 
31605  return SCIP_OKAY;
31606 }
31607 
31608 /** quits LP diving and resets bounds and objective values of columns to the current node's values
31609  *
31610  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31611  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31612  *
31613  * @pre This method can be called if @p scip is in one of the following stages:
31614  * - \ref SCIP_STAGE_SOLVING
31615  *
31616  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31617  */
31619  SCIP* scip /**< SCIP data structure */
31620  )
31621 {
31622  assert(scip != NULL);
31623 
31624  SCIP_CALL( checkStage(scip, "SCIPendDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31625 
31626  if( !SCIPlpDiving(scip->lp) )
31627  {
31628  SCIPerrorMessage("not in diving mode\n");
31629  return SCIP_INVALIDCALL;
31630  }
31631 
31632  /* unmark the diving flag in the LP and reset all variables' objective and bound values */
31633  SCIP_CALL( SCIPlpEndDive(scip->lp, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->eventqueue, scip->eventfilter,
31634  scip->transprob, scip->transprob->vars, scip->transprob->nvars) );
31635 
31636  /* the lower bound may have changed slightly due to LP resolve in SCIPlpEndDive() */
31637  if( !scip->lp->resolvelperror && scip->tree->focusnode != NULL && SCIPlpIsRelax(scip->lp) && SCIPlpIsSolved(scip->lp) )
31638  {
31639  assert(SCIPtreeIsFocusNodeLPConstructed(scip->tree));
31640  SCIP_CALL( SCIPnodeUpdateLowerboundLP(scip->tree->focusnode, scip->set, scip->stat, scip->tree, scip->transprob,
31641  scip->origprob, scip->lp) );
31642  }
31643  /* reset the probably changed LP's cutoff bound */
31644  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, scip->primal->cutoffbound) );
31645  assert(scip->lp->cutoffbound == scip->primal->cutoffbound); /*lint !e777*/
31646 
31647  /* if a new best solution was created, the cutoff of the tree was delayed due to diving;
31648  * the cutoff has to be done now.
31649  */
31650  if( scip->tree->cutoffdelayed )
31651  {
31652  SCIP_CALL( SCIPtreeCutoff(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
31653  scip->lp, scip->primal->cutoffbound) );
31654  }
31655 
31656  return SCIP_OKAY;
31657 }
31658 
31659 /** changes cutoffbound in current dive
31660  *
31661  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31662  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31663  *
31664  * @pre This method can be called if @p scip is in one of the following stages:
31665  * - \ref SCIP_STAGE_SOLVING
31666  *
31667  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31668  */
31670  SCIP* scip, /**< SCIP data structure */
31671  SCIP_Real newcutoffbound /**< new cutoffbound */
31672  )
31673 {
31674  assert(scip != NULL);
31675 
31676  SCIP_CALL( checkStage(scip, "SCIPchgCutoffboundDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31677 
31678  if( !SCIPlpDiving(scip->lp) )
31679  {
31680  SCIPerrorMessage("not in diving mode\n");
31681  return SCIP_INVALIDCALL;
31682  }
31683 
31684  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, newcutoffbound) );
31685 
31686  return SCIP_OKAY;
31687 }
31688 
31689 /** changes variable's objective value in current dive
31690  *
31691  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31692  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31693  *
31694  * @pre This method can be called if @p scip is in one of the following stages:
31695  * - \ref SCIP_STAGE_SOLVING
31696  *
31697  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31698  */
31700  SCIP* scip, /**< SCIP data structure */
31701  SCIP_VAR* var, /**< variable to change the objective value for */
31702  SCIP_Real newobj /**< new objective value */
31703  )
31704 {
31705  assert(scip != NULL);
31706  assert(var != NULL);
31707 
31708  SCIP_CALL( checkStage(scip, "SCIPchgVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31709 
31710  if( !SCIPlpDiving(scip->lp) )
31711  {
31712  SCIPerrorMessage("not in diving mode\n");
31713  return SCIP_INVALIDCALL;
31714  }
31715 
31716  /* invalidate the LP's cutoff bound, since this has nothing to do with the current objective value anymore;
31717  * the cutoff bound is reset in SCIPendDive()
31718  */
31719  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, SCIPsetInfinity(scip->set)) );
31720 
31721  /* mark the LP's objective function invalid */
31723 
31724  /* change the objective value of the variable in the diving LP */
31725  SCIP_CALL( SCIPvarChgObjDive(var, scip->set, scip->lp, newobj) );
31726 
31727  return SCIP_OKAY;
31728 }
31729 
31730 /** changes variable's lower bound in current dive
31731  *
31732  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31733  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31734  *
31735  * @pre This method can be called if @p scip is in one of the following stages:
31736  * - \ref SCIP_STAGE_SOLVING
31737  *
31738  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31739  */
31741  SCIP* scip, /**< SCIP data structure */
31742  SCIP_VAR* var, /**< variable to change the bound for */
31743  SCIP_Real newbound /**< new value for bound */
31744  )
31745 {
31746  assert(scip != NULL);
31747  assert(var != NULL);
31748 
31749  SCIP_CALL( checkStage(scip, "SCIPchgVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31750 
31751  if( !SCIPlpDiving(scip->lp) )
31752  {
31753  SCIPerrorMessage("not in diving mode\n");
31754  return SCIP_INVALIDCALL;
31755  }
31756 
31757  SCIP_CALL( SCIPvarChgLbDive(var, scip->set, scip->lp, newbound) );
31758 
31759  return SCIP_OKAY;
31760 }
31761 
31762 /** changes variable's upper bound in current dive
31763  *
31764  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31765  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31766  *
31767  * @pre This method can be called if @p scip is in one of the following stages:
31768  * - \ref SCIP_STAGE_SOLVING
31769  *
31770  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31771  */
31773  SCIP* scip, /**< SCIP data structure */
31774  SCIP_VAR* var, /**< variable to change the bound for */
31775  SCIP_Real newbound /**< new value for bound */
31776  )
31777 {
31778  assert(scip != NULL);
31779  assert(var != NULL);
31780 
31781  SCIP_CALL( checkStage(scip, "SCIPchgVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31782 
31783  if( !SCIPlpDiving(scip->lp) )
31784  {
31785  SCIPerrorMessage("not in diving mode\n");
31786  return SCIP_INVALIDCALL;
31787  }
31788 
31789  SCIP_CALL( SCIPvarChgUbDive(var, scip->set, scip->lp, newbound) );
31790 
31791  return SCIP_OKAY;
31792 }
31793 
31794 /** adds a row to the LP in current dive
31795  *
31796  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31797  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31798  *
31799  * @pre This method can be called if @p scip is in one of the following stages:
31800  * - \ref SCIP_STAGE_SOLVING
31801  *
31802  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31803  */
31805  SCIP* scip, /**< SCIP data structure */
31806  SCIP_ROW* row /**< row to be added */
31807  )
31808 {
31809  SCIP_NODE* node;
31810  int depth;
31811 
31812  assert(scip != NULL);
31813  assert(row != NULL);
31814 
31815  SCIP_CALL( checkStage(scip, "SCIPaddRowDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31816 
31817  if( !SCIPlpDiving(scip->lp) )
31818  {
31819  SCIPerrorMessage("not in diving mode\n");
31820  return SCIP_INVALIDCALL;
31821  }
31822 
31823  /* get depth of current node */
31824  node = SCIPtreeGetCurrentNode(scip->tree);
31825  assert(node != NULL);
31826  depth = SCIPnodeGetDepth(node);
31827 
31828  SCIP_CALL( SCIPlpAddRow(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, row, depth) );
31829 
31830  return SCIP_OKAY;
31831 }
31832 
31833 /** changes row lhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowLhs()
31834  *
31835  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31836  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31837  *
31838  * @pre This method can be called if @p scip is in one of the following stages:
31839  * - \ref SCIP_STAGE_SOLVING
31840  *
31841  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31842  */
31844  SCIP* scip, /**< SCIP data structure */
31845  SCIP_ROW* row, /**< row to change the lhs for */
31846  SCIP_Real newlhs /**< new value for lhs */
31847  )
31848 {
31849  assert(scip != NULL);
31850  assert(row != NULL);
31851 
31852  SCIP_CALL( checkStage(scip, "SCIPchgRowLhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31853 
31854  if( !SCIPlpDiving(scip->lp) )
31855  {
31856  SCIPerrorMessage("not in diving mode\n");
31857  return SCIP_INVALIDCALL;
31858  }
31859 
31861  SCIP_CALL( SCIProwChgLhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newlhs) );
31862 
31863  return SCIP_OKAY;
31864 }
31865 
31866 /** changes row rhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowRhs()
31867  *
31868  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31869  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31870  *
31871  * @pre This method can be called if @p scip is in one of the following stages:
31872  * - \ref SCIP_STAGE_SOLVING
31873  *
31874  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31875  */
31877  SCIP* scip, /**< SCIP data structure */
31878  SCIP_ROW* row, /**< row to change the lhs for */
31879  SCIP_Real newrhs /**< new value for rhs */
31880  )
31881 {
31882  assert(scip != NULL);
31883  assert(row != NULL);
31884 
31885  SCIP_CALL( checkStage(scip, "SCIPchgRowRhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31886 
31887  if( !SCIPlpDiving(scip->lp) )
31888  {
31889  SCIPerrorMessage("not in diving mode\n");
31890  return SCIP_INVALIDCALL;
31891  }
31892 
31894  SCIP_CALL( SCIProwChgRhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newrhs) );
31895 
31896  return SCIP_OKAY;
31897 }
31898 
31899 /** gets variable's objective value in current dive
31900  *
31901  * @return the variable's objective value in current dive.
31902  *
31903  * @pre This method can be called if @p scip is in one of the following stages:
31904  * - \ref SCIP_STAGE_SOLVING
31905  *
31906  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31907  */
31909  SCIP* scip, /**< SCIP data structure */
31910  SCIP_VAR* var /**< variable to get the bound for */
31911  )
31912 {
31913  assert(scip != NULL);
31914  assert(var != NULL);
31915 
31916  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31917 
31918  if( !SCIPlpDiving(scip->lp) )
31919  {
31920  SCIPerrorMessage("not in diving mode\n");
31921  SCIPABORT();
31922  return SCIP_INVALID; /*lint !e527*/
31923  }
31924 
31925  return SCIPvarGetObjLP(var);
31926 }
31927 
31928 /** gets variable's lower bound in current dive
31929  *
31930  * @return the variable's lower bound in current dive.
31931  *
31932  * @pre This method can be called if @p scip is in one of the following stages:
31933  * - \ref SCIP_STAGE_SOLVING
31934  *
31935  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31936  */
31938  SCIP* scip, /**< SCIP data structure */
31939  SCIP_VAR* var /**< variable to get the bound for */
31940  )
31941 {
31942  assert(scip != NULL);
31943  assert(var != NULL);
31944 
31945  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31946 
31947  if( !SCIPlpDiving(scip->lp) )
31948  {
31949  SCIPerrorMessage("not in diving mode\n");
31950  SCIPABORT();
31951  return SCIP_INVALID; /*lint !e527*/
31952  }
31953 
31954  return SCIPvarGetLbLP(var, scip->set);
31955 }
31956 
31957 /** gets variable's upper bound in current dive
31958  *
31959  * @return the variable's upper bound in current dive.
31960  *
31961  * @pre This method can be called if @p scip is in one of the following stages:
31962  * - \ref SCIP_STAGE_SOLVING
31963  *
31964  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31965  */
31967  SCIP* scip, /**< SCIP data structure */
31968  SCIP_VAR* var /**< variable to get the bound for */
31969  )
31970 {
31971  assert(scip != NULL);
31972  assert(var != NULL);
31973 
31974  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31975 
31976  if( !SCIPlpDiving(scip->lp) )
31977  {
31978  SCIPerrorMessage("not in diving mode\n");
31979  SCIPABORT();
31980  return SCIP_INVALID; /*lint !e527*/
31981  }
31982 
31983  return SCIPvarGetUbLP(var, scip->set);
31984 }
31985 
31986 /** solves the LP of the current dive; no separation or pricing is applied
31987  *
31988  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31989  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31990  *
31991  * @pre This method can be called if @p scip is in one of the following stages:
31992  * - \ref SCIP_STAGE_SOLVING
31993  *
31994  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
31995  *
31996  * @note be aware that the LP solve may take longer than expected if SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL,
31997  * compare the explanation of SCIPstartDive()
31998  */
32000  SCIP* scip, /**< SCIP data structure */
32001  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
32002  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
32003  SCIP_Bool* cutoff /**< pointer to store whether the diving LP was infeasible or the objective
32004  * limit was reached (or NULL, if not needed) */
32005  )
32006 {
32007  assert(scip != NULL);
32008 
32009  SCIP_CALL( checkStage(scip, "SCIPsolveDiveLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32010 
32011  if( !SCIPlpDiving(scip->lp) )
32012  {
32013  SCIPerrorMessage("not in diving mode\n");
32014  return SCIP_INVALIDCALL;
32015  }
32016 
32017  if( cutoff != NULL )
32018  *cutoff = FALSE;
32019 
32020  /* solve diving LP */
32021  SCIP_CALL( SCIPlpSolveAndEval(scip->lp, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat,
32022  scip->eventqueue, scip->eventfilter, scip->transprob, (SCIP_Longint)itlim, FALSE, FALSE, FALSE, lperror) );
32023 
32024  /* the LP is infeasible or the objective limit was reached */
32026  || (SCIPlpGetSolstat(scip->lp) == SCIP_LPSOLSTAT_OPTIMAL &&
32027  SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip))) )
32028  {
32029  /* analyze the infeasible LP (only if the objective was not changed, all columns are in the LP, and no external
32030  * pricers exist)
32031  */
32032  if( !scip->set->misc_exactsolve && !(SCIPlpDivingObjChanged(scip->lp) || SCIPlpDivingRowsChanged(scip->lp))
32033  && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) )
32034  {
32035  SCIP_CALL( SCIPconflictAnalyzeLP(scip->conflict, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
32036  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, NULL) );
32037  }
32038 
32039  if( cutoff != NULL )
32040  *cutoff = TRUE;
32041  }
32042 
32043  return SCIP_OKAY;
32044 }
32045 
32046 /** returns the number of the node in the current branch and bound run, where the last LP was solved in diving
32047  * or probing mode
32048  *
32049  * @return the number of the node in the current branch and bound run, where the last LP was solved in diving
32050  * or probing mode.
32051  *
32052  * @pre This method can be called if @p scip is in one of the following stages:
32053  * - \ref SCIP_STAGE_TRANSFORMING
32054  * - \ref SCIP_STAGE_TRANSFORMED
32055  * - \ref SCIP_STAGE_INITPRESOLVE
32056  * - \ref SCIP_STAGE_PRESOLVING
32057  * - \ref SCIP_STAGE_EXITPRESOLVE
32058  * - \ref SCIP_STAGE_PRESOLVED
32059  * - \ref SCIP_STAGE_INITSOLVE
32060  * - \ref SCIP_STAGE_SOLVING
32061  * - \ref SCIP_STAGE_SOLVED
32062  * - \ref SCIP_STAGE_EXITSOLVE
32063  * - \ref SCIP_STAGE_FREETRANS
32064  *
32065  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
32066  */
32068  SCIP* scip /**< SCIP data structure */
32069  )
32070 {
32071  assert(scip != NULL);
32072 
32073  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLastDivenode", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
32074 
32075  return scip->stat->lastdivenode;
32076 }
32077 
32078 /** returns whether we are in diving mode
32079  *
32080  * @return whether we are in diving mode.
32081  *
32082  * @pre This method can be called if @p scip is in one of the following stages:
32083  * - \ref SCIP_STAGE_TRANSFORMING
32084  * - \ref SCIP_STAGE_TRANSFORMED
32085  * - \ref SCIP_STAGE_INITPRESOLVE
32086  * - \ref SCIP_STAGE_PRESOLVING
32087  * - \ref SCIP_STAGE_EXITPRESOLVE
32088  * - \ref SCIP_STAGE_PRESOLVED
32089  * - \ref SCIP_STAGE_INITSOLVE
32090  * - \ref SCIP_STAGE_SOLVING
32091  * - \ref SCIP_STAGE_SOLVED
32092  * - \ref SCIP_STAGE_EXITSOLVE
32093  * - \ref SCIP_STAGE_FREETRANS
32094  *
32095  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
32096  */
32098  SCIP* scip /**< SCIP data structure */
32099  )
32100 {
32101  assert(scip != NULL);
32102 
32103  SCIP_CALL_ABORT( checkStage(scip, "SCIPinDive", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
32104 
32105  return SCIPlpDiving(scip->lp);
32106 }
32107 
32108 
32109 
32110 
32111 /*
32112  * probing methods
32113  */
32114 
32115 /** returns whether we are in probing mode; probing mode is activated via SCIPstartProbing() and stopped
32116  * via SCIPendProbing()
32117  *
32118  * @return TRUE, if SCIP is currently in probing mode, otherwise FALSE
32119  *
32120  * @pre This method can be called if @p scip is in one of the following stages:
32121  * - \ref SCIP_STAGE_TRANSFORMED
32122  * - \ref SCIP_STAGE_INITPRESOLVE
32123  * - \ref SCIP_STAGE_PRESOLVING
32124  * - \ref SCIP_STAGE_EXITPRESOLVE
32125  * - \ref SCIP_STAGE_PRESOLVED
32126  * - \ref SCIP_STAGE_INITSOLVE
32127  * - \ref SCIP_STAGE_SOLVING
32128  * - \ref SCIP_STAGE_SOLVED
32129  * - \ref SCIP_STAGE_EXITSOLVE
32130  */
32132  SCIP* scip /**< SCIP data structure */
32133  )
32134 {
32135  SCIP_CALL_ABORT( checkStage(scip, "SCIPinProbing", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
32136 
32137  return SCIPtreeProbing(scip->tree);
32138 }
32139 
32140 /** initiates probing, making methods SCIPnewProbingNode(), SCIPbacktrackProbing(), SCIPchgVarLbProbing(),
32141  * SCIPchgVarUbProbing(), SCIPfixVarProbing(), SCIPpropagateProbing(), and SCIPsolveProbingLP() available
32142  *
32143  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32144  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32145  *
32146  * @pre This method can be called if @p scip is in one of the following stages:
32147  * - \ref SCIP_STAGE_PRESOLVING
32148  * - \ref SCIP_STAGE_SOLVING
32149  *
32150  * @note The collection of variable statistics is turned off during probing. If these statistics should be collected
32151  * during probing use the method SCIPenableVarHistory() to turn the collection explicitly on.
32152  */
32154  SCIP* scip /**< SCIP data structure */
32155  )
32156 {
32157  SCIP_CALL( checkStage(scip, "SCIPstartProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32158 
32159  if( SCIPtreeProbing(scip->tree) )
32160  {
32161  SCIPerrorMessage("already in probing mode\n");
32162  return SCIP_INVALIDCALL;
32163  }
32164 
32165  if( scip->lp != NULL && SCIPlpDiving(scip->lp) )
32166  {
32167  SCIPerrorMessage("cannot start probing while in diving mode\n");
32168  return SCIP_INVALIDCALL;
32169  }
32170 
32171  SCIP_CALL( SCIPtreeStartProbing(scip->tree, scip->mem->probmem, scip->set, scip->lp, FALSE) );
32172 
32173  /* disables the collection of any statistic for a variable */
32175 
32176  return SCIP_OKAY;
32177 }
32178 
32179 /** creates a new probing sub node, whose changes can be undone by backtracking to a higher node in the probing path
32180  * with a call to SCIPbacktrackProbing();
32181  * using a sub node for each set of probing bound changes can improve conflict analysis
32182  *
32183  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32184  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32185  *
32186  * @pre This method can be called if @p scip is in one of the following stages:
32187  * - \ref SCIP_STAGE_PRESOLVING
32188  * - \ref SCIP_STAGE_SOLVING
32189  */
32191  SCIP* scip /**< SCIP data structure */
32192  )
32193 {
32194  SCIP_RETCODE retcode;
32195 
32196  SCIP_CALL( checkStage(scip, "SCIPnewProbingNode", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32197 
32198  if( !SCIPtreeProbing(scip->tree) )
32199  {
32200  SCIPerrorMessage("not in probing mode\n");
32201  return SCIP_INVALIDCALL;
32202  }
32203 
32204  retcode = SCIPtreeCreateProbingNode(scip->tree, scip->mem->probmem, scip->set, scip->lp);
32205 
32206  if( retcode == SCIP_MAXDEPTHLEVEL )
32207  {
32208  SCIPwarningMessage(scip, "probing reached maximal depth; it should be stopped\n");
32209  }
32210  SCIP_CALL( retcode );
32211 
32212  return SCIP_OKAY;
32213 }
32214 
32215 /** returns the current probing depth
32216  *
32217  * @return the probing depth, i.e. the number of probing sub nodes existing in the probing path
32218  *
32219  * @pre This method can be called if @p scip is in one of the following stages:
32220  * - \ref SCIP_STAGE_PRESOLVING
32221  * - \ref SCIP_STAGE_SOLVING
32222  */
32224  SCIP* scip /**< SCIP data structure */
32225  )
32226 {
32227  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbingDepth", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32228 
32229  if( !SCIPtreeProbing(scip->tree) )
32230  {
32231  SCIPerrorMessage("not in probing mode\n");
32232  SCIPABORT();
32233  return -1; /*lint !e527*/
32234  }
32235 
32236  return SCIPtreeGetProbingDepth(scip->tree);
32237 }
32238 
32239 /** undoes all changes to the problem applied in probing up to the given probing depth;
32240  * the changes of the probing node of the given probing depth are the last ones that remain active;
32241  * changes that were applied before calling SCIPnewProbingNode() cannot be undone
32242  *
32243  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32244  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32245  *
32246  * @pre This method can be called if @p scip is in one of the following stages:
32247  * - \ref SCIP_STAGE_PRESOLVING
32248  * - \ref SCIP_STAGE_SOLVING
32249  */
32251  SCIP* scip, /**< SCIP data structure */
32252  int probingdepth /**< probing depth of the node in the probing path that should be reactivated */
32253  )
32254 {
32255  SCIP_CALL( checkStage(scip, "SCIPbacktrackProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32256 
32257  if( !SCIPtreeProbing(scip->tree) )
32258  {
32259  SCIPerrorMessage("not in probing mode\n");
32260  return SCIP_INVALIDCALL;
32261  }
32262  if( probingdepth < 0 || probingdepth > SCIPtreeGetProbingDepth(scip->tree) )
32263  {
32264  SCIPerrorMessage("backtracking probing depth %d out of current probing range [0,%d]\n",
32265  probingdepth, SCIPtreeGetProbingDepth(scip->tree));
32266  return SCIP_INVALIDDATA;
32267  }
32268 
32269  SCIP_CALL( SCIPtreeBacktrackProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
32270  scip->origprob, scip->lp, scip->primal, scip->branchcand, scip->eventqueue, scip->eventfilter,
32271  scip->cliquetable, probingdepth) );
32272 
32273  return SCIP_OKAY;
32274 }
32275 
32276 /** quits probing and resets bounds and constraints to the focus node's environment
32277  *
32278  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32279  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32280  *
32281  * @pre This method can be called if @p scip is in one of the following stages:
32282  * - \ref SCIP_STAGE_PRESOLVING
32283  * - \ref SCIP_STAGE_SOLVING
32284  */
32286  SCIP* scip /**< SCIP data structure */
32287  )
32288 {
32289  SCIP_CALL( checkStage(scip, "SCIPendProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32290 
32291  if( !SCIPtreeProbing(scip->tree) )
32292  {
32293  SCIPerrorMessage("not in probing mode\n");
32294  return SCIP_INVALIDCALL;
32295  }
32296 
32297  /* switch back from probing to normal operation mode and restore variables and constraints to focus node */
32298  SCIP_CALL( SCIPtreeEndProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
32299  scip->transprob, scip->origprob, scip->lp, scip->primal,
32300  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable) );
32301 
32302  /* enables the collection of statistics for a variable */
32304 
32305  return SCIP_OKAY;
32306 }
32307 
32308 /** injects a change of variable's lower bound into current probing node; the same can also be achieved with a call to
32309  * SCIPchgVarLb(), but in this case, the bound change would be treated like a deduction instead of a branching decision
32310  *
32311  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32312  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32313  *
32314  * @pre This method can be called if @p scip is in one of the following stages:
32315  * - \ref SCIP_STAGE_PRESOLVING
32316  * - \ref SCIP_STAGE_SOLVING
32317  */
32319  SCIP* scip, /**< SCIP data structure */
32320  SCIP_VAR* var, /**< variable to change the bound for */
32321  SCIP_Real newbound /**< new value for bound */
32322  )
32323 {
32324  SCIP_CALL( checkStage(scip, "SCIPchgVarLbProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32325 
32326  if( !SCIPtreeProbing(scip->tree) )
32327  {
32328  SCIPerrorMessage("not in probing mode\n");
32329  return SCIP_INVALIDCALL;
32330  }
32332 
32333  SCIPvarAdjustLb(var, scip->set, &newbound);
32334 
32336  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
32337  var, newbound, SCIP_BOUNDTYPE_LOWER, TRUE) );
32338 
32339  return SCIP_OKAY;
32340 }
32341 
32342 /** injects a change of variable's upper bound into current probing node; the same can also be achieved with a call to
32343  * SCIPchgVarUb(), but in this case, the bound change would be treated like a deduction instead of a branching decision
32344  *
32345  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32346  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32347  *
32348  * @pre This method can be called if @p scip is in one of the following stages:
32349  * - \ref SCIP_STAGE_PRESOLVING
32350  * - \ref SCIP_STAGE_SOLVING
32351  */
32353  SCIP* scip, /**< SCIP data structure */
32354  SCIP_VAR* var, /**< variable to change the bound for */
32355  SCIP_Real newbound /**< new value for bound */
32356  )
32357 {
32358  SCIP_CALL( checkStage(scip, "SCIPchgVarUbProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32359 
32360  if( !SCIPtreeProbing(scip->tree) )
32361  {
32362  SCIPerrorMessage("not in probing mode\n");
32363  return SCIP_INVALIDCALL;
32364  }
32366 
32367  SCIPvarAdjustUb(var, scip->set, &newbound);
32368 
32370  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
32371  var, newbound, SCIP_BOUNDTYPE_UPPER, TRUE) );
32372 
32373  return SCIP_OKAY;
32374 }
32375 
32376 /** gets variable's objective value in current probing
32377  *
32378  * @return the variable's objective value in current probing.
32379  *
32380  * @pre This method can be called if @p scip is in one of the following stages:
32381  * - \ref SCIP_STAGE_SOLVING
32382  *
32383  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
32384  */
32386  SCIP* scip, /**< SCIP data structure */
32387  SCIP_VAR* var /**< variable to get the bound for */
32388  )
32389 {
32390  assert(scip != NULL);
32391  assert(var != NULL);
32392 
32393  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarObjProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32394 
32395  if( !SCIPtreeProbing(scip->tree) )
32396  {
32397  SCIPerrorMessage("not in probing mode\n");
32398  return SCIP_INVALID;
32399  }
32400 
32401  return SCIPvarGetObjLP(var);
32402 }
32403 
32404 /** injects a change of variable's bounds into current probing node to fix the variable to the specified value;
32405  * the same can also be achieved with a call to SCIPfixVar(), but in this case, the bound changes would be treated
32406  * like deductions instead of branching decisions
32407  *
32408  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32409  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32410  *
32411  * @pre This method can be called if @p scip is in one of the following stages:
32412  * - \ref SCIP_STAGE_PRESOLVING
32413  * - \ref SCIP_STAGE_SOLVING
32414  */
32416  SCIP* scip, /**< SCIP data structure */
32417  SCIP_VAR* var, /**< variable to change the bound for */
32418  SCIP_Real fixedval /**< value to fix variable to */
32419  )
32420 {
32421  SCIP_Real fixlb;
32422  SCIP_Real fixub;
32423 
32424  SCIP_CALL( checkStage(scip, "SCIPfixVarProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32425 
32426  if( !SCIPtreeProbing(scip->tree) )
32427  {
32428  SCIPerrorMessage("not in probing mode\n");
32429  return SCIP_INVALIDCALL;
32430  }
32432 
32433  /* we adjust the fixing value here and compare the old bound with the adjusted values because otherwise,
32434  * it might happen that the unadjusted value is better and we add the boundchange,
32435  * but within SCIPnodeAddBoundchg() the bounds are adjusted - using the feasibility epsilon for integer variables -
32436  * and it is asserted, that the bound is still better than the old one which might then be incorrect.
32437  */
32438  fixlb = fixedval;
32439  fixub = fixedval;
32440  SCIPvarAdjustLb(var, scip->set, &fixlb);
32441  SCIPvarAdjustUb(var, scip->set, &fixub);
32442  assert(SCIPsetIsEQ(scip->set, fixlb, fixub));
32443 
32444  if( SCIPsetIsGT(scip->set, fixlb, SCIPvarGetLbLocal(var)) )
32445  {
32447  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
32448  scip->cliquetable, var, fixlb, SCIP_BOUNDTYPE_LOWER, TRUE) );
32449  }
32450  if( SCIPsetIsLT(scip->set, fixub, SCIPvarGetUbLocal(var)) )
32451  {
32453  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
32454  var, fixub, SCIP_BOUNDTYPE_UPPER, TRUE) );
32455  }
32456 
32457  return SCIP_OKAY;
32458 }
32459 
32460 /** changes (column) variable's objective value during probing mode
32461  *
32462  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32463  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32464  *
32465  * @pre This method can be called if @p scip is in one of the following stages:
32466  * - \ref SCIP_STAGE_PRESOLVING
32467  * - \ref SCIP_STAGE_SOLVING
32468  *
32469  * @pre The variable needs to be a column variable.
32470  */
32472  SCIP* scip, /**< SCIP data structure */
32473  SCIP_VAR* var, /**< variable to change the objective for */
32474  SCIP_Real newobj /**< new objective function value */
32475  )
32476 {
32477  SCIP_NODE* node;
32478  SCIP_Real oldobj;
32479 
32480  SCIP_CALL( checkStage(scip, "SCIPchgVarObjProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32481 
32482  if( !SCIPtreeProbing(scip->tree) )
32483  {
32484  SCIPerrorMessage("not in probing mode\n");
32485  return SCIP_INVALIDCALL;
32486  }
32487 
32489  {
32490  SCIPerrorMessage("variable is not a column variable\n");
32491  return SCIP_INVALIDCALL;
32492  }
32493 
32494  /* get current probing node */
32495  node = SCIPtreeGetCurrentNode(scip->tree);
32496  assert(SCIPnodeGetType(node) == SCIP_NODETYPE_PROBINGNODE);
32497 
32498  /* get old objective function value */
32499  oldobj = SCIPvarGetObj(var);
32500 
32501  if( SCIPisEQ(scip, oldobj, newobj) )
32502  return SCIP_OKAY;
32503 
32504  if( node->data.probingnode->nchgdobjs == 0 )
32505  {
32506  SCIP_CALL( SCIPallocMemoryArray(scip, &node->data.probingnode->origobjvars, 1) ); /*lint !e506*/
32507  SCIP_CALL( SCIPallocMemoryArray(scip, &node->data.probingnode->origobjvals, 1) ); /*lint !e506*/
32508  }
32509  else
32510  {
32511  SCIP_CALL( SCIPreallocMemoryArray(scip, &node->data.probingnode->origobjvars, node->data.probingnode->nchgdobjs + 1) ); /*lint !e776*/
32512  SCIP_CALL( SCIPreallocMemoryArray(scip, &node->data.probingnode->origobjvals, node->data.probingnode->nchgdobjs + 1) ); /*lint !e776*/
32513  }
32514 
32515  node->data.probingnode->origobjvars[node->data.probingnode->nchgdobjs] = var;
32516  node->data.probingnode->origobjvals[node->data.probingnode->nchgdobjs] = oldobj;
32517  ++node->data.probingnode->nchgdobjs;
32518  ++scip->tree->probingsumchgdobjs;
32519 
32520  assert(SCIPtreeProbingObjChanged(scip->tree) == SCIPlpDivingObjChanged(scip->lp));
32521 
32522  /* inform tree and LP that the objective was changed and invalidate the LP's cutoff bound, since this has nothing to
32523  * do with the current objective value anymore; the cutoff bound is reset in SCIPendProbing()
32524  */
32525  if( !SCIPtreeProbingObjChanged(scip->tree) )
32526  {
32527  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, SCIPsetInfinity(scip->set)) );
32528 
32531  }
32532  assert(SCIPisInfinity(scip, scip->lp->cutoffbound));
32533 
32534  /* perform the objective change */
32535  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
32536 
32537  return SCIP_OKAY;
32538 }
32539 
32540 /** applies domain propagation on the probing sub problem, that was changed after SCIPstartProbing() was called;
32541  * the propagated domains of the variables can be accessed with the usual bound accessing calls SCIPvarGetLbLocal()
32542  * and SCIPvarGetUbLocal(); the propagation is only valid locally, i.e. the local bounds as well as the changed
32543  * bounds due to SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), and SCIPfixVarProbing() are used for propagation
32544  *
32545  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32546  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32547  *
32548  * @pre This method can be called if @p scip is in one of the following stages:
32549  * - \ref SCIP_STAGE_PRESOLVING
32550  * - \ref SCIP_STAGE_SOLVING
32551  */
32553  SCIP* scip, /**< SCIP data structure */
32554  int maxproprounds, /**< maximal number of propagation rounds (-1: no limit, 0: parameter settings) */
32555  SCIP_Bool* cutoff, /**< pointer to store whether the probing node can be cut off */
32556  SCIP_Longint* ndomredsfound /**< pointer to store the number of domain reductions found, or NULL */
32557  )
32558 {
32559  SCIP_VAR** objchgvars;
32560  SCIP_Real* objchgvals;
32561  SCIP_Bool changedobj;
32562  int nobjchg;
32563 
32564  SCIP_CALL( checkStage(scip, "SCIPpropagateProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32565 
32566  if( !SCIPtreeProbing(scip->tree) )
32567  {
32568  SCIPerrorMessage("not in probing mode\n");
32569  return SCIP_INVALIDCALL;
32570  }
32571 
32572  objchgvars = NULL;
32573  objchgvals = NULL;
32574  changedobj = FALSE;
32575  nobjchg = 0;
32576 
32577  /* undo objective changes if we want to propagate during probing */
32578  if( scip->tree->probingobjchanged )
32579  {
32580  SCIP_VAR** vars;
32581  int nvars;
32582  int i;
32583 
32584  vars = SCIPgetVars(scip);
32585  nvars = SCIPgetNVars(scip);
32586 
32587  SCIP_CALL( SCIPallocBufferArray(scip, &objchgvals, MIN(nvars, scip->tree->probingsumchgdobjs)) );
32588  SCIP_CALL( SCIPallocBufferArray(scip, &objchgvars, MIN(nvars, scip->tree->probingsumchgdobjs)) );
32589  nobjchg = 0;
32590 
32591  for( i = 0; i < nvars; ++i )
32592  {
32593  if( !SCIPisEQ(scip, vars[i]->unchangedobj, SCIPgetVarObjProbing(scip, vars[i])) )
32594  {
32595  objchgvars[nobjchg] = vars[i];
32596  objchgvals[nobjchg] = SCIPgetVarObjProbing(scip, vars[i]);
32597  ++nobjchg;
32598 
32599  SCIP_CALL( SCIPvarChgObj(vars[i], scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp,
32600  scip->eventqueue, vars[i]->unchangedobj) );
32601  }
32602  }
32603  assert(nobjchg <= scip->tree->probingsumchgdobjs);
32604 
32606  scip->tree->probingobjchanged = FALSE;
32607  changedobj = TRUE;
32608  }
32609 
32610  if( ndomredsfound != NULL )
32611  *ndomredsfound = -(scip->stat->nprobboundchgs + scip->stat->nprobholechgs);
32612 
32613  SCIP_CALL( SCIPpropagateDomains(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
32614  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->conflict, scip->cliquetable,
32615  SCIPgetDepth(scip), maxproprounds, SCIP_PROPTIMING_ALWAYS, cutoff) );
32616 
32617  if( ndomredsfound != NULL )
32618  *ndomredsfound += scip->stat->nprobboundchgs + scip->stat->nprobholechgs;
32619 
32620  /* restore old objective function */
32621  if( changedobj )
32622  {
32623  int i;
32624 
32625  assert(objchgvars != NULL);
32626  assert(objchgvals != NULL);
32627 
32629  scip->tree->probingobjchanged = TRUE;
32630 
32631  for( i = 0; i < nobjchg; ++i )
32632  {
32633  SCIP_CALL( SCIPvarChgObj(objchgvars[i], scip->mem->probmem, scip->set, scip->transprob, scip->primal,
32634  scip->lp, scip->eventqueue, objchgvals[i]) );
32635  }
32636 
32637  SCIPfreeBufferArray(scip, &objchgvars);
32638  SCIPfreeBufferArray(scip, &objchgvals);
32639  }
32640 
32641  return SCIP_OKAY;
32642 }
32643 
32644 /** applies domain propagation on the probing sub problem, that was changed after SCIPstartProbing() was called;
32645  * only propagations of the binary variables fixed at the current probing node that are triggered by the implication
32646  * graph and the clique table are applied;
32647  * the propagated domains of the variables can be accessed with the usual bound accessing calls SCIPvarGetLbLocal()
32648  * and SCIPvarGetUbLocal(); the propagation is only valid locally, i.e. the local bounds as well as the changed
32649  * bounds due to SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), and SCIPfixVarProbing() are used for propagation
32650  *
32651  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32652  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32653  *
32654  * @pre This method can be called if @p scip is in one of the following stages:
32655  * - \ref SCIP_STAGE_PRESOLVING
32656  * - \ref SCIP_STAGE_SOLVING
32657  */
32659  SCIP* scip, /**< SCIP data structure */
32660  SCIP_Bool* cutoff /**< pointer to store whether the probing node can be cut off */
32661  )
32662 {
32663  SCIP_CALL( checkStage(scip, "SCIPpropagateProbingImplications", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32664 
32665  if( !SCIPtreeProbing(scip->tree) )
32666  {
32667  SCIPerrorMessage("not in probing mode\n");
32668  return SCIP_INVALIDCALL;
32669  }
32670 
32672  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, cutoff) );
32673 
32674  return SCIP_OKAY;
32675 }
32676 
32677 /** solves the LP at the current probing node (cannot be applied at preprocessing stage) with or without pricing */
32678 static
32680  SCIP* scip, /**< SCIP data structure */
32681  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
32682  SCIP_Bool pricing, /**< should pricing be applied? */
32683  SCIP_Bool pretendroot, /**< should the pricers be called as if we are at the root node? */
32684  SCIP_Bool displayinfo, /**< should info lines be displayed after each pricing round? */
32685  int maxpricerounds, /**< maximal number of pricing rounds (-1: no limit) */
32686  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
32687  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
32688  * limit was reached (or NULL, if not needed) */
32689  )
32690 {
32691  SCIP_Bool initcutoff;
32692 
32693  assert(lperror != NULL);
32694  assert(SCIPtreeIsFocusNodeLPConstructed(scip->tree));
32695 
32696  if( !SCIPtreeProbing(scip->tree) )
32697  {
32698  SCIPerrorMessage("not in probing mode\n");
32699  return SCIP_INVALIDCALL;
32700  }
32701  assert(SCIPtreeGetCurrentDepth(scip->tree) > 0);
32702 
32703  SCIP_CALL( SCIPinitConssLP(scip->mem->probmem, scip->set, scip->sepastore, scip->stat, scip->transprob,
32704  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->eventfilter,
32705  scip->cliquetable, FALSE, FALSE, &initcutoff) );
32706 
32707  if( initcutoff )
32708  {
32709  if( cutoff != NULL )
32710  *cutoff = TRUE;
32711 
32712  return SCIP_OKAY;
32713  }
32714  else if( cutoff != NULL )
32715  *cutoff = FALSE;
32716 
32717  /* load the LP state (if necessary) */
32718  SCIP_CALL( SCIPtreeLoadProbingLPState(scip->tree, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
32719 
32720  SCIPlpSetIsRelax(scip->lp, TRUE);
32721 
32722  /* solve probing LP */
32723  SCIP_CALL( SCIPlpSolveAndEval(scip->lp, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat,
32724  scip->eventqueue, scip->eventfilter, scip->transprob, (SCIP_Longint)itlim, FALSE, FALSE, FALSE, lperror) );
32725 
32726  assert((*lperror) || SCIPlpGetSolstat(scip->lp) != SCIP_LPSOLSTAT_NOTSOLVED);
32727 
32728  /* mark the probing node to have a solved LP */
32729  if( !(*lperror) )
32730  {
32731  SCIP_CALL( SCIPtreeMarkProbingNodeHasLP(scip->tree, scip->mem->probmem, scip->lp) );
32732 
32733  /* call pricing */
32734  if( pricing )
32735  {
32736  SCIP_Bool mustsepa;
32737  int npricedcolvars;
32738  SCIP_Bool result;
32739 
32740  mustsepa = FALSE;
32741  SCIP_CALL( SCIPpriceLoop(scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
32742  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore,
32743  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable, pretendroot, displayinfo,
32744  maxpricerounds, &npricedcolvars, &mustsepa, lperror, &result) );
32745 
32746  /* mark the probing node again to update the LP size in the node and the tree path */
32747  if( !(*lperror) )
32748  {
32749  SCIP_CALL( SCIPtreeMarkProbingNodeHasLP(scip->tree, scip->mem->probmem, scip->lp) );
32750  }
32751  }
32752  }
32753 
32754  /* remember that probing might have changed the LPi state; this holds even if solving returned with an LP error */
32755  scip->tree->probingsolvedlp = TRUE;
32756 
32757  /* the LP is infeasible or the objective limit was reached */
32758  if( !(*lperror) && (SCIPlpGetSolstat(scip->lp) == SCIP_LPSOLSTAT_INFEASIBLE
32761  && SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip)))) )
32762  {
32763  /* analyze the infeasible LP (only if all columns are in the LP and no external pricers exist) */
32764  if( !scip->set->misc_exactsolve && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->tree->probingobjchanged )
32765  {
32766  SCIP_CALL( SCIPconflictAnalyzeLP(scip->conflict, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
32767  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, NULL) );
32768  }
32769 
32770  if( cutoff != NULL )
32771  *cutoff = TRUE;
32772  }
32773 
32774  return SCIP_OKAY;
32775 }
32776 
32777 /** solves the LP at the current probing node (cannot be applied at preprocessing stage);
32778  * no separation or pricing is applied
32779  *
32780  * The LP has to be constructed before (you can use SCIPisLPConstructed() or SCIPconstructLP()).
32781  *
32782  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32783  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32784  *
32785  * @pre This method can be called if @p scip is in one of the following stages:
32786  * - \ref SCIP_STAGE_SOLVING
32787  */
32789  SCIP* scip, /**< SCIP data structure */
32790  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
32791  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
32792  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
32793  * limit was reached (or NULL, if not needed) */
32794  )
32795 {
32796  SCIP_CALL( checkStage(scip, "SCIPsolveProbingLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32797 
32798  SCIP_CALL( solveProbingLP(scip, itlim, FALSE, FALSE, FALSE, -1, lperror, cutoff) );
32799 
32800  return SCIP_OKAY;
32801 }
32802 
32803 /** solves the LP at the current probing node (cannot be applied at preprocessing stage) and applies pricing
32804  * until the LP is solved to optimality; no separation is applied
32805  *
32806  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32807  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32808  *
32809  * @pre This method can be called if @p scip is in one of the following stages:
32810  * - \ref SCIP_STAGE_SOLVING
32811  */
32813  SCIP* scip, /**< SCIP data structure */
32814  SCIP_Bool pretendroot, /**< should the pricers be called as if we were at the root node? */
32815  SCIP_Bool displayinfo, /**< should info lines be displayed after each pricing round? */
32816  int maxpricerounds, /**< maximal number of pricing rounds (-1: no limit);
32817  * a finite limit means that the LP might not be solved to optimality! */
32818  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
32819  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
32820  * limit was reached (or NULL, if not needed) */
32821  )
32822 {
32823  SCIP_CALL( checkStage(scip, "SCIPsolveProbingLPWithPricing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32824 
32825  SCIP_CALL( solveProbingLP(scip, -1, TRUE, pretendroot, displayinfo, maxpricerounds, lperror, cutoff) );
32826 
32827  return SCIP_OKAY;
32828 }
32829 
32830 /** adds a row to the LP in the current probing node
32831  *
32832  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32833  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32834  *
32835  * @pre This method can be called if @p scip is in one of the following stages:
32836  * - \ref SCIP_STAGE_SOLVING
32837  *
32838  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
32839  */
32841  SCIP* scip, /**< SCIP data structure */
32842  SCIP_ROW* row /**< row to be added */
32843  )
32844 {
32845  SCIP_NODE* node;
32846  int depth;
32847 
32848  assert(scip != NULL);
32849  assert(row != NULL);
32850 
32851  SCIP_CALL( checkStage(scip, "SCIPaddRowProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32852 
32853  if( !SCIPtreeProbing(scip->tree) )
32854  {
32855  SCIPerrorMessage("not in probing mode\n");
32856  return SCIP_INVALIDCALL;
32857  }
32858 
32859  /* get depth of current node */
32860  node = SCIPtreeGetCurrentNode(scip->tree);
32861  assert(node != NULL);
32862  depth = SCIPnodeGetDepth(node);
32863 
32864  SCIP_CALL( SCIPlpAddRow(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, row, depth) );
32865 
32866  return SCIP_OKAY;
32867 }
32868 
32869 
32870 /** applies the cuts in the separation storage to the LP and clears the storage afterwards;
32871  * this method can only be applied during probing; the user should resolve the probing LP afterwards
32872  * in order to get a new solution
32873  *
32874  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32875  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32876  *
32877  * @pre This method can be called if @p scip is in one of the following stages:
32878  * - \ref SCIP_STAGE_SOLVING
32879  */
32881  SCIP* scip, /**< SCIP data structure */
32882  SCIP_Bool* cutoff /**< pointer to store whether an empty domain was created */
32883  )
32884 {
32885  SCIP_CALL( checkStage(scip, "SCIPapplyCutsProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32886 
32887  if( !SCIPtreeProbing(scip->tree) )
32888  {
32889  SCIPerrorMessage("not in probing mode\n");
32890  return SCIP_INVALIDCALL;
32891  }
32892 
32893  SCIP_CALL( SCIPsepastoreApplyCuts(scip->sepastore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
32894  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->eventfilter,
32895  scip->cliquetable, FALSE, SCIP_EFFICIACYCHOICE_LP, cutoff) );
32896 
32897  return SCIP_OKAY;
32898 }
32899 
32900 /** gets the candidate score and preferred rounding direction for a candidate variable */
32902  SCIP* scip, /**< SCIP data structure */
32903  SCIP_DIVESET* diveset, /**< general diving settings */
32904  SCIP_DIVETYPE divetype, /**< represents different methods for a dive set to explore the next children */
32905  SCIP_VAR* divecand, /**< the candidate for which the branching direction is requested */
32906  SCIP_Real divecandsol, /**< LP solution value of the candidate */
32907  SCIP_Real divecandfrac, /**< fractionality of the candidate */
32908  SCIP_Real* candscore, /**< pointer to store the candidate score */
32909  SCIP_Bool* roundup /**< pointer to store whether preferred direction for diving is upwards */
32910  )
32911 {
32912  assert(scip != NULL);
32913  assert(candscore != NULL);
32914  assert(roundup != NULL);
32915  assert(divecand != NULL);
32916 
32917  SCIP_CALL( checkStage(scip, "SCIPgetDivesetScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32918 
32919  SCIP_CALL( SCIPdivesetGetScore(diveset, scip->set, divetype, divecand, divecandsol, divecandfrac, candscore, roundup) );
32920 
32921  return SCIP_OKAY;
32922 }
32923 
32924 /** update diveset LP statistics, should be called after every LP solved by this diving heuristic */
32926  SCIP* scip, /**< SCIP data structure */
32927  SCIP_DIVESET* diveset, /**< diving settings */
32928  SCIP_Longint niterstoadd /**< additional number of LP iterations to be added */
32929  )
32930 {
32931  assert(scip != NULL);
32932  assert(diveset != NULL);
32933 
32934  SCIPdivesetUpdateLPStats(diveset, scip->stat, niterstoadd);
32935 }
32936 
32937 /** update diveset statistics and global diveset statistics */
32939  SCIP* scip, /**< SCIP data structure */
32940  SCIP_DIVESET* diveset, /**< diveset to be reset */
32941  int nprobingnodes, /**< the number of probing nodes explored this time */
32942  int nbacktracks, /**< the number of backtracks during probing this time */
32943  SCIP_Longint nsolsfound, /**< the number of solutions found */
32944  SCIP_Longint nbestsolsfound, /**< the number of best solutions found */
32945  SCIP_Bool leavewassol /**< was a solution found at the leaf? */
32946  )
32947 {
32948  assert(scip != NULL);
32949  assert(diveset != NULL);
32950  assert(SCIPinProbing(scip));
32951 
32952  SCIPdivesetUpdateStats(diveset, scip->stat, SCIPgetDepth(scip), nprobingnodes, nbacktracks, nsolsfound, nbestsolsfound, leavewassol);
32953 }
32954 
32955 /** enforces a probing/diving solution by suggesting bound changes that maximize the score w.r.t. the current diving settings
32956  *
32957  * the process is guided by the enforcement priorities of the constraint handlers and the scoring mechanism provided by
32958  * the dive set.
32959  * Constraint handlers may suggest diving bound changes in decreasing order of their enforcement priority, based on the
32960  * solution values in the solution @p sol and the current local bounds of the variables. A diving bound change
32961  * is a triple (variable,branching direction,value) and is used inside SCIPperformGenericDivingAlgorithm().
32962  *
32963  * After a successful call, SCIP holds two arrays of suggested dive bound changes, one for the preferred child
32964  * and one for the alternative.
32965  *
32966  * @see SCIPgetDiveBoundChangeData() for retrieving the dive bound change suggestions.
32967  *
32968  * The method stops after the first constraint handler was successful
32969  *
32970  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32971  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32972  *
32973  * @pre This method can be called if @p scip is in one of the following stages:
32974  * - \ref SCIP_STAGE_SOLVING
32975  *
32976  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
32977  */
32979  SCIP* scip, /**< SCIP data structure */
32980  SCIP_DIVESET* diveset, /**< diving settings to control scoring */
32981  SCIP_SOL* sol, /**< current solution of diving mode */
32982  SCIP_Bool* success, /**< pointer to store whether constraint handler successfully found a variable */
32983  SCIP_Bool* infeasible /**< pointer to store whether the current node was detected to be infeasible */
32984  )
32985 {
32986  int i;
32987 
32988  assert(scip != NULL);
32989  assert(diveset != NULL);
32990  assert(SCIPinProbing(scip));
32991  assert(infeasible != NULL);
32992  assert(success != NULL);
32993 
32994  SCIP_CALL( checkStage(scip, "SCIPgetDiveBoundChanges", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32995 
32996  *success = FALSE;
32997  *infeasible = FALSE;
32998 
32999  /* we invalidate the previously stored bound changes */
33001 
33002  /* loop over constraint handlers until a constraint handler successfully found a variable/value assignment for proceeding
33003  * or a constraint handler detected the infeasibility of the local node
33004  */
33005  for( i = 0; i < scip->set->nconshdlrs && !(*success || *infeasible); ++i )
33006  {
33007  SCIP_CALL( SCIPconshdlrGetDiveBoundChanges(scip->set->conshdlrs_enfo[i], scip->set, diveset, sol, success, infeasible) );
33008 
33009  }
33010 #ifndef NDEBUG
33011  /* check if the constraint handler correctly assigned values to the dive set */
33012  if( *success )
33013  {
33014  SCIP_VAR** bdchgvars;
33015  SCIP_BRANCHDIR* bdchgdirs;
33016  SCIP_Real* values;
33017  int nbdchanges;
33018  SCIPtreeGetDiveBoundChangeData(scip->tree, &bdchgvars, &bdchgdirs, &values, &nbdchanges, TRUE);
33019  assert(nbdchanges > 0);
33020  SCIPtreeGetDiveBoundChangeData(scip->tree, &bdchgvars, &bdchgdirs, &values, &nbdchanges, FALSE);
33021  assert(nbdchanges > 0);
33022  }
33023 #endif
33024 
33025  return SCIP_OKAY;
33026 }
33027 
33028 /** adds a diving bound change to the diving bound change storage of SCIP together with the information if this is a
33029  * bound change for the preferred direction or not
33030  *
33031  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33032  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33033  *
33034  * @pre This method can be called if @p scip is in one of the following stages:
33035  * - \ref SCIP_STAGE_SOLVING
33036  *
33037  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33038  */
33040  SCIP* scip, /**< SCIP data structure */
33041  SCIP_VAR* var, /**< variable to apply the bound change to */
33042  SCIP_BRANCHDIR dir, /**< direction of the bound change */
33043  SCIP_Real value, /**< value to adjust this variable bound to */
33044  SCIP_Bool preferred /**< is this a bound change for the preferred child? */
33045  )
33046 {
33047  assert(scip->tree != NULL);
33048  assert(scip->mem->probmem != NULL);
33049  assert(SCIPinProbing(scip));
33050 
33051  SCIP_CALL( checkStage(scip, "SCIPaddDiveBoundChange", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33052 
33053  SCIP_CALL( SCIPtreeAddDiveBoundChange(scip->tree, scip->mem->probmem, var, dir, value, preferred) );
33054 
33055  return SCIP_OKAY;
33056 }
33057 
33058 /** get the dive bound change data for the preferred or the alternative direction
33059  *
33060  * @pre This method can be called if @p scip is in one of the following stages:
33061  * - \ref SCIP_STAGE_SOLVING
33062  *
33063  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33064  */
33066  SCIP* scip, /**< SCIP data structure */
33067  SCIP_VAR*** variables, /**< pointer to store variables for the specified direction */
33068  SCIP_BRANCHDIR** directions, /**< pointer to store the branching directions */
33069  SCIP_Real** values, /**< pointer to store bound change values */
33070  int* ndivebdchgs, /**< pointer to store the number of dive bound changes */
33071  SCIP_Bool preferred /**< should the dive bound changes for the preferred child be output? */
33072  )
33073 {
33074  assert(variables != NULL);
33075  assert(directions != NULL);
33076  assert(values != NULL);
33077  assert(ndivebdchgs != NULL);
33078  assert(SCIPinProbing(scip));
33079 
33080  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDiveBoundChangeData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33081 
33082  SCIPtreeGetDiveBoundChangeData(scip->tree, variables, directions, values, ndivebdchgs, preferred);
33083 }
33084 
33085 /** clear the dive bound change data structures
33086  *
33087  * @pre This method can be called if @p scip is in one of the following stages:
33088  * - \ref SCIP_STAGE_SOLVING
33089  *
33090  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33091  */
33093  SCIP* scip /**< SCIP data structure */
33094  )
33095 {
33096  assert(scip->tree != NULL);
33097 
33098  SCIP_CALL_ABORT( checkStage(scip, "SCIPclearDiveBoundChanges", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33099 
33101 }
33102 
33103 
33104 /*
33105  * branching methods
33106  */
33107 
33108 /** gets branching candidates for LP solution branching (fractional variables) along with solution values,
33109  * fractionalities, and number of branching candidates; The number of branching candidates does NOT
33110  * account for fractional implicit integer variables which should not be used for branching decisions.
33111  *
33112  * Fractional implicit integer variables are stored at the positions *nlpcands to *nlpcands + *nfracimplvars - 1
33113  *
33114  * branching rules should always select the branching candidate among the first npriolpcands of the candidate
33115  * list
33116  *
33117  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33118  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33119  *
33120  * @pre This method can be called if @p scip is in one of the following stages:
33121  * - \ref SCIP_STAGE_SOLVING
33122  *
33123  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33124  */
33126  SCIP* scip, /**< SCIP data structure */
33127  SCIP_VAR*** lpcands, /**< pointer to store the array of LP branching candidates, or NULL */
33128  SCIP_Real** lpcandssol, /**< pointer to store the array of LP candidate solution values, or NULL */
33129  SCIP_Real** lpcandsfrac, /**< pointer to store the array of LP candidate fractionalities, or NULL */
33130  int* nlpcands, /**< pointer to store the number of LP branching candidates, or NULL */
33131  int* npriolpcands, /**< pointer to store the number of candidates with maximal priority, or NULL */
33132  int* nfracimplvars /**< pointer to store the number of fractional implicit integer variables, or NULL */
33133  )
33134 {
33135  SCIP_CALL( checkStage(scip, "SCIPgetLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33136 
33138  {
33139  SCIPerrorMessage("LP not solved to optimality - solstat=%d\n", SCIPlpGetSolstat(scip->lp));
33140  return SCIP_INVALIDDATA;
33141  }
33142 
33143  SCIP_CALL( SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
33144  lpcands, lpcandssol, lpcandsfrac, nlpcands, npriolpcands, nfracimplvars) );
33145 
33146  return SCIP_OKAY;
33147 }
33148 
33149 /** gets number of branching candidates for LP solution branching (number of fractional variables)
33150  *
33151  * @return the number of branching candidates for LP solution branching (number of fractional variables).
33152  *
33153  * @pre This method can be called if @p scip is in one of the following stages:
33154  * - \ref SCIP_STAGE_SOLVING
33155  *
33156  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33157  */
33159  SCIP* scip /**< SCIP data structure */
33160  )
33161 {
33162  SCIP_RETCODE retcode;
33163  int nlpcands;
33164 
33165  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33166 
33168  {
33169  SCIPerrorMessage("LP not solved to optimality\n");
33170  SCIPABORT();
33171  return 0; /*lint !e527*/
33172  }
33173 
33174  retcode = SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
33175  NULL, NULL, NULL, &nlpcands, NULL, NULL);
33176 
33177  if( retcode != SCIP_OKAY )
33178  {
33179  SCIPerrorMessage("Error <%u> during computation of the number of LP branching candidates\n", retcode);
33180  SCIPABORT();
33181  return 0; /*lint !e527*/
33182  }
33183 
33184  return nlpcands;
33185 }
33186 
33187 /** gets number of branching candidates with maximal priority for LP solution branching
33188  *
33189  * @return the number of branching candidates with maximal priority for LP solution branching.
33190  *
33191  * @pre This method can be called if @p scip is in one of the following stages:
33192  * - \ref SCIP_STAGE_SOLVING
33193  *
33194  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33195  */
33197  SCIP* scip /**< SCIP data structure */
33198  )
33199 {
33200  SCIP_RETCODE retcode;
33201  int npriolpcands;
33202 
33203  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33204 
33206  {
33207  SCIPerrorMessage("LP not solved to optimality\n");
33208  SCIPABORT();
33209  return 0; /*lint !e527*/
33210  }
33211 
33212  retcode = SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
33213  NULL, NULL, NULL, NULL, &npriolpcands, NULL);
33214 
33215  if( retcode != SCIP_OKAY )
33216  {
33217  SCIPerrorMessage("Error <%u> during computation of the number of LP branching candidates with maximal priority\n", retcode);
33218  SCIPABORT();
33219  return 0; /*lint !e527*/
33220  }
33221 
33222  return npriolpcands;
33223 }
33224 
33225 /** gets external branching candidates along with solution values, scores, and number of branching candidates;
33226  * these branching candidates can be used by relaxations or nonlinear constraint handlers;
33227  * branching rules should always select the branching candidate among the first nprioexterncands of the candidate
33228  * list
33229  *
33230  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33231  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33232  *
33233  * @pre This method can be called if @p scip is in one of the following stages:
33234  * - \ref SCIP_STAGE_SOLVING
33235  *
33236  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33237  *
33238  * @note Candidate variables with maximal priority are ordered: binaries first, then integers, implicit integers and
33239  * continuous last.
33240  */
33242  SCIP* scip, /**< SCIP data structure */
33243  SCIP_VAR*** externcands, /**< pointer to store the array of extern branching candidates, or NULL */
33244  SCIP_Real** externcandssol, /**< pointer to store the array of extern candidate solution values, or NULL */
33245  SCIP_Real** externcandsscore, /**< pointer to store the array of extern candidate scores, or NULL */
33246  int* nexterncands, /**< pointer to store the number of extern branching candidates, or NULL */
33247  int* nprioexterncands, /**< pointer to store the number of candidates with maximal priority, or NULL */
33248  int* nprioexternbins, /**< pointer to store the number of binary candidates with maximal priority, or NULL */
33249  int* nprioexternints, /**< pointer to store the number of integer candidates with maximal priority, or NULL */
33250  int* nprioexternimpls /**< pointer to store the number of implicit integer candidates with maximal priority,
33251  * or NULL */
33252  )
33253 {
33254  assert(scip != NULL);
33255 
33256  SCIP_CALL( checkStage(scip, "SCIPgetExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33257 
33258  SCIP_CALL( SCIPbranchcandGetExternCands(scip->branchcand, externcands, externcandssol, externcandsscore, nexterncands,
33259  nprioexterncands, nprioexternbins, nprioexternints, nprioexternimpls) );
33260 
33261  return SCIP_OKAY;
33262 }
33263 
33264 /** gets number of external branching candidates
33265  *
33266  * @return the number of external branching candidates.
33267  *
33268  * @pre This method can be called if @p scip is in one of the following stages:
33269  * - \ref SCIP_STAGE_SOLVING
33270  *
33271  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33272  */
33274  SCIP* scip /**< SCIP data structure */
33275  )
33276 {
33277  assert(scip != NULL);
33278 
33279  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33280 
33282 }
33283 
33284 /** gets number of external branching candidates with maximal branch priority
33285  *
33286  * @return the number of external branching candidates with maximal branch priority.
33287  *
33288  * @pre This method can be called if @p scip is in one of the following stages:
33289  * - \ref SCIP_STAGE_SOLVING
33290  *
33291  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33292  */
33294  SCIP* scip /**< SCIP data structure */
33295  )
33296 {
33297  assert(scip != NULL);
33298 
33299  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33300 
33302 }
33303 
33304 /** gets number of binary external branching candidates with maximal branch priority
33305  *
33306  * @return the number of binary external branching candidates with maximal branch priority.
33307  *
33308  * @pre This method can be called if @p scip is in one of the following stages:
33309  * - \ref SCIP_STAGE_SOLVING
33310  *
33311  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33312  */
33314  SCIP* scip /**< SCIP data structure */
33315  )
33316 {
33317  assert(scip != NULL);
33318 
33319  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchBins", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33320 
33322 }
33323 
33324 
33325 /** gets number of integer external branching candidates with maximal branch priority
33326  *
33327  * @return the number of integer external branching candidates with maximal branch priority.
33328  *
33329  * @pre This method can be called if @p scip is in one of the following stages:
33330  * - \ref SCIP_STAGE_SOLVING
33331  *
33332  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33333  */
33335  SCIP* scip /**< SCIP data structure */
33336  )
33337 {
33338  assert(scip != NULL);
33339 
33340  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchInts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33341 
33343 }
33344 
33345 /** gets number of implicit integer external branching candidates with maximal branch priority
33346  *
33347  * @return the number of implicit integer external branching candidates with maximal branch priority.
33348  *
33349  * @pre This method can be called if @p scip is in one of the following stages:
33350  * - \ref SCIP_STAGE_SOLVING
33351  *
33352  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33353  */
33355  SCIP* scip /**< SCIP data structure */
33356  )
33357 {
33358  assert(scip != NULL);
33359 
33360  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchImpls", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33361 
33363 }
33364 
33365 /** gets number of continuous external branching candidates with maximal branch priority
33366  *
33367  * @return the number of continuous external branching candidates with maximal branch priority.
33368  *
33369  * @pre This method can be called if @p scip is in one of the following stages:
33370  * - \ref SCIP_STAGE_SOLVING
33371  *
33372  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33373  */
33375  SCIP* scip /**< SCIP data structure */
33376  )
33377 {
33378  assert(scip != NULL);
33379 
33380  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchConts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33381 
33383 }
33384 
33385 /** insert variable, its score and its solution value into the external branching candidate storage
33386  * the relative difference of the current lower and upper bounds of a continuous variable must be at least epsilon
33387  *
33388  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33389  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33390  *
33391  * @pre This method can be called if @p scip is in one of the following stages:
33392  * - \ref SCIP_STAGE_SOLVING
33393  *
33394  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33395  */
33397  SCIP* scip, /**< SCIP data structure */
33398  SCIP_VAR* var, /**< variable to insert */
33399  SCIP_Real score, /**< score of external candidate, e.g. infeasibility */
33400  SCIP_Real solval /**< value of the variable in the current solution */
33401  )
33402 {
33403  assert(scip != NULL);
33404  assert(var->scip == scip);
33405 
33406  SCIP_CALL( checkStage(scip, "SCIPaddExternBranchCand", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33407 
33408  SCIP_CALL( SCIPbranchcandAddExternCand(scip->branchcand, scip->set, var, score, solval) );
33409 
33410  return SCIP_OKAY;
33411 }
33412 
33413 /** removes all external candidates from the storage for external branching
33414  *
33415  * @pre This method can be called if @p scip is in one of the following stages:
33416  * - \ref SCIP_STAGE_SOLVING
33417  *
33418  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33419  */
33421  SCIP* scip /**< SCIP data structure */
33422  )
33423 {
33424  assert(scip != NULL);
33425 
33426  SCIP_CALL_ABORT( checkStage(scip, "SCIPclearExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33427 
33429 }
33430 
33431 /** checks whether the given variable is contained in the candidate storage for external branching
33432  *
33433  * @return whether the given variable is contained in the candidate storage for external branching.
33434  *
33435  * @pre This method can be called if @p scip is in one of the following stages:
33436  * - \ref SCIP_STAGE_SOLVING
33437  *
33438  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33439  */
33441  SCIP* scip, /**< SCIP data structure */
33442  SCIP_VAR* var /**< variable to look for */
33443  )
33444 {
33445  assert(scip != NULL);
33446  assert(var->scip == scip);
33447 
33448  SCIP_CALL_ABORT( checkStage(scip, "SCIPcontainsExternBranchCand", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33449 
33450  return SCIPbranchcandContainsExternCand(scip->branchcand, var);
33451 }
33452 
33453 /** gets branching candidates for pseudo solution branching (non-fixed variables) along with the number of candidates
33454  *
33455  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33456  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33457  *
33458  * @pre This method can be called if @p scip is in one of the following stages:
33459  * - \ref SCIP_STAGE_PRESOLVING
33460  * - \ref SCIP_STAGE_SOLVING
33461  *
33462  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33463  */
33465  SCIP* scip, /**< SCIP data structure */
33466  SCIP_VAR*** pseudocands, /**< pointer to store the array of pseudo branching candidates, or NULL */
33467  int* npseudocands, /**< pointer to store the number of pseudo branching candidates, or NULL */
33468  int* npriopseudocands /**< pointer to store the number of candidates with maximal priority, or NULL */
33469  )
33470 {
33471  SCIP_CALL( checkStage(scip, "SCIPgetPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33472 
33474  pseudocands, npseudocands, npriopseudocands) );
33475 
33476  return SCIP_OKAY;
33477 }
33478 
33479 /** gets number of branching candidates for pseudo solution branching (non-fixed variables)
33480  *
33481  * @return the number branching candidates for pseudo solution branching (non-fixed variables).
33482  *
33483  * @pre This method can be called if @p scip is in one of the following stages:
33484  * - \ref SCIP_STAGE_PRESOLVING
33485  * - \ref SCIP_STAGE_SOLVING
33486  *
33487  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33488  */
33490  SCIP* scip /**< SCIP data structure */
33491  )
33492 {
33493  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33494 
33496 }
33497 
33498 /** gets number of branching candidates with maximal branch priority for pseudo solution branching
33499  *
33500  * @return the number of branching candidates with maximal branch priority for pseudo solution branching.
33501  *
33502  * @pre This method can be called if @p scip is in one of the following stages:
33503  * - \ref SCIP_STAGE_PRESOLVING
33504  * - \ref SCIP_STAGE_SOLVING
33505  *
33506  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33507  */
33509  SCIP* scip /**< SCIP data structure */
33510  )
33511 {
33512  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33513 
33515 }
33516 
33517 /** gets number of binary branching candidates with maximal branch priority for pseudo solution branching
33518  *
33519  * @return the number of binary branching candidates with maximal branch priority for pseudo solution branching.
33520  *
33521  * @pre This method can be called if @p scip is in one of the following stages:
33522  * - \ref SCIP_STAGE_SOLVING
33523  *
33524  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33525  */
33527  SCIP* scip /**< SCIP data structure */
33528  )
33529 {
33530  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchBins", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33531 
33533 }
33534 
33535 /** gets number of integer branching candidates with maximal branch priority for pseudo solution branching
33536  *
33537  * @return the number of integer branching candidates with maximal branch priority for pseudo solution branching.
33538  *
33539  * @pre This method can be called if @p scip is in one of the following stages:
33540  * - \ref SCIP_STAGE_SOLVING
33541  *
33542  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33543  */
33545  SCIP* scip /**< SCIP data structure */
33546  )
33547 {
33548  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchInts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33549 
33551 }
33552 
33553 /** gets number of implicit integer branching candidates with maximal branch priority for pseudo solution branching
33554  *
33555  * @return the number of implicit integer branching candidates with maximal branch priority for pseudo solution branching.
33556  *
33557  * @pre This method can be called if @p scip is in one of the following stages:
33558  * - \ref SCIP_STAGE_SOLVING
33559  *
33560  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33561  */
33563  SCIP* scip /**< SCIP data structure */
33564  )
33565 {
33566  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchImpls", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33567 
33569 }
33570 
33571 /** calculates the branching score out of the gain predictions for a binary branching
33572  *
33573  * @return the branching score out of the gain predictions for a binary branching.
33574  *
33575  * @pre This method can be called if @p scip is in one of the following stages:
33576  * - \ref SCIP_STAGE_SOLVING
33577  *
33578  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33579  */
33581  SCIP* scip, /**< SCIP data structure */
33582  SCIP_VAR* var, /**< variable, of which the branching factor should be applied, or NULL */
33583  SCIP_Real downgain, /**< prediction of objective gain for rounding downwards */
33584  SCIP_Real upgain /**< prediction of objective gain for rounding upwards */
33585  )
33586 {
33587  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33588 
33589  assert( var == NULL || var->scip == scip );
33590 
33591  return SCIPbranchGetScore(scip->set, var, downgain, upgain);
33592 }
33593 
33594 /** calculates the branching score out of the gain predictions for a branching with arbitrary many children
33595  *
33596  * @return the branching score out of the gain predictions for a branching with arbitrary many children.
33597  *
33598  * @pre This method can be called if @p scip is in one of the following stages:
33599  * - \ref SCIP_STAGE_SOLVING
33600  *
33601  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33602  */
33604  SCIP* scip, /**< SCIP data structure */
33605  SCIP_VAR* var, /**< variable, of which the branching factor should be applied, or NULL */
33606  int nchildren, /**< number of children that the branching will create */
33607  SCIP_Real* gains /**< prediction of objective gain for each child */
33608  )
33609 {
33610  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchScoreMultiple", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33611 
33612  assert( var->scip == scip );
33613 
33614  return SCIPbranchGetScoreMultiple(scip->set, var, nchildren, gains);
33615 }
33616 
33617 /** computes a branching point for a continuous or discrete variable
33618  *
33619  * @see SCIPbranchGetBranchingPoint
33620  *
33621  * @return the branching point for a continuous or discrete variable.
33622  *
33623  * @pre This method can be called if @p scip is in one of the following stages:
33624  * - \ref SCIP_STAGE_SOLVING
33625  *
33626  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33627  */
33629  SCIP* scip, /**< SCIP data structure */
33630  SCIP_VAR* var, /**< variable, of which the branching point should be computed */
33631  SCIP_Real suggestion /**< suggestion for branching point, or SCIP_INVALID if no suggestion */
33632  )
33633 {
33634  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchingPoint", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33635 
33636  assert( var->scip == scip );
33637 
33638  return SCIPbranchGetBranchingPoint(scip->set, scip->tree, var, suggestion);
33639 }
33640 
33641 /** calculates the node selection priority for moving the given variable's LP value to the given target value;
33642  * this node selection priority can be given to the SCIPcreateChild() call
33643  *
33644  * @return the node selection priority for moving the given variable's LP value to the given target value.
33645  *
33646  * @pre This method can be called if @p scip is in one of the following stages:
33647  * - \ref SCIP_STAGE_SOLVING
33648  *
33649  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33650  */
33652  SCIP* scip, /**< SCIP data structure */
33653  SCIP_VAR* var, /**< variable on which the branching is applied */
33654  SCIP_BRANCHDIR branchdir, /**< type of branching that was performed: upwards, downwards, or fixed;
33655  * fixed should only be used, when both bounds changed
33656  */
33657  SCIP_Real targetvalue /**< new value of the variable in the child node */
33658  )
33659 {
33660  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalcNodeselPriority", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33661 
33662  assert( var->scip == scip );
33663 
33664  return SCIPtreeCalcNodeselPriority(scip->tree, scip->set, scip->stat, var, branchdir, targetvalue);
33665 }
33666 
33667 /** calculates an estimate for the objective of the best feasible solution contained in the subtree after applying the given
33668  * branching; this estimate can be given to the SCIPcreateChild() call
33669  *
33670  * @return the estimate for the objective of the best feasible solution contained in the subtree after applying the given
33671  * branching.
33672  *
33673  * @pre This method can be called if @p scip is in one of the following stages:
33674  * - \ref SCIP_STAGE_SOLVING
33675  *
33676  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33677  */
33679  SCIP* scip, /**< SCIP data structure */
33680  SCIP_VAR* var, /**< variable on which the branching is applied */
33681  SCIP_Real targetvalue /**< new value of the variable in the child node */
33682  )
33683 {
33684  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalcChildEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33685 
33686  assert( var->scip == scip );
33687 
33688  return SCIPtreeCalcChildEstimate(scip->tree, scip->set, scip->stat, var, targetvalue);
33689 }
33690 
33691 /** creates a child node of the focus node
33692  *
33693  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33694  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33695  *
33696  * @pre This method can be called if @p scip is in one of the following stages:
33697  * - \ref SCIP_STAGE_SOLVING
33698  *
33699  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33700  */
33702  SCIP* scip, /**< SCIP data structure */
33703  SCIP_NODE** node, /**< pointer to node data structure */
33704  SCIP_Real nodeselprio, /**< node selection priority of new node */
33705  SCIP_Real estimate /**< estimate for(transformed) objective value of best feasible solution in subtree */
33706  )
33707 {
33708  assert(node != NULL);
33709 
33710  SCIP_CALL( checkStage(scip, "SCIPcreateChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33711 
33712  SCIP_CALL( SCIPnodeCreateChild(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, nodeselprio, estimate) );
33713 
33714  return SCIP_OKAY;
33715 }
33716 
33717 /** branches on a non-continuous variable v using the current LP or pseudo solution;
33718  * if solution value x' is fractional, two child nodes will be created
33719  * (x <= floor(x'), x >= ceil(x')),
33720  * if solution value is integral, the x' is equal to lower or upper bound of the branching
33721  * variable and the bounds of v are finite, then two child nodes will be created
33722  * (x <= x'', x >= x''+1 with x'' = floor((lb + ub)/2)),
33723  * otherwise (up to) three child nodes will be created
33724  * (x <= x'-1, x == x', x >= x'+1)
33725  *
33726  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33727  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33728  *
33729  * @pre This method can be called if @p scip is in one of the following stages:
33730  * - \ref SCIP_STAGE_SOLVING
33731  *
33732  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33733  */
33735  SCIP* scip, /**< SCIP data structure */
33736  SCIP_VAR* var, /**< variable to branch on */
33737  SCIP_NODE** downchild, /**< pointer to return the left child with variable rounded down, or NULL */
33738  SCIP_NODE** eqchild, /**< pointer to return the middle child with variable fixed, or NULL */
33739  SCIP_NODE** upchild /**< pointer to return the right child with variable rounded up, or NULL */
33740  )
33741 {
33742  SCIP_CALL( checkStage(scip, "SCIPbranchVar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33743 
33744  assert( var->scip == scip );
33745 
33747  {
33748  SCIPerrorMessage("cannot branch on continuous variable <%s>\n", SCIPvarGetName(var));
33749  return SCIP_INVALIDDATA;
33750  }
33751 
33752  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
33753  {
33754  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
33756  return SCIP_INVALIDDATA;
33757  }
33758 
33759  SCIP_CALL( SCIPtreeBranchVar(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
33760  scip->lp, scip->branchcand, scip->eventqueue, var, SCIP_INVALID, downchild, eqchild, upchild) );
33761 
33762  return SCIP_OKAY;
33763 }
33764 
33765 /** branches a variable x using a given domain hole; two child nodes (x <= left, x >= right) are created
33766  *
33767  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33768  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33769  *
33770  * @pre This method can be called if @p scip is in one of the following stages:
33771  * - \ref SCIP_STAGE_SOLVING
33772  *
33773  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33774  */
33776  SCIP* scip, /**< SCIP data structure */
33777  SCIP_VAR* var, /**< variable to branch on */
33778  SCIP_Real left, /**< left side of the domain hole */
33779  SCIP_Real right, /**< right side of the domain hole */
33780  SCIP_NODE** downchild, /**< pointer to return the left child (x <= left), or NULL */
33781  SCIP_NODE** upchild /**< pointer to return the right child (x >= right), or NULL */
33782  )
33783 {
33784  SCIP_CALL( checkStage(scip, "SCIPbranchVarHole", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33785 
33786  assert( var->scip == scip );
33787 
33788  SCIP_CALL( SCIPtreeBranchVarHole(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
33789  scip->origprob, scip->lp, scip->branchcand, scip->eventqueue, var, left, right, downchild, upchild) );
33790 
33791  return SCIP_OKAY;
33792 }
33793 
33794 /** branches on a variable x using a given value x';
33795  * for continuous variables with relative domain width larger epsilon, x' must not be one of the bounds;
33796  * two child nodes (x <= x', x >= x') are created;
33797  * for integer variables, if solution value x' is fractional, two child nodes are created
33798  * (x <= floor(x'), x >= ceil(x')),
33799  * if x' is integral, three child nodes are created
33800  * (x <= x'-1, x == x', x >= x'+1)
33801  *
33802  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33803  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33804  *
33805  * @pre This method can be called if @p scip is in one of the following stages:
33806  * - \ref SCIP_STAGE_SOLVING
33807  *
33808  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33809  */
33811  SCIP* scip, /**< SCIP data structure */
33812  SCIP_VAR* var, /**< variable to branch on */
33813  SCIP_Real val, /**< value to branch on */
33814  SCIP_NODE** downchild, /**< pointer to return the left child with variable rounded down, or NULL */
33815  SCIP_NODE** eqchild, /**< pointer to return the middle child with variable fixed, or NULL */
33816  SCIP_NODE** upchild /**< pointer to return the right child with variable rounded up, or NULL */
33817  )
33818 {
33819  SCIP_CALL( checkStage(scip, "SCIPbranchVarVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33820 
33821  assert( var->scip == scip );
33822 
33823  /* A continuous variable will be fixed if SCIPisRelEQ(lb,ub) is true. Otherwise, the given branching value should be
33824  * such that its value is not equal to one of the bounds. We assert this by requiring that it is at least eps/2 away
33825  * from each bound. The 2.1 is there, because ub-lb may be in (eps, 2*eps], in which case there is no way to choose a
33826  * branching value that is at least eps away from both bounds. However, if the variable bounds are below/above
33827  * -/+infinity * 2.1, then SCIPisLT will give an assert, so we omit the check in this case.
33828  */
33829  assert(SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS ||
33830  SCIPisRelEQ(scip, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) ||
33831  SCIPisInfinity(scip, -2.1*SCIPvarGetLbLocal(var)) || SCIPisInfinity(scip, 2.1*SCIPvarGetUbLocal(var)) ||
33832  (SCIPisLT(scip, 2.1*SCIPvarGetLbLocal(var), 2.1*val) && SCIPisLT(scip, 2.1*val, 2.1*SCIPvarGetUbLocal(var)) ) );
33833 
33834  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
33835  {
33836  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
33838  return SCIP_INVALIDDATA;
33839  }
33840 
33841  SCIP_CALL( SCIPtreeBranchVar(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
33842  scip->lp, scip->branchcand, scip->eventqueue, var, val, downchild, eqchild, upchild) );
33843 
33844  return SCIP_OKAY;
33845 }
33846 
33847 /** n-ary branching on a variable x using a given value
33848  *
33849  * Branches on variable x such that up to n/2 children are created on each side of the usual branching value.
33850  * The branching value is selected as in SCIPbranchVarVal().
33851  * The parameters minwidth and widthfactor determine the domain width of the branching variable in the child nodes.
33852  * If n is odd, one child with domain width 'width' and having the branching value in the middle is created.
33853  * Otherwise, two children with domain width 'width' and being left and right of the branching value are created.
33854  * Next further nodes to the left and right are created, where width is multiplied by widthfactor with increasing distance
33855  * from the first nodes.
33856  * The initial width is calculated such that n/2 nodes are created to the left and to the right of the branching value.
33857  * If this value is below minwidth, the initial width is set to minwidth, which may result in creating less than n nodes.
33858  *
33859  * Giving a large value for widthfactor results in creating children with small domain when close to the branching value
33860  * and large domain when closer to the current variable bounds. That is, setting widthfactor to a very large value and n to 3
33861  * results in a ternary branching where the branching variable is mostly fixed in the middle child.
33862  * Setting widthfactor to 1.0 results in children where the branching variable always has the same domain width
33863  * (except for one child if the branching value is not in the middle).
33864  *
33865  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33866  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33867  *
33868  * @pre This method can be called if @p scip is in one of the following stages:
33869  * - \ref SCIP_STAGE_SOLVING
33870  *
33871  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33872  */
33874  SCIP* scip, /**< SCIP data structure */
33875  SCIP_VAR* var, /**< variable to branch on */
33876  SCIP_Real val, /**< value to branch on */
33877  int n, /**< attempted number of children to be created, must be >= 2 */
33878  SCIP_Real minwidth, /**< minimal domain width in children */
33879  SCIP_Real widthfactor, /**< multiplier for children domain width with increasing distance from val, must be >= 1.0 */
33880  int* nchildren /**< pointer to store number of created children, or NULL */
33881  )
33882 {
33883  SCIP_CALL( checkStage(scip, "SCIPbranchVarValNary", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33884 
33885  assert( var->scip == scip );
33886 
33887  /* see comment in SCIPbranchVarVal */
33888  assert(SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS ||
33889  SCIPisRelEQ(scip, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) ||
33890  SCIPisInfinity(scip, -2.1*SCIPvarGetLbLocal(var)) || SCIPisInfinity(scip, 2.1*SCIPvarGetUbLocal(var)) ||
33891  (SCIPisLT(scip, 2.1*SCIPvarGetLbLocal(var), 2.1*val) && SCIPisLT(scip, 2.1*val, 2.1*SCIPvarGetUbLocal(var)) ) );
33892 
33893  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
33894  {
33895  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
33897  return SCIP_INVALIDDATA;
33898  }
33899 
33900  SCIP_CALL( SCIPtreeBranchVarNary(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
33901  scip->origprob, scip->lp, scip->branchcand, scip->eventqueue, var, val, n, minwidth, widthfactor, nchildren) );
33902 
33903  return SCIP_OKAY;
33904 }
33905 
33906 /** calls branching rules to branch on an LP solution; if no fractional variables exist, the result is SCIP_DIDNOTRUN;
33907  * if the branch priority of an unfixed variable is larger than the maximal branch priority of the fractional
33908  * variables, pseudo solution branching is applied on the unfixed variables with maximal branch priority
33909  *
33910  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33911  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33912  *
33913  * @pre This method can be called if @p scip is in one of the following stages:
33914  * - \ref SCIP_STAGE_SOLVING
33915  *
33916  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33917  */
33919  SCIP* scip, /**< SCIP data structure */
33920  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
33921  )
33922 {
33923  SCIP_CALL( checkStage(scip, "SCIPbranchLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33924 
33925  SCIP_CALL( SCIPbranchExecLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
33926  scip->tree, scip->reopt, scip->lp, scip->sepastore, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound,
33927  TRUE, result) );
33928 
33929  return SCIP_OKAY;
33930 }
33931 
33932 /** calls branching rules to branch on a external candidates; if no such candidates exist, the result is SCIP_DIDNOTRUN
33933  *
33934  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33935  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33936  *
33937  * @pre This method can be called if @p scip is in one of the following stages:
33938  * - \ref SCIP_STAGE_SOLVING
33939  *
33940  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33941  */
33943  SCIP* scip, /**< SCIP data structure */
33944  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
33945  )
33946 {
33947  SCIP_CALL( checkStage(scip, "SCIPbranchExtern", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33948 
33949  SCIP_CALL( SCIPbranchExecExtern(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
33950  scip->tree, scip->reopt, scip->lp, scip->sepastore, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound,
33951  TRUE, result) );
33952 
33953  return SCIP_OKAY;
33954 }
33955 
33956 /** calls branching rules to branch on a pseudo solution; if no unfixed variables exist, the result is SCIP_DIDNOTRUN
33957  *
33958  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33959  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33960  *
33961  * @pre This method can be called if @p scip is in one of the following stages:
33962  * - \ref SCIP_STAGE_SOLVING
33963  *
33964  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33965  */
33967  SCIP* scip, /**< SCIP data structure */
33968  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
33969  )
33970 {
33971  SCIP_CALL( checkStage(scip, "SCIPbranchPseudo", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33972 
33973  SCIP_CALL( SCIPbranchExecPseudo(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
33974  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound, TRUE, result) );
33975 
33976  return SCIP_OKAY;
33977 }
33978 
33979 
33980 
33981 
33982 /*
33983  * primal solutions
33984  */
33985 
33986 /** creates a primal solution, initialized to zero
33987  *
33988  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33989  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33990  *
33991  * @pre This method can be called if SCIP is in one of the following stages:
33992  * - \ref SCIP_STAGE_PROBLEM
33993  * - \ref SCIP_STAGE_TRANSFORMING
33994  * - \ref SCIP_STAGE_TRANSFORMED
33995  * - \ref SCIP_STAGE_INITPRESOLVE
33996  * - \ref SCIP_STAGE_PRESOLVING
33997  * - \ref SCIP_STAGE_EXITPRESOLVE
33998  * - \ref SCIP_STAGE_PRESOLVED
33999  * - \ref SCIP_STAGE_INITSOLVE
34000  * - \ref SCIP_STAGE_SOLVING
34001  */
34003  SCIP* scip, /**< SCIP data structure */
34004  SCIP_SOL** sol, /**< pointer to store the solution */
34005  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
34006  )
34007 {
34008  SCIP_CALL( checkStage(scip, "SCIPcreateSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34009 
34010  switch( scip->set->stage )
34011  {
34012  case SCIP_STAGE_PROBLEM:
34013  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->origprimal, NULL, heur) );
34014  return SCIP_OKAY;
34015 
34019  case SCIP_STAGE_PRESOLVING:
34021  case SCIP_STAGE_PRESOLVED:
34022  case SCIP_STAGE_INITSOLVE:
34023  case SCIP_STAGE_SOLVING:
34024  SCIP_CALL( SCIPsolCreate(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, heur) );
34025  return SCIP_OKAY;
34026 
34027  case SCIP_STAGE_SOLVED:
34028  case SCIP_STAGE_EXITSOLVE:
34029  case SCIP_STAGE_FREETRANS:
34030  default:
34031  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
34032  return SCIP_INVALIDDATA;
34033  } /*lint !e788*/
34034 }
34035 
34036 /** creates a primal solution, initialized to the current LP solution
34037  *
34038  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34039  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34040  *
34041  * @pre This method can be called if SCIP is in one of the following stages:
34042  * - \ref SCIP_STAGE_SOLVING
34043  */
34045  SCIP* scip, /**< SCIP data structure */
34046  SCIP_SOL** sol, /**< pointer to store the solution */
34047  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
34048  )
34049 {
34050  SCIP_CALL( checkStage(scip, "SCIPcreateLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34051 
34052  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
34053  {
34054  SCIPerrorMessage("LP solution does not exist\n");
34055  return SCIP_INVALIDCALL;
34056  }
34057 
34058  SCIP_CALL( SCIPsolCreateLPSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
34059  scip->tree, scip->lp, heur) );
34060 
34061  return SCIP_OKAY;
34062 }
34063 
34064 /** creates a primal solution, initialized to the current NLP solution
34065  *
34066  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34067  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34068  *
34069  * @pre This method can be called if SCIP is in one of the following stages:
34070  * - \ref SCIP_STAGE_SOLVING
34071  */
34073  SCIP* scip, /**< SCIP data structure */
34074  SCIP_SOL** sol, /**< pointer to store the solution */
34075  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
34076  )
34077 {
34078  SCIP_CALL( checkStage(scip, "SCIPcreateNLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34079 
34080  if( !SCIPisNLPConstructed(scip) )
34081  {
34082  SCIPerrorMessage("NLP does not exist\n");
34083  return SCIP_INVALIDCALL;
34084  }
34085  assert(scip->nlp != NULL);
34086 
34087  if( !SCIPnlpHasSolution(scip->nlp) )
34088  {
34089  SCIPerrorMessage("NLP solution does not exist\n");
34090  return SCIP_INVALIDCALL;
34091  }
34092 
34093  SCIP_CALL( SCIPsolCreateNLPSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp,
34094  heur) );
34095 
34096  return SCIP_OKAY;
34097 }
34098 
34099 /** creates a primal solution, initialized to the current relaxation solution
34100  *
34101  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34102  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34103  *
34104  * @pre This method can be called if SCIP is in one of the following stages:
34105  * - \ref SCIP_STAGE_SOLVING
34106  */
34108  SCIP* scip, /**< SCIP data structure */
34109  SCIP_SOL** sol, /**< pointer to store the solution */
34110  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
34111  )
34112 {
34113  SCIP_CALL( checkStage(scip, "SCIPcreateRelaxSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34114 
34115  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
34116  {
34117  SCIPerrorMessage("relaxation solution is not valid\n");
34118  return SCIP_INVALIDCALL;
34119  }
34120 
34121  SCIP_CALL( SCIPsolCreateRelaxSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->relaxation, heur) );
34122 
34123  return SCIP_OKAY;
34124 }
34125 
34126 /** creates a primal solution, initialized to the current pseudo solution
34127  *
34128  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34129  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34130  *
34131  * @pre This method can be called if SCIP is in one of the following stages:
34132  * - \ref SCIP_STAGE_SOLVING
34133  */
34135  SCIP* scip, /**< SCIP data structure */
34136  SCIP_SOL** sol, /**< pointer to store the solution */
34137  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
34138  )
34139 {
34140  SCIP_CALL( checkStage(scip, "SCIPcreatePseudoSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34141 
34142  SCIP_CALL( SCIPsolCreatePseudoSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
34143  scip->tree, scip->lp, heur) );
34144 
34145  return SCIP_OKAY;
34146 }
34147 
34148 /** creates a primal solution, initialized to the current LP or pseudo solution, depending on whether the LP was solved
34149  * at the current node
34150  *
34151  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34152  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34153  *
34154  * @pre This method can be called if SCIP is in one of the following stages:
34155  * - \ref SCIP_STAGE_SOLVING
34156  */
34158  SCIP* scip, /**< SCIP data structure */
34159  SCIP_SOL** sol, /**< pointer to store the solution */
34160  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
34161  )
34162 {
34163  SCIP_CALL( checkStage(scip, "SCIPcreateCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34164 
34165  SCIP_CALL( SCIPsolCreateCurrentSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
34166  scip->tree, scip->lp, heur) );
34167 
34168  return SCIP_OKAY;
34169 }
34170 
34171 /** creates a primal solution, initialized to unknown values
34172  *
34173  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34174  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34175  *
34176  * @pre This method can be called if SCIP is in one of the following stages:
34177  * - \ref SCIP_STAGE_TRANSFORMING
34178  * - \ref SCIP_STAGE_TRANSFORMED
34179  * - \ref SCIP_STAGE_INITPRESOLVE
34180  * - \ref SCIP_STAGE_PRESOLVING
34181  * - \ref SCIP_STAGE_EXITPRESOLVE
34182  * - \ref SCIP_STAGE_PRESOLVED
34183  * - \ref SCIP_STAGE_INITSOLVE
34184  * - \ref SCIP_STAGE_SOLVING
34185  */
34187  SCIP* scip, /**< SCIP data structure */
34188  SCIP_SOL** sol, /**< pointer to store the solution */
34189  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
34190  )
34191 {
34192  SCIP_CALL( checkStage(scip, "SCIPcreateUnknownSol", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34193 
34194  SCIP_CALL( SCIPsolCreateUnknown(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, heur) );
34195 
34196  return SCIP_OKAY;
34197 }
34198 
34199 /** creates a primal solution living in the original problem space, initialized to zero;
34200  * a solution in original space allows to set original variables to values that would be invalid in the
34201  * transformed problem due to preprocessing fixings or aggregations
34202  *
34203  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34204  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34205  *
34206  * @pre This method can be called if SCIP is in one of the following stages:
34207  * - \ref SCIP_STAGE_PROBLEM
34208  * - \ref SCIP_STAGE_TRANSFORMING
34209  * - \ref SCIP_STAGE_TRANSFORMED
34210  * - \ref SCIP_STAGE_INITPRESOLVE
34211  * - \ref SCIP_STAGE_PRESOLVING
34212  * - \ref SCIP_STAGE_EXITPRESOLVE
34213  * - \ref SCIP_STAGE_PRESOLVED
34214  * - \ref SCIP_STAGE_INITSOLVE
34215  * - \ref SCIP_STAGE_SOLVING
34216  * - \ref SCIP_STAGE_SOLVED
34217  */
34219  SCIP* scip, /**< SCIP data structure */
34220  SCIP_SOL** sol, /**< pointer to store the solution */
34221  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
34222  )
34223 {
34224  SCIP_CALL( checkStage(scip, "SCIPcreateOrigSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
34225 
34226  switch( scip->set->stage )
34227  {
34228  case SCIP_STAGE_PROBLEM:
34229  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->origprimal, NULL, heur) );
34230  return SCIP_OKAY;
34231 
34235  case SCIP_STAGE_PRESOLVING:
34237  case SCIP_STAGE_PRESOLVED:
34238  case SCIP_STAGE_INITSOLVE:
34239  case SCIP_STAGE_SOLVING:
34240  case SCIP_STAGE_SOLVED:
34241  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->primal, scip->tree, heur) );
34242  return SCIP_OKAY;
34243 
34244  case SCIP_STAGE_EXITSOLVE:
34245  case SCIP_STAGE_FREETRANS:
34246  default:
34247  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
34248  return SCIP_INVALIDCALL;
34249  } /*lint !e788*/
34250 }
34251 
34252 /** creates a copy of a primal solution; note that a copy of a linked solution is also linked and needs to be unlinked
34253  * if it should stay unaffected from changes in the LP or pseudo solution
34254  *
34255  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34256  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34257  *
34258  * @pre This method can be called if SCIP is in one of the following stages:
34259  * - \ref SCIP_STAGE_PROBLEM
34260  * - \ref SCIP_STAGE_FREETRANS
34261  * - \ref SCIP_STAGE_TRANSFORMING
34262  * - \ref SCIP_STAGE_TRANSFORMED
34263  * - \ref SCIP_STAGE_INITPRESOLVE
34264  * - \ref SCIP_STAGE_PRESOLVING
34265  * - \ref SCIP_STAGE_EXITPRESOLVE
34266  * - \ref SCIP_STAGE_PRESOLVED
34267  * - \ref SCIP_STAGE_INITSOLVE
34268  * - \ref SCIP_STAGE_SOLVING
34269  * - \ref SCIP_STAGE_SOLVED
34270  */
34272  SCIP* scip, /**< SCIP data structure */
34273  SCIP_SOL** sol, /**< pointer to store the solution */
34274  SCIP_SOL* sourcesol /**< primal CIP solution to copy */
34275  )
34276 {
34277  SCIP_CALL( checkStage(scip, "SCIPcreateSolCopy", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
34278 
34279  /* check if we want to copy the current solution, which is the same as creating a current solution */
34280  if( sourcesol == NULL )
34281  {
34282  SCIP_CALL( SCIPcreateCurrentSol(scip, sol, NULL) );
34283  }
34284  else
34285  {
34286  SCIP_CALL( SCIPsolCopy(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, sourcesol) );
34287  }
34288 
34289  return SCIP_OKAY;
34290 }
34291 
34292 /** creates a copy of a solution in the original primal solution space
34293  *
34294  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34295  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34296  *
34297  * @pre This method can be called if SCIP is in one of the following stages:
34298  * - \ref SCIP_STAGE_PROBLEM
34299  * - \ref SCIP_STAGE_TRANSFORMING
34300  * - \ref SCIP_STAGE_TRANSFORMED
34301  * - \ref SCIP_STAGE_INITPRESOLVE
34302  * - \ref SCIP_STAGE_PRESOLVING
34303  * - \ref SCIP_STAGE_EXITPRESOLVE
34304  * - \ref SCIP_STAGE_PRESOLVED
34305  * - \ref SCIP_STAGE_INITSOLVE
34306  * - \ref SCIP_STAGE_SOLVING
34307  * - \ref SCIP_STAGE_SOLVED
34308  * - \ref SCIP_STAGE_EXITSOLVE
34309  * - \ref SCIP_STAGE_FREETRANS
34310  */
34312  SCIP* scip, /**< SCIP data structure */
34313  SCIP_SOL** sol, /**< pointer to store the solution */
34314  SCIP_SOL* sourcesol /**< primal CIP solution to copy */
34315  )
34316 {
34317  SCIP_CALL( checkStage(scip, "SCIPcreateSolCopyOrig", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34318 
34319  /* check if we want to copy the current solution, which is the same as creating a current solution */
34320  if( sourcesol == NULL )
34321  {
34322  SCIP_CALL( SCIPcreateCurrentSol(scip, sol, NULL) );
34323  }
34324  else
34325  {
34326  switch( scip->set->stage )
34327  {
34328  case SCIP_STAGE_PROBLEM:
34329  case SCIP_STAGE_FREETRANS:
34330  case SCIP_STAGE_SOLVED:
34334  case SCIP_STAGE_PRESOLVING:
34336  case SCIP_STAGE_PRESOLVED:
34337  case SCIP_STAGE_INITSOLVE:
34338  case SCIP_STAGE_SOLVING:
34339  SCIP_CALL( SCIPsolCopy(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal, sourcesol) );
34340  break;
34341  default:
34342  assert(FALSE);
34343  } /*lint !e788*/
34344  }
34345 
34346  return SCIP_OKAY;
34347 }
34348 
34349 /** creates a copy of a primal solution, thereby replacing infinite fixings of variables by finite values;
34350  * the copy is always defined in the original variable space;
34351  * success indicates whether the objective value of the solution was changed by removing infinite values
34352  *
34353  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34354  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34355  *
34356  * @pre This method can be called if SCIP is in one of the following stages:
34357  * - \ref SCIP_STAGE_PROBLEM
34358  * - \ref SCIP_STAGE_TRANSFORMING
34359  * - \ref SCIP_STAGE_TRANSFORMED
34360  * - \ref SCIP_STAGE_INITPRESOLVE
34361  * - \ref SCIP_STAGE_PRESOLVING
34362  * - \ref SCIP_STAGE_EXITPRESOLVE
34363  * - \ref SCIP_STAGE_PRESOLVED
34364  * - \ref SCIP_STAGE_INITSOLVE
34365  * - \ref SCIP_STAGE_SOLVING
34366  * - \ref SCIP_STAGE_SOLVED
34367  * - \ref SCIP_STAGE_EXITSOLVE
34368  */
34370  SCIP* scip, /**< SCIP data structure */
34371  SCIP_SOL** sol, /**< pointer to store the solution */
34372  SCIP_SOL* sourcesol, /**< primal CIP solution to copy */
34373  SCIP_Bool* success /**< does the finite solution have the same objective value? */
34374  )
34375 {
34376  SCIP_VAR** fixedvars;
34377  SCIP_VAR** origvars;
34378  SCIP_Real* solvals;
34379  SCIP_VAR* var;
34380  int nfixedvars;
34381  int norigvars;
34382  int v;
34383 
34384  SCIP_CALL( checkStage(scip, "SCIPcreateFiniteSolCopy", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34385 
34386  assert(scip != NULL);
34387  assert(sol != NULL);
34388  assert(sourcesol != NULL);
34389  assert(success != NULL);
34390 
34391  *success = TRUE;
34392  *sol = NULL;
34393 
34394  fixedvars = SCIPgetFixedVars(scip);
34395  nfixedvars = SCIPgetNFixedVars(scip);
34396  assert(fixedvars != NULL || nfixedvars == 0);
34397 
34398  /* get original variables and their values in the optimal solution */
34399  SCIP_CALL( SCIPgetOrigVarsData(scip, &origvars, &norigvars, NULL, NULL, NULL, NULL) );
34400  SCIP_CALL( SCIPallocBufferArray(scip, &solvals, norigvars) );
34401  SCIP_CALL( SCIPgetSolVals(scip, sourcesol, norigvars, origvars, solvals) );
34402 
34403  /* check whether there are variables fixed to an infinite value */
34404  for( v = 0; v < nfixedvars; ++v )
34405  {
34406  var = fixedvars[v]; /*lint !e613*/
34407 
34408  /* skip (multi-)aggregated variables */
34410  continue;
34411 
34412  assert(SCIPisEQ(scip, SCIPvarGetLbGlobal(var), SCIPvarGetUbGlobal(var)));
34413 
34414  if( (SCIPisInfinity(scip, SCIPvarGetLbGlobal(var)) || SCIPisInfinity(scip, -SCIPvarGetLbGlobal(var))) )
34415  {
34416  SCIPdebugMessage("var <%s> is fixed to infinite value %g\n", SCIPvarGetName(var), SCIPvarGetLbGlobal(var));
34417  break;
34418  }
34419  }
34420 
34421  /* there were variables fixed to infinite values */
34422  if( v < nfixedvars )
34423  {
34424  SCIP_HASHMAP* varmap;
34425  SCIP* subscip;
34426  SCIP_VAR* varcopy;
34427  SCIP_Real fixval;
34428  SCIP_Bool valid;
34429  SCIP_SOL* bestsol;
34430 
34431  /* if one of the variables was fixed to infinity in the original problem, we stop here */
34432  for( v = 0; v < norigvars; ++v )
34433  {
34434  var = origvars[v];
34435 
34437  {
34438  assert(SCIPisEQ(scip, SCIPvarGetLbOriginal(var), SCIPvarGetUbOriginal(var)));
34439 
34440  SCIPdebugMessage("--> var <%s> is fixed to infinite value %g in the original problem, stop making solution finite\n",
34442 
34443  goto TERMINATE;
34444  }
34445  }
34446 
34447  /* create sub-SCIP */
34448  SCIP_CALL( SCIPcreate(&subscip) );
34449 
34450  /* copy the original problem to the sub-SCIP */
34451  SCIP_CALL( SCIPhashmapCreate(&varmap, SCIPblkmem(scip), SCIPcalcHashtableSize(5 * norigvars)) );
34452  SCIP_CALL( SCIPcopyOrig(scip, subscip, varmap, NULL, "removeinffixings", TRUE, TRUE, &valid) );
34453 
34454  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", (int)SCIP_VERBLEVEL_NONE) );
34455 
34456  /* in the sub-SCIP, we try to minimize the absolute values of all variables with infinite values in the solution
34457  * and fix all other variables to the value they have in the solution
34458  */
34459  for( v = 0; v < norigvars; ++v )
34460  {
34461  varcopy = (SCIP_VAR*) SCIPhashmapGetImage(varmap, (void*)origvars[v]);
34462  assert(varcopy != NULL);
34463 
34464  fixval = solvals[v];
34465 
34466  if( SCIPisInfinity(scip, fixval) || SCIPisInfinity(scip, -fixval) )
34467  {
34468  /* If a variable with a finite finite lower bound was set to +infinity, we just change its objective to 1.0
34469  * to minimize its value; if a variable with a finite finite upper bound was set to -infinity, we just
34470  * change its objective to -1.0 to maximize its value; if a variable is free, we split the variable into
34471  * positive and negative part by creating two new non-negative variables and one constraint linking those
34472  * variables.
34473  */
34474  if( SCIPisInfinity(scip, fixval) && !SCIPisInfinity(scip, -SCIPvarGetLbLocal(varcopy)) )
34475  {
34476  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, 1.0) );
34477  }
34478  else if( SCIPisInfinity(scip, -fixval) && !SCIPisInfinity(scip, SCIPvarGetUbLocal(varcopy)) )
34479  {
34480  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, -1.0) );
34481  }
34482  else
34483  {
34484  char name[SCIP_MAXSTRLEN];
34485  SCIP_VAR* posvar;
34486  SCIP_VAR* negvar;
34487  SCIP_CONS* linkcons;
34488 
34489  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "run");
34490  SCIP_CALL( SCIPcreateVar(subscip, &posvar, name, 0.0, SCIPinfinity(scip), 1.0,
34492  SCIP_CALL( SCIPaddVar(subscip, posvar) );
34493 
34494  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "neg");
34495  SCIP_CALL( SCIPcreateVar(subscip, &negvar, name, 0.0, SCIPinfinity(scip), 1.0,
34497  SCIP_CALL( SCIPaddVar(subscip, negvar) );
34498 
34499  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "linkcons");
34500  SCIP_CALL( SCIPcreateConsBasicLinear(subscip, &linkcons, name, 0, NULL, NULL, 0.0, 0.0 ) );
34501  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, varcopy, 1.0) );
34502  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, posvar, -1.0) );
34503  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, negvar, 1.0) );
34504  SCIP_CALL( SCIPaddCons(subscip, linkcons) );
34505 
34506  SCIP_CALL( SCIPreleaseCons(subscip, &linkcons) );
34507  SCIP_CALL( SCIPreleaseVar(subscip, &posvar) );
34508  SCIP_CALL( SCIPreleaseVar(subscip, &negvar) );
34509 
34510  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, 0.0) );
34511  }
34512  }
34513  else
34514  {
34515  SCIP_Bool infeasible;
34516  SCIP_Bool fixed;
34517 
34518  if( SCIPisFeasLT(scip, solvals[v], SCIPvarGetLbLocal(varcopy)) || SCIPisFeasGT(scip, solvals[v], SCIPvarGetUbLocal(varcopy)) )
34519  {
34520  SCIP_CALL( SCIPchgVarType(subscip, varcopy, SCIP_VARTYPE_CONTINUOUS, &infeasible) );
34521  assert(!infeasible);
34522  }
34523 
34524  /* fix variable to its value in the solution */
34525  SCIP_CALL( SCIPfixVar(subscip, varcopy, fixval, &infeasible, &fixed) );
34526  assert(!infeasible);
34527  }
34528  }
34529 
34530  SCIP_CALL( SCIPsolve(subscip) );
34531 
34532  bestsol = SCIPgetBestSol(subscip);
34533 
34534  if( bestsol != NULL )
34535  {
34536  /* change the stored solution values for variables fixed to infinite values */
34537  for( v = 0; v < norigvars; ++v )
34538  {
34539  varcopy = (SCIP_VAR*) SCIPhashmapGetImage(varmap, (void*)origvars[v]);
34540  assert(varcopy != NULL);
34541 
34542  if( (SCIPisInfinity(scip, solvals[v]) || SCIPisInfinity(scip, -solvals[v])) )
34543  {
34544  solvals[v] = SCIPgetSolVal(subscip, bestsol, varcopy);
34545  }
34546  }
34547  }
34548  else
34549  {
34550  *success = FALSE;
34551  }
34552 
34553  /* free sub-SCIP */
34554  SCIP_CALL( SCIPfree(&subscip) );
34555  SCIPhashmapFree(&varmap);
34556  }
34557 
34558  /* create original solution and set the solution values */
34559  if( *success )
34560  {
34561  SCIP_CALL( SCIPcreateOrigSol(scip, sol, NULL) );
34562  for( v = 0; v < norigvars; ++v )
34563  {
34564  SCIP_CALL( SCIPsetSolVal(scip, *sol, origvars[v], solvals[v]) );
34565  }
34566  }
34567 
34568 #ifdef SCIP_DEBUG
34569  SCIPdebugMessage("created finites solution copy:\n");
34570  SCIP_CALL( SCIPprintSol(scip, *sol, NULL, FALSE) );
34571 #endif
34572 
34573  /* the solution of the sub-SCIP should have the same objective value */
34574  if( *success && !SCIPisEQ(scip, SCIPgetSolOrigObj(scip, *sol), SCIPgetSolOrigObj(scip, sourcesol)) )
34575  {
34576  /* @todo how should we avoid numerical trobles here for large objective values? */
34577  if( (SCIPgetSolOrigObj(scip, *sol) / SCIPepsilon(scip)) < 1e+15 ||
34578  REALABS(SCIPgetSolOrigObj(scip, *sol) - SCIPgetSolOrigObj(scip, sourcesol)) > 1e-12 * SCIPgetSolOrigObj(scip, *sol) )
34579  *success = FALSE;
34580  }
34581 
34582  TERMINATE:
34583  SCIPfreeBufferArray(scip, &solvals);
34584 
34585  return SCIP_OKAY;
34586 }
34587 
34588 /** frees primal CIP solution
34589  *
34590  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34591  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34592  *
34593  * @pre This method can be called if SCIP is in one of the following stages:
34594  * - \ref SCIP_STAGE_PROBLEM
34595  * - \ref SCIP_STAGE_TRANSFORMING
34596  * - \ref SCIP_STAGE_TRANSFORMED
34597  * - \ref SCIP_STAGE_INITPRESOLVE
34598  * - \ref SCIP_STAGE_PRESOLVING
34599  * - \ref SCIP_STAGE_EXITPRESOLVE
34600  * - \ref SCIP_STAGE_PRESOLVED
34601  * - \ref SCIP_STAGE_INITSOLVE
34602  * - \ref SCIP_STAGE_SOLVING
34603  * - \ref SCIP_STAGE_SOLVED
34604  * - \ref SCIP_STAGE_EXITSOLVE
34605  * - \ref SCIP_STAGE_FREETRANS
34606  */
34608  SCIP* scip, /**< SCIP data structure */
34609  SCIP_SOL** sol /**< pointer to the solution */
34610  )
34611 {
34612  SCIP_CALL( checkStage(scip, "SCIPfreeSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34613 
34614  switch( scip->set->stage )
34615  {
34616  case SCIP_STAGE_PROBLEM:
34617  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->origprimal) );
34618  break;
34619  case SCIP_STAGE_FREETRANS:
34622  case SCIP_STAGE_PRESOLVING:
34624  case SCIP_STAGE_PRESOLVED:
34625  case SCIP_STAGE_SOLVING:
34627  case SCIP_STAGE_INITSOLVE:
34628  case SCIP_STAGE_SOLVED:
34629  case SCIP_STAGE_EXITSOLVE:
34630  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->primal) );
34631  break;
34632  default:
34633  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
34634  return SCIP_INVALIDCALL;
34635  } /*lint !e788*/
34636 
34637  return SCIP_OKAY;
34638 }
34639 
34640 /** links a primal solution to the current LP solution
34641  *
34642  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34643  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34644  *
34645  * @pre This method can be called if SCIP is in one of the following stages:
34646  * - \ref SCIP_STAGE_SOLVING
34647  */
34649  SCIP* scip, /**< SCIP data structure */
34650  SCIP_SOL* sol /**< primal solution */
34651  )
34652 {
34653  SCIP_CALL( checkStage(scip, "SCIPlinkLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34654 
34655  if( !SCIPlpIsSolved(scip->lp) )
34656  {
34657  SCIPerrorMessage("LP solution does not exist\n");
34658  return SCIP_INVALIDCALL;
34659  }
34660 
34661  SCIP_CALL( SCIPsolLinkLPSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
34662 
34663  return SCIP_OKAY;
34664 }
34665 
34666 /** links a primal solution to the current NLP solution
34667  *
34668  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34669  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34670  *
34671  * @pre This method can be called if SCIP is in one of the following stages:
34672  * - \ref SCIP_STAGE_SOLVING
34673  */
34675  SCIP* scip, /**< SCIP data structure */
34676  SCIP_SOL* sol /**< primal solution */
34677  )
34678 {
34679  SCIP_CALL( checkStage(scip, "SCIPlinkNLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34680 
34681  if( scip->nlp == NULL )
34682  {
34683  SCIPerrorMessage("NLP does not exist\n");
34684  return SCIP_INVALIDCALL;
34685  }
34686 
34688  {
34689  SCIPerrorMessage("NLP solution does not exist\n");
34690  return SCIP_INVALIDCALL;
34691  }
34692 
34693  SCIP_CALL( SCIPsolLinkNLPSol(sol, scip->stat, scip->tree, scip->nlp) );
34694 
34695  return SCIP_OKAY;
34696 }
34697 
34698 /** links a primal solution to the current relaxation solution
34699  *
34700  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34701  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34702  *
34703  * @pre This method can be called if SCIP is in one of the following stages:
34704  * - \ref SCIP_STAGE_SOLVING
34705  */
34707  SCIP* scip, /**< SCIP data structure */
34708  SCIP_SOL* sol /**< primal solution */
34709  )
34710 {
34711  SCIP_CALL( checkStage(scip, "SCIPlinkRelaxSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34712 
34713  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
34714  {
34715  SCIPerrorMessage("relaxation solution is not valid\n");
34716  return SCIP_INVALIDCALL;
34717  }
34718 
34719  SCIP_CALL( SCIPsolLinkRelaxSol(sol, scip->set, scip->stat, scip->tree, scip->relaxation) );
34720 
34721  return SCIP_OKAY;
34722 }
34723 
34724 /** links a primal solution to the current pseudo solution
34725  *
34726  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34727  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34728  *
34729  * @pre This method can be called if SCIP is in one of the following stages:
34730  * - \ref SCIP_STAGE_PRESOLVING
34731  * - \ref SCIP_STAGE_SOLVING
34732  */
34734  SCIP* scip, /**< SCIP data structure */
34735  SCIP_SOL* sol /**< primal solution */
34736  )
34737 {
34738  SCIP_CALL( checkStage(scip, "SCIPlinkPseudoSol", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34739 
34740  SCIP_CALL( SCIPsolLinkPseudoSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
34741 
34742  return SCIP_OKAY;
34743 }
34744 
34745 /** links a primal solution to the current LP or pseudo solution
34746  *
34747  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34748  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34749  *
34750  * @pre This method can be called if SCIP is in one of the following stages:
34751  * - \ref SCIP_STAGE_SOLVING
34752  */
34754  SCIP* scip, /**< SCIP data structure */
34755  SCIP_SOL* sol /**< primal solution */
34756  )
34757 {
34758  SCIP_CALL( checkStage(scip, "SCIPlinkCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34759 
34760  SCIP_CALL( SCIPsolLinkCurrentSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
34761 
34762  return SCIP_OKAY;
34763 }
34764 
34765 /** clears a primal solution
34766  *
34767  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34768  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34769  *
34770  * @pre This method can be called if SCIP is in one of the following stages:
34771  * - \ref SCIP_STAGE_PROBLEM
34772  * - \ref SCIP_STAGE_TRANSFORMING
34773  * - \ref SCIP_STAGE_TRANSFORMED
34774  * - \ref SCIP_STAGE_INITPRESOLVE
34775  * - \ref SCIP_STAGE_PRESOLVING
34776  * - \ref SCIP_STAGE_EXITPRESOLVE
34777  * - \ref SCIP_STAGE_PRESOLVED
34778  * - \ref SCIP_STAGE_INITSOLVE
34779  * - \ref SCIP_STAGE_SOLVING
34780  * - \ref SCIP_STAGE_SOLVED
34781  * - \ref SCIP_STAGE_EXITSOLVE
34782  * - \ref SCIP_STAGE_FREETRANS
34783  */
34785  SCIP* scip, /**< SCIP data structure */
34786  SCIP_SOL* sol /**< primal solution */
34787  )
34788 {
34789  SCIP_CALL( checkStage(scip, "SCIPclearSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34790 
34791  SCIP_CALL( SCIPsolClear(sol, scip->stat, scip->tree) );
34792 
34793  return SCIP_OKAY;
34794 }
34795 
34796 /** stores solution values of variables in solution's own array
34797  *
34798  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34799  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34800  *
34801  * @pre This method can be called if SCIP is in one of the following stages:
34802  * - \ref SCIP_STAGE_TRANSFORMING
34803  * - \ref SCIP_STAGE_TRANSFORMED
34804  * - \ref SCIP_STAGE_PRESOLVING
34805  * - \ref SCIP_STAGE_PRESOLVED
34806  * - \ref SCIP_STAGE_INITSOLVE
34807  * - \ref SCIP_STAGE_SOLVING
34808  * - \ref SCIP_STAGE_SOLVED
34809  * - \ref SCIP_STAGE_EXITSOLVE
34810  * - \ref SCIP_STAGE_FREETRANS
34811  */
34813  SCIP* scip, /**< SCIP data structure */
34814  SCIP_SOL* sol /**< primal solution */
34815  )
34816 {
34817  SCIP_CALL( checkStage(scip, "SCIPunlinkSol", FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34818 
34819  SCIP_CALL( SCIPsolUnlink(sol, scip->set, scip->transprob) );
34820 
34821  return SCIP_OKAY;
34822 }
34823 
34824 /** sets value of variable in primal CIP solution
34825  *
34826  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34827  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34828  *
34829  * @pre This method can be called if SCIP is in one of the following stages:
34830  * - \ref SCIP_STAGE_PROBLEM
34831  * - \ref SCIP_STAGE_TRANSFORMING
34832  * - \ref SCIP_STAGE_TRANSFORMED
34833  * - \ref SCIP_STAGE_INITPRESOLVE
34834  * - \ref SCIP_STAGE_PRESOLVING
34835  * - \ref SCIP_STAGE_EXITPRESOLVE
34836  * - \ref SCIP_STAGE_PRESOLVED
34837  * - \ref SCIP_STAGE_INITSOLVE
34838  * - \ref SCIP_STAGE_SOLVING
34839  * - \ref SCIP_STAGE_SOLVED
34840  * - \ref SCIP_STAGE_EXITSOLVE
34841  * - \ref SCIP_STAGE_FREETRANS
34842  */
34844  SCIP* scip, /**< SCIP data structure */
34845  SCIP_SOL* sol, /**< primal solution */
34846  SCIP_VAR* var, /**< variable to add to solution */
34847  SCIP_Real val /**< solution value of variable */
34848  )
34849 {
34850  SCIP_CALL( checkStage(scip, "SCIPsetSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34851 
34852  assert( var->scip == scip );
34853 
34854  if( SCIPsolIsOriginal(sol) && SCIPvarIsTransformed(var) )
34855  {
34856  SCIPerrorMessage("cannot set value of transformed variable <%s> in original space solution\n",
34857  SCIPvarGetName(var));
34858  return SCIP_INVALIDCALL;
34859  }
34860 
34861  SCIP_CALL( SCIPsolSetVal(sol, scip->set, scip->stat, scip->tree, var, val) );
34862 
34863  return SCIP_OKAY;
34864 }
34865 
34866 /** sets values of multiple variables in primal CIP solution
34867  *
34868  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34869  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34870  *
34871  * @pre This method can be called if SCIP is in one of the following stages:
34872  * - \ref SCIP_STAGE_PROBLEM
34873  * - \ref SCIP_STAGE_TRANSFORMING
34874  * - \ref SCIP_STAGE_TRANSFORMED
34875  * - \ref SCIP_STAGE_INITPRESOLVE
34876  * - \ref SCIP_STAGE_PRESOLVING
34877  * - \ref SCIP_STAGE_EXITPRESOLVE
34878  * - \ref SCIP_STAGE_PRESOLVED
34879  * - \ref SCIP_STAGE_INITSOLVE
34880  * - \ref SCIP_STAGE_SOLVING
34881  * - \ref SCIP_STAGE_SOLVED
34882  * - \ref SCIP_STAGE_EXITSOLVE
34883  * - \ref SCIP_STAGE_FREETRANS
34884  */
34886  SCIP* scip, /**< SCIP data structure */
34887  SCIP_SOL* sol, /**< primal solution */
34888  int nvars, /**< number of variables to set solution value for */
34889  SCIP_VAR** vars, /**< array with variables to add to solution */
34890  SCIP_Real* vals /**< array with solution values of variables */
34891  )
34892 {
34893  int v;
34894 
34895  assert(nvars == 0 || vars != NULL);
34896  assert(nvars == 0 || vals != NULL);
34897 
34898  SCIP_CALL( checkStage(scip, "SCIPsetSolVals", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34899 
34900  if( SCIPsolIsOriginal(sol) )
34901  {
34902  for( v = 0; v < nvars; ++v )
34903  {
34904  if( SCIPvarIsTransformed(vars[v]) )
34905  {
34906  SCIPerrorMessage("cannot set value of transformed variable <%s> in original space solution\n",
34907  SCIPvarGetName(vars[v]));
34908  return SCIP_INVALIDCALL;
34909  }
34910  }
34911  }
34912 
34913  for( v = 0; v < nvars; ++v )
34914  {
34915  SCIP_CALL( SCIPsolSetVal(sol, scip->set, scip->stat, scip->tree, vars[v], vals[v]) );
34916  }
34917 
34918  return SCIP_OKAY;
34919 }
34920 
34921 /** increases value of variable in primal CIP solution
34922  *
34923  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34924  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34925  *
34926  * @pre This method can be called if SCIP is in one of the following stages:
34927  * - \ref SCIP_STAGE_PROBLEM
34928  * - \ref SCIP_STAGE_TRANSFORMING
34929  * - \ref SCIP_STAGE_TRANSFORMED
34930  * - \ref SCIP_STAGE_INITPRESOLVE
34931  * - \ref SCIP_STAGE_PRESOLVING
34932  * - \ref SCIP_STAGE_EXITPRESOLVE
34933  * - \ref SCIP_STAGE_PRESOLVED
34934  * - \ref SCIP_STAGE_INITSOLVE
34935  * - \ref SCIP_STAGE_SOLVING
34936  * - \ref SCIP_STAGE_SOLVED
34937  * - \ref SCIP_STAGE_EXITSOLVE
34938  * - \ref SCIP_STAGE_FREETRANS
34939  */
34941  SCIP* scip, /**< SCIP data structure */
34942  SCIP_SOL* sol, /**< primal solution */
34943  SCIP_VAR* var, /**< variable to increase solution value for */
34944  SCIP_Real incval /**< increment for solution value of variable */
34945  )
34946 {
34947  SCIP_CALL( checkStage(scip, "SCIPincSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34948 
34949  assert( var->scip == scip );
34950 
34951  if( SCIPsolIsOriginal(sol) && SCIPvarIsTransformed(var) )
34952  {
34953  SCIPerrorMessage("cannot increase value of transformed variable <%s> in original space solution\n",
34954  SCIPvarGetName(var));
34955  return SCIP_INVALIDCALL;
34956  }
34957 
34958  SCIP_CALL( SCIPsolIncVal(sol, scip->set, scip->stat, scip->tree, var, incval) );
34959 
34960  return SCIP_OKAY;
34961 }
34962 
34963 /** returns value of variable in primal CIP solution, or in current LP/pseudo solution
34964  *
34965  * @return value of variable in primal CIP solution, or in current LP/pseudo solution
34966  *
34967  * @pre In case the solution pointer @p sol is @b NULL, that means it is asked for the LP or pseudo solution, this method
34968  * can only be called if @p scip is in the solving stage \ref SCIP_STAGE_SOLVING. In any other case, this method
34969  * can be called if @p scip is in one of the following stages:
34970  * - \ref SCIP_STAGE_PROBLEM
34971  * - \ref SCIP_STAGE_TRANSFORMING
34972  * - \ref SCIP_STAGE_TRANSFORMED
34973  * - \ref SCIP_STAGE_INITPRESOLVE
34974  * - \ref SCIP_STAGE_PRESOLVING
34975  * - \ref SCIP_STAGE_EXITPRESOLVE
34976  * - \ref SCIP_STAGE_PRESOLVED
34977  * - \ref SCIP_STAGE_INITSOLVE
34978  * - \ref SCIP_STAGE_SOLVING
34979  * - \ref SCIP_STAGE_SOLVED
34980  * - \ref SCIP_STAGE_EXITSOLVE
34981  * - \ref SCIP_STAGE_FREETRANS
34982  */
34984  SCIP* scip, /**< SCIP data structure */
34985  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
34986  SCIP_VAR* var /**< variable to get value for */
34987  )
34988 {
34989  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34990 
34991  assert( var->scip == scip );
34992 
34993  if( sol != NULL )
34994  return SCIPsolGetVal(sol, scip->set, scip->stat, var);
34995 
34996  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolVal(sol==NULL)", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34997 
34998  return SCIPvarGetSol(var, SCIPtreeHasCurrentNodeLP(scip->tree));
34999 }
35000 
35001 /** gets values of multiple variables in primal CIP solution
35002  *
35003  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35004  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35005  *
35006  * @pre This method can be called if SCIP is in one of the following stages:
35007  * - \ref SCIP_STAGE_PROBLEM
35008  * - \ref SCIP_STAGE_TRANSFORMING
35009  * - \ref SCIP_STAGE_TRANSFORMED
35010  * - \ref SCIP_STAGE_INITPRESOLVE
35011  * - \ref SCIP_STAGE_PRESOLVING
35012  * - \ref SCIP_STAGE_EXITPRESOLVE
35013  * - \ref SCIP_STAGE_PRESOLVED
35014  * - \ref SCIP_STAGE_INITSOLVE
35015  * - \ref SCIP_STAGE_SOLVING
35016  * - \ref SCIP_STAGE_SOLVED
35017  * - \ref SCIP_STAGE_EXITSOLVE
35018  * - \ref SCIP_STAGE_FREETRANS
35019  */
35021  SCIP* scip, /**< SCIP data structure */
35022  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
35023  int nvars, /**< number of variables to get solution value for */
35024  SCIP_VAR** vars, /**< array with variables to get value for */
35025  SCIP_Real* vals /**< array to store solution values of variables */
35026  )
35027 {
35028  assert(nvars == 0 || vars != NULL);
35029  assert(nvars == 0 || vals != NULL);
35030 
35031  SCIP_CALL( checkStage(scip, "SCIPgetSolVals", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35032 
35033  if( sol != NULL )
35034  {
35035  int v;
35036 
35037  for( v = 0; v < nvars; ++v )
35038  vals[v] = SCIPsolGetVal(sol, scip->set, scip->stat, vars[v]);
35039  }
35040  else
35041  {
35042  SCIP_CALL( SCIPgetVarSols(scip, nvars, vars, vals) );
35043  }
35044 
35045  return SCIP_OKAY;
35046 }
35047 
35048 /** returns objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value
35049  *
35050  * @return objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value
35051  *
35052  * @pre This method can be called if SCIP is in one of the following stages:
35053  * - \ref SCIP_STAGE_PROBLEM
35054  * - \ref SCIP_STAGE_TRANSFORMING
35055  * - \ref SCIP_STAGE_TRANSFORMED
35056  * - \ref SCIP_STAGE_INITPRESOLVE
35057  * - \ref SCIP_STAGE_PRESOLVING
35058  * - \ref SCIP_STAGE_EXITPRESOLVE
35059  * - \ref SCIP_STAGE_PRESOLVED
35060  * - \ref SCIP_STAGE_INITSOLVE
35061  * - \ref SCIP_STAGE_SOLVING
35062  * - \ref SCIP_STAGE_SOLVED
35063  * - \ref SCIP_STAGE_EXITSOLVE
35064  * - \ref SCIP_STAGE_FREETRANS
35065  */
35067  SCIP* scip, /**< SCIP data structure */
35068  SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */
35069  )
35070 {
35071  /* for original solutions, an original objective value is already available in SCIP_STAGE_PROBLEM
35072  * for all other solutions, we should be at least in SCIP_STAGE_TRANSFORMING
35073  */
35074  if( sol != NULL && SCIPsolIsOriginal(sol) )
35075  {
35076  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35077 
35078  return SCIPsolGetOrigObj(sol);
35079  }
35080 
35081  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35082 
35083  if( sol != NULL )
35084  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
35085  else
35086  {
35087  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj(sol==NULL)",
35089  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
35090  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPlpGetObjval(scip->lp, scip->set, scip->transprob));
35091  else
35092  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob));
35093  }
35094 }
35095 
35096 /** returns transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value
35097  *
35098  * @return transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value
35099  *
35100  * @pre This method can be called if SCIP is in one of the following stages:
35101  * - \ref SCIP_STAGE_TRANSFORMING
35102  * - \ref SCIP_STAGE_TRANSFORMED
35103  * - \ref SCIP_STAGE_INITPRESOLVE
35104  * - \ref SCIP_STAGE_PRESOLVING
35105  * - \ref SCIP_STAGE_EXITPRESOLVE
35106  * - \ref SCIP_STAGE_PRESOLVED
35107  * - \ref SCIP_STAGE_INITSOLVE
35108  * - \ref SCIP_STAGE_SOLVING
35109  * - \ref SCIP_STAGE_SOLVED
35110  * - \ref SCIP_STAGE_EXITSOLVE
35111  * - \ref SCIP_STAGE_FREETRANS
35112  */
35114  SCIP* scip, /**< SCIP data structure */
35115  SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */
35116  )
35117 {
35118  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTransObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35119 
35120  if( sol != NULL )
35121  return SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob);
35122  else
35123  {
35124  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTransObj(sol==NULL)",
35126  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
35127  return SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
35128  else
35129  return SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob);
35130  }
35131 }
35132 
35133 /** recomputes the objective value of an original solution, e.g., when transferring solutions
35134  * from the solution pool (objective coefficients might have changed in the meantime)
35135  *
35136  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35137  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35138  *
35139  * @pre This method can be called if SCIP is in one of the following stages:
35140  * - \ref SCIP_STAGE_PRESOLVING
35141  * - \ref SCIP_STAGE_SOLVING
35142  *
35143  */
35145  SCIP* scip,
35146  SCIP_SOL* sol
35147  )
35148 {
35149  assert(scip != NULL);
35150 
35151  SCIP_CALL( checkStage(scip, "SCIPrecomputeSolObj", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35152 
35153  SCIPsolRecomputeObj(sol, scip->set, scip->stat, scip->origprob);
35154 
35155  return SCIP_OKAY;
35156 }
35157 
35158 /** maps original space objective value into transformed objective value
35159  *
35160  * @return transformed objective value
35161  *
35162  * @pre This method can be called if SCIP is in one of the following stages:
35163  * - \ref SCIP_STAGE_TRANSFORMING
35164  * - \ref SCIP_STAGE_TRANSFORMED
35165  * - \ref SCIP_STAGE_INITPRESOLVE
35166  * - \ref SCIP_STAGE_PRESOLVING
35167  * - \ref SCIP_STAGE_EXITPRESOLVE
35168  * - \ref SCIP_STAGE_PRESOLVED
35169  * - \ref SCIP_STAGE_INITSOLVE
35170  * - \ref SCIP_STAGE_SOLVING
35171  * - \ref SCIP_STAGE_SOLVED
35172  */
35174  SCIP* scip, /**< SCIP data structure */
35175  SCIP_Real obj /**< original space objective value to transform */
35176  )
35177 {
35178  SCIP_CALL_ABORT( checkStage(scip, "SCIPtransformObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
35179 
35180  return SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, obj);
35181 }
35182 
35183 /** maps transformed objective value into original space
35184  *
35185  * @return objective value into original space
35186  *
35187  * @pre This method can be called if SCIP is in one of the following stages:
35188  * - \ref SCIP_STAGE_TRANSFORMING
35189  * - \ref SCIP_STAGE_TRANSFORMED
35190  * - \ref SCIP_STAGE_INITPRESOLVE
35191  * - \ref SCIP_STAGE_PRESOLVING
35192  * - \ref SCIP_STAGE_EXITPRESOLVE
35193  * - \ref SCIP_STAGE_PRESOLVED
35194  * - \ref SCIP_STAGE_INITSOLVE
35195  * - \ref SCIP_STAGE_SOLVING
35196  * - \ref SCIP_STAGE_SOLVED
35197  */
35199  SCIP* scip, /**< SCIP data structure */
35200  SCIP_Real obj /**< transformed objective value to retransform in original space */
35201  )
35202 {
35203  SCIP_CALL_ABORT( checkStage(scip, "SCIPretransformObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
35204 
35205  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, obj);
35206 }
35207 
35208 /** gets clock time, when this solution was found
35209  *
35210  * @return clock time, when this solution was found
35211  *
35212  * @pre This method can be called if SCIP is in one of the following stages:
35213  * - \ref SCIP_STAGE_TRANSFORMING
35214  * - \ref SCIP_STAGE_TRANSFORMED
35215  * - \ref SCIP_STAGE_INITPRESOLVE
35216  * - \ref SCIP_STAGE_PRESOLVING
35217  * - \ref SCIP_STAGE_EXITPRESOLVE
35218  * - \ref SCIP_STAGE_PRESOLVED
35219  * - \ref SCIP_STAGE_INITSOLVE
35220  * - \ref SCIP_STAGE_SOLVING
35221  * - \ref SCIP_STAGE_SOLVED
35222  * - \ref SCIP_STAGE_EXITSOLVE
35223  * - \ref SCIP_STAGE_FREETRANS
35224  */
35226  SCIP* scip, /**< SCIP data structure */
35227  SCIP_SOL* sol /**< primal solution */
35228  )
35229 {
35230  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTime", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35231 
35232  return SCIPsolGetTime(sol);
35233 }
35234 
35235 /** gets branch and bound run number, where this solution was found
35236  *
35237  * @return branch and bound run number, where this solution was found
35238  *
35239  * @pre This method can be called if SCIP is in one of the following stages:
35240  * - \ref SCIP_STAGE_TRANSFORMING
35241  * - \ref SCIP_STAGE_TRANSFORMED
35242  * - \ref SCIP_STAGE_INITPRESOLVE
35243  * - \ref SCIP_STAGE_PRESOLVING
35244  * - \ref SCIP_STAGE_EXITPRESOLVE
35245  * - \ref SCIP_STAGE_PRESOLVED
35246  * - \ref SCIP_STAGE_INITSOLVE
35247  * - \ref SCIP_STAGE_SOLVING
35248  * - \ref SCIP_STAGE_SOLVED
35249  * - \ref SCIP_STAGE_EXITSOLVE
35250  * - \ref SCIP_STAGE_FREETRANS
35251  */
35253  SCIP* scip, /**< SCIP data structure */
35254  SCIP_SOL* sol /**< primal solution */
35255  )
35256 {
35257  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolRunnum", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35258 
35259  return SCIPsolGetRunnum(sol);
35260 }
35261 
35262 /** gets node number of the specific branch and bound run, where this solution was found
35263  *
35264  * @return node number of the specific branch and bound run, where this solution was found
35265  *
35266  * @pre This method can be called if SCIP is in one of the following stages:
35267  * - \ref SCIP_STAGE_TRANSFORMING
35268  * - \ref SCIP_STAGE_TRANSFORMED
35269  * - \ref SCIP_STAGE_INITPRESOLVE
35270  * - \ref SCIP_STAGE_PRESOLVING
35271  * - \ref SCIP_STAGE_EXITPRESOLVE
35272  * - \ref SCIP_STAGE_PRESOLVED
35273  * - \ref SCIP_STAGE_INITSOLVE
35274  * - \ref SCIP_STAGE_SOLVING
35275  * - \ref SCIP_STAGE_SOLVED
35276  * - \ref SCIP_STAGE_EXITSOLVE
35277  * - \ref SCIP_STAGE_FREETRANS
35278  */
35280  SCIP* scip, /**< SCIP data structure */
35281  SCIP_SOL* sol /**< primal solution */
35282  )
35283 {
35284  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolNodenum", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35285 
35286  return SCIPsolGetNodenum(sol);
35287 }
35288 
35289 /** gets heuristic, that found this solution (or NULL if it's from the tree)
35290  *
35291  * @return heuristic, that found this solution (or NULL if it's from the tree)
35292  *
35293  * @pre This method can be called if SCIP is in one of the following stages:
35294  * - \ref SCIP_STAGE_TRANSFORMING
35295  * - \ref SCIP_STAGE_TRANSFORMED
35296  * - \ref SCIP_STAGE_INITPRESOLVE
35297  * - \ref SCIP_STAGE_PRESOLVING
35298  * - \ref SCIP_STAGE_EXITPRESOLVE
35299  * - \ref SCIP_STAGE_PRESOLVED
35300  * - \ref SCIP_STAGE_INITSOLVE
35301  * - \ref SCIP_STAGE_SOLVING
35302  * - \ref SCIP_STAGE_SOLVED
35303  * - \ref SCIP_STAGE_EXITSOLVE
35304  * - \ref SCIP_STAGE_FREETRANS
35305  */
35307  SCIP* scip, /**< SCIP data structure */
35308  SCIP_SOL* sol /**< primal solution */
35309  )
35310 {
35311  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolHeur", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35312 
35313  return SCIPsolGetHeur(sol);
35314 }
35315 
35316 /** returns whether two given solutions are exactly equal
35317  *
35318  * @return returns whether two given solutions are exactly equal
35319  *
35320  * @pre This method can be called if SCIP is in one of the following stages:
35321  * - \ref SCIP_STAGE_PROBLEM
35322  * - \ref SCIP_STAGE_TRANSFORMING
35323  * - \ref SCIP_STAGE_TRANSFORMED
35324  * - \ref SCIP_STAGE_INITPRESOLVE
35325  * - \ref SCIP_STAGE_PRESOLVING
35326  * - \ref SCIP_STAGE_EXITPRESOLVE
35327  * - \ref SCIP_STAGE_PRESOLVED
35328  * - \ref SCIP_STAGE_INITSOLVE
35329  * - \ref SCIP_STAGE_SOLVING
35330  * - \ref SCIP_STAGE_SOLVED
35331  * - \ref SCIP_STAGE_EXITSOLVE
35332  * - \ref SCIP_STAGE_FREETRANS
35333  */
35335  SCIP* scip, /**< SCIP data structure */
35336  SCIP_SOL* sol1, /**< first primal CIP solution */
35337  SCIP_SOL* sol2 /**< second primal CIP solution */
35338  )
35339 {
35340  SCIP_CALL_ABORT( checkStage(scip, "SCIPareSolsEqual", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35341 
35342  return SCIPsolsAreEqual(sol1, sol2, scip->set, scip->stat, scip->origprob, scip->transprob);
35343 }
35344 
35345 /** adjusts solution values of implicit integer variables in handed solution. Solution objective value is not
35346  * deteriorated by this method.
35347  *
35348  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35349  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35350  *
35351  * @pre This method can be called if SCIP is in one of the following stages:
35352  * - \ref SCIP_STAGE_SOLVING
35353  */
35355  SCIP* scip, /**< SCIP data structure */
35356  SCIP_SOL* sol, /**< primal CIP solution */
35357  SCIP_Bool uselprows /**< should LP row information be considered for none-objective variables */
35358  )
35359 {
35360  assert(scip != NULL);
35361  SCIP_CALL( checkStage(scip, "SCIPadjustImplicitSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35362 
35363  assert(sol != NULL);
35364  SCIP_CALL( SCIPsolAdjustImplicitSolVals(sol, scip->set, scip->stat, scip->transprob, scip->tree, uselprows) );
35365 
35366  return SCIP_OKAY;
35367 }
35368 
35369 /** outputs non-zero variables of solution in original problem space to the given file stream
35370  *
35371  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35372  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35373  *
35374  * @pre In case the solution pointer @p sol is NULL (asking for the current LP/pseudo solution), this method can be
35375  * called if @p scip is in one of the following stages:
35376  * - \ref SCIP_STAGE_PRESOLVING
35377  * - \ref SCIP_STAGE_EXITPRESOLVE
35378  * - \ref SCIP_STAGE_PRESOLVED
35379  * - \ref SCIP_STAGE_INITSOLVE
35380  * - \ref SCIP_STAGE_SOLVING
35381  * - \ref SCIP_STAGE_SOLVED
35382  * - \ref SCIP_STAGE_EXITSOLVE
35383  *
35384  * @pre In case the solution pointer @p sol is @b not NULL, this method can be called if @p scip is in one of the
35385  * following stages:
35386  * - \ref SCIP_STAGE_PROBLEM
35387  * - \ref SCIP_STAGE_TRANSFORMED
35388  * - \ref SCIP_STAGE_INITPRESOLVE
35389  * - \ref SCIP_STAGE_PRESOLVING
35390  * - \ref SCIP_STAGE_EXITPRESOLVE
35391  * - \ref SCIP_STAGE_PRESOLVED
35392  * - \ref SCIP_STAGE_INITSOLVE
35393  * - \ref SCIP_STAGE_SOLVING
35394  * - \ref SCIP_STAGE_SOLVED
35395  * - \ref SCIP_STAGE_EXITSOLVE
35396  */
35398  SCIP* scip, /**< SCIP data structure */
35399  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
35400  FILE* file, /**< output file (or NULL for standard output) */
35401  SCIP_Bool printzeros /**< should variables set to zero be printed? */
35402  )
35403 {
35404  SCIP_Real objvalue;
35405  SCIP_Bool currentsol;
35406 
35407  assert(SCIPisTransformed(scip) || sol != NULL);
35408 
35409  SCIP_CALL( checkStage(scip, "SCIPprintSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35410 
35411  currentsol = (sol == NULL);
35412  if( currentsol )
35413  {
35414  SCIP_CALL( checkStage(scip, "SCIPprintSol(sol==NULL)",
35416 
35417  /* create a temporary solution that is linked to the current solution */
35418  SCIP_CALL( SCIPsolCreateCurrentSol(&sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
35419  scip->tree, scip->lp, NULL) );
35420  }
35421 
35422  SCIPmessageFPrintInfo(scip->messagehdlr, file, "objective value: ");
35423  if( SCIPsolIsOriginal(sol) )
35424  objvalue = SCIPsolGetOrigObj(sol);
35425  else
35426  objvalue = SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
35427 
35428  SCIPprintReal(scip, file, objvalue, 20, 15);
35429  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
35430 
35431  SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob, file, printzeros) );
35432 
35433  if( currentsol )
35434  {
35435  /* free temporary solution */
35436  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->primal) );
35437  }
35438 
35439  return SCIP_OKAY;
35440 }
35441 
35442 /** outputs non-zero variables of solution in transformed problem space to file stream
35443  *
35444  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35445  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35446  *
35447  * @pre This method can be called if SCIP is in one of the following stages:
35448  * - \ref SCIP_STAGE_TRANSFORMED
35449  * - \ref SCIP_STAGE_INITPRESOLVE
35450  * - \ref SCIP_STAGE_PRESOLVING
35451  * - \ref SCIP_STAGE_EXITPRESOLVE
35452  * - \ref SCIP_STAGE_PRESOLVED
35453  * - \ref SCIP_STAGE_INITSOLVE
35454  * - \ref SCIP_STAGE_SOLVING
35455  * - \ref SCIP_STAGE_SOLVED
35456  * - \ref SCIP_STAGE_EXITSOLVE
35457  */
35459  SCIP* scip, /**< SCIP data structure */
35460  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
35461  FILE* file, /**< output file (or NULL for standard output) */
35462  SCIP_Bool printzeros /**< should variables set to zero be printed? */
35463  )
35464 {
35465  SCIP_Bool currentsol;
35466 
35467  SCIP_CALL( checkStage(scip, "SCIPprintTransSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35468 
35469  currentsol = (sol == NULL);
35470  if( currentsol )
35471  {
35472  /* create a temporary solution that is linked to the current solution */
35473  SCIP_CALL( SCIPsolCreateCurrentSol(&sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
35474  scip->tree, scip->lp, NULL) );
35475  }
35476 
35477  if( SCIPsolIsOriginal(sol) )
35478  {
35479  SCIPerrorMessage("cannot print original space solution as transformed solution\n");
35480  return SCIP_INVALIDCALL;
35481  }
35482 
35483  SCIPmessageFPrintInfo(scip->messagehdlr, file, "objective value: ");
35484  SCIPprintReal(scip, file, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob), 20, 9);
35485  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
35486 
35487  SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->transprob, NULL, file, printzeros) );
35488 
35489  if( currentsol )
35490  {
35491  /* free temporary solution */
35492  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->primal) );
35493  }
35494 
35495  return SCIP_OKAY;
35496 }
35497 
35498 
35499 /** outputs dual solution from LP solver to file stream */
35500 static
35502  SCIP* scip, /**< SCIP data structure */
35503  FILE* file, /**< output file (or NULL for standard output) */
35504  SCIP_Bool printzeros /**< should variables set to zero be printed? */
35505  )
35506 {
35507  int c;
35508 
35509  assert(scip->lp != NULL);
35510  assert(scip->lp->solved);
35511  assert(scip->lp->dualfeasible);
35512 
35513  /* print dual solution values of all constraints */
35514  for( c = 0; c < scip->transprob->nconss; ++c )
35515  {
35516  SCIP_CONS* cons;
35517  SCIP_Real solval;
35518 #ifndef NDEBUG
35519  SCIP_CONSHDLR* conshdlr;
35520 #endif
35521  cons = scip->transprob->conss[c];
35522  assert(cons != NULL);
35523 
35524 #ifndef NDEBUG
35525  conshdlr = SCIPconsGetHdlr(cons);
35526  assert(conshdlr != NULL);
35527  assert(strcmp(SCIPconshdlrGetName(conshdlr), "linear" ) == 0);
35528 #endif
35529 
35530  solval = SCIPgetDualsolLinear(scip, cons);
35531  assert(solval != SCIP_INVALID); /*lint !e777*/
35532 
35533  if( printzeros || !SCIPisZero(scip, solval) )
35534  {
35535  SCIP_MESSAGEHDLR* messagehdlr = scip->messagehdlr;
35536 
35537  SCIPmessageFPrintInfo(messagehdlr, file, "%-32s", SCIPconsGetName(cons));
35538 
35539  if( SCIPisInfinity(scip, solval) )
35540  SCIPmessageFPrintInfo(messagehdlr, file, " +infinity\n");
35541  else if( SCIPisInfinity(scip, -solval) )
35542  SCIPmessageFPrintInfo(messagehdlr, file, " -infinity\n");
35543  else
35544  SCIPmessageFPrintInfo(messagehdlr, file, " % 20.15g\n", solval);
35545  }
35546  }
35547 
35548  return SCIP_OKAY;
35549 }
35550 
35551 /** outputs dual solution from LP solver to file stream
35552  *
35553  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35554  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35555  *
35556  * @pre This method can be called in all stages but only prints dual information when called in \ref SCIP_STAGE_SOLVED
35557  */
35559  SCIP* scip, /**< SCIP data structure */
35560  FILE* file, /**< output file (or NULL for standard output) */
35561  SCIP_Bool printzeros /**< should variables set to zero be printed? */
35562  )
35563 {
35564  int c;
35565 
35566  assert(scip != NULL);
35567 
35568  SCIP_CALL( checkStage(scip, "SCIPprintDualSol", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
35569 
35570  if( SCIPgetStage(scip) != SCIP_STAGE_SOLVED )
35571  {
35572  SCIPmessageFPrintInfo(scip->messagehdlr, NULL, "No dual solution available.\n");
35573  return SCIP_OKAY;
35574  }
35575 
35576  assert(scip->stat != NULL);
35577  assert(scip->transprob != NULL);
35578 
35579  /* dual solution only useful when no presolving was performed */
35580  if( scip->stat->performpresol )
35581  {
35582  SCIPwarningMessage(scip, "No dual information available when presolving was performed.\n");
35583  return SCIP_OKAY;
35584  }
35585 
35586  /* dual solution is created by LP solver and therefore only available for pure LPs */
35587  if( scip->transprob->nvars != scip->transprob->ncontvars )
35588  {
35589  SCIPwarningMessage(scip, "Dual information only available for pure LPs (only continuous variables).\n");
35590  return SCIP_OKAY;
35591  }
35592 
35593  /* dual solution is created by LP solver and therefore only available for linear constraints */
35594  for( c = scip->transprob->nconss - 1; c >= 0; --c )
35595  {
35596  SCIP_CONSHDLR* conshdlr;
35597 
35598  conshdlr = SCIPconsGetHdlr(scip->transprob->conss[c]);
35599  assert(conshdlr != NULL);
35600 
35601  if( strcmp(SCIPconshdlrGetName(conshdlr), "linear" ) != 0 )
35602  {
35603  SCIPwarningMessage(scip, "Dual information only available for pure LPs (only linear constraints).\n");
35604  return SCIP_OKAY;
35605  }
35606  }
35607 
35608  /* print dual solution */
35609  SCIP_CALL( printDualSol(scip, file, printzeros) );
35610 
35611  return SCIP_OKAY;
35612 }
35613 
35614 
35615 /** outputs non-zero variables of solution representing a ray in original problem space to file stream
35616  *
35617  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35618  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35619  *
35620  * @pre This method can be called if SCIP is in one of the following stages:
35621  * - \ref SCIP_STAGE_PROBLEM
35622  * - \ref SCIP_STAGE_TRANSFORMED
35623  * - \ref SCIP_STAGE_INITPRESOLVE
35624  * - \ref SCIP_STAGE_PRESOLVING
35625  * - \ref SCIP_STAGE_EXITPRESOLVE
35626  * - \ref SCIP_STAGE_PRESOLVED
35627  * - \ref SCIP_STAGE_INITSOLVE
35628  * - \ref SCIP_STAGE_SOLVING
35629  * - \ref SCIP_STAGE_SOLVED
35630  * - \ref SCIP_STAGE_EXITSOLVE
35631  */
35633  SCIP* scip, /**< SCIP data structure */
35634  SCIP_SOL* sol, /**< primal solution representing ray */
35635  FILE* file, /**< output file (or NULL for standard output) */
35636  SCIP_Bool printzeros /**< should variables set to zero be printed? */
35637  )
35638 {
35639  assert(scip != NULL);
35640  assert(sol != NULL);
35641 
35642  SCIP_CALL( checkStage(scip, "SCIPprintRay", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35643 
35644  SCIP_CALL( SCIPsolPrintRay(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob, file, printzeros) );
35645 
35646  return SCIP_OKAY;
35647 }
35648 
35649 /** gets number of feasible primal solutions stored in the solution storage in case the problem is transformed;
35650  * in case the problem stage is SCIP_STAGE_PROBLEM, the number of solution in the original solution candidate
35651  * storage is returned
35652  *
35653  * @return number of feasible primal solutions stored in the solution storage in case the problem is transformed; or
35654  * number of solution in the original solution candidate storage if the problem stage is SCIP_STAGE_PROBLEM
35655  *
35656  * @pre This method can be called if SCIP is in one of the following stages:
35657  * - \ref SCIP_STAGE_PROBLEM
35658  * - \ref SCIP_STAGE_TRANSFORMED
35659  * - \ref SCIP_STAGE_INITPRESOLVE
35660  * - \ref SCIP_STAGE_PRESOLVING
35661  * - \ref SCIP_STAGE_EXITPRESOLVE
35662  * - \ref SCIP_STAGE_PRESOLVED
35663  * - \ref SCIP_STAGE_INITSOLVE
35664  * - \ref SCIP_STAGE_SOLVING
35665  * - \ref SCIP_STAGE_SOLVED
35666  * - \ref SCIP_STAGE_EXITSOLVE
35667  */
35669  SCIP* scip /**< SCIP data structure */
35670  )
35671 {
35672  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSols", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35673 
35674  switch( scip->set->stage )
35675  {
35676  case SCIP_STAGE_PROBLEM:
35677  return scip->origprimal->nsols;
35678 
35681  case SCIP_STAGE_PRESOLVING:
35683  case SCIP_STAGE_PRESOLVED:
35684  case SCIP_STAGE_INITSOLVE:
35685  case SCIP_STAGE_SOLVING:
35686  case SCIP_STAGE_SOLVED:
35687  case SCIP_STAGE_EXITSOLVE:
35688  return scip->primal->nsols;
35689 
35690  case SCIP_STAGE_INIT:
35692  case SCIP_STAGE_FREETRANS:
35693  default:
35694  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
35695  SCIPABORT();
35696  return -1; /*lint !e527*/
35697  } /*lint !e788*/
35698 }
35699 
35700 /** gets array of feasible primal solutions stored in the solution storage in case the problem is transformed; in case
35701  * if the problem stage is in SCIP_STAGE_PROBLEM, it returns the number array of solution candidate stored
35702  *
35703  * @return array of feasible primal solutions
35704  *
35705  * @pre This method can be called if SCIP is in one of the following stages:
35706  * - \ref SCIP_STAGE_PROBLEM
35707  * - \ref SCIP_STAGE_TRANSFORMED
35708  * - \ref SCIP_STAGE_INITPRESOLVE
35709  * - \ref SCIP_STAGE_PRESOLVING
35710  * - \ref SCIP_STAGE_EXITPRESOLVE
35711  * - \ref SCIP_STAGE_PRESOLVED
35712  * - \ref SCIP_STAGE_INITSOLVE
35713  * - \ref SCIP_STAGE_SOLVING
35714  * - \ref SCIP_STAGE_SOLVED
35715  * - \ref SCIP_STAGE_EXITSOLVE
35716  */
35718  SCIP* scip /**< SCIP data structure */
35719  )
35720 {
35721  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSols", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35722 
35723  switch( scip->set->stage )
35724  {
35725  case SCIP_STAGE_PROBLEM:
35726  return scip->origprimal->sols;
35727 
35730  case SCIP_STAGE_PRESOLVING:
35732  case SCIP_STAGE_PRESOLVED:
35733  case SCIP_STAGE_INITSOLVE:
35734  case SCIP_STAGE_SOLVING:
35735  case SCIP_STAGE_SOLVED:
35736  case SCIP_STAGE_EXITSOLVE:
35737  return scip->primal->sols;
35738 
35739  case SCIP_STAGE_INIT:
35741  case SCIP_STAGE_FREETRANS:
35742  case SCIP_STAGE_FREE:
35743  default:
35744  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
35745  return NULL;
35746  } /*lint !e788*/
35747 }
35748 
35749 /** gets best feasible primal solution found so far if the problem is transformed; in case the problem is in
35750  * SCIP_STAGE_PROBLEM it returns the best solution candidate, or NULL if no solution has been found or the candidate
35751  * store is empty;
35752  *
35753  * @return best feasible primal solution so far
35754  *
35755  * @pre This method can be called if SCIP is in one of the following stages:
35756  * - \ref SCIP_STAGE_PROBLEM
35757  * - \ref SCIP_STAGE_TRANSFORMED
35758  * - \ref SCIP_STAGE_INITPRESOLVE
35759  * - \ref SCIP_STAGE_PRESOLVING
35760  * - \ref SCIP_STAGE_EXITPRESOLVE
35761  * - \ref SCIP_STAGE_PRESOLVED
35762  * - \ref SCIP_STAGE_INITSOLVE
35763  * - \ref SCIP_STAGE_SOLVING
35764  * - \ref SCIP_STAGE_SOLVED
35765  * - \ref SCIP_STAGE_EXITSOLVE
35766  */
35768  SCIP* scip /**< SCIP data structure */
35769  )
35770 {
35771  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35772  switch( scip->set->stage )
35773  {
35774  case SCIP_STAGE_INIT:
35775  return NULL;
35776  case SCIP_STAGE_PROBLEM:
35777  assert(scip->origprimal != NULL);
35778  if( scip->origprimal->nsols > 0 )
35779  {
35780  assert(scip->origprimal->sols != NULL);
35781  assert(scip->origprimal->sols[0] != NULL);
35782  return scip->origprimal->sols[0];
35783  }
35784  break;
35785 
35788  case SCIP_STAGE_PRESOLVING:
35790  case SCIP_STAGE_PRESOLVED:
35791  case SCIP_STAGE_INITSOLVE:
35792  case SCIP_STAGE_SOLVING:
35793  case SCIP_STAGE_SOLVED:
35794  case SCIP_STAGE_EXITSOLVE:
35795  assert(scip->primal != NULL);
35796  if( scip->primal->nsols > 0 )
35797  {
35798  assert(scip->primal->sols != NULL);
35799  assert(scip->primal->sols[0] != NULL);
35800  return scip->primal->sols[0];
35801  }
35802  break;
35803 
35805  case SCIP_STAGE_FREETRANS:
35806  case SCIP_STAGE_FREE:
35807  default:
35808  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
35809  return NULL;
35810  }
35811 
35812  return NULL;
35813 }
35814 
35815 /** outputs best feasible primal solution found so far to file stream
35816  *
35817  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35818  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35819  *
35820  * @pre This method can be called if SCIP is in one of the following stages:
35821  * - \ref SCIP_STAGE_INIT
35822  * - \ref SCIP_STAGE_PROBLEM
35823  * - \ref SCIP_STAGE_TRANSFORMED
35824  * - \ref SCIP_STAGE_INITPRESOLVE
35825  * - \ref SCIP_STAGE_PRESOLVING
35826  * - \ref SCIP_STAGE_EXITPRESOLVE
35827  * - \ref SCIP_STAGE_PRESOLVED
35828  * - \ref SCIP_STAGE_INITSOLVE
35829  * - \ref SCIP_STAGE_SOLVING
35830  * - \ref SCIP_STAGE_SOLVED
35831  * - \ref SCIP_STAGE_EXITSOLVE
35832  */
35834  SCIP* scip, /**< SCIP data structure */
35835  FILE* file, /**< output file (or NULL for standard output) */
35836  SCIP_Bool printzeros /**< should variables set to zero be printed? */
35837  )
35838 {
35839  SCIP_SOL* sol;
35840 
35841  SCIP_CALL( checkStage(scip, "SCIPprintBestSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35842 
35843  sol = SCIPgetBestSol(scip);
35844 
35845  if( sol == NULL )
35846  SCIPmessageFPrintInfo(scip->messagehdlr, file, "no solution available\n");
35847  else
35848  {
35849  SCIP_CALL( SCIPprintSol(scip, sol, file, printzeros) );
35850  }
35851 
35852  return SCIP_OKAY;
35853 }
35854 
35855 /** outputs best feasible primal solution found so far in transformed variables to file stream
35856  *
35857  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35858  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35859  *
35860  * @pre This method can be called if SCIP is in one of the following stages:
35861  * - \ref SCIP_STAGE_INIT
35862  * - \ref SCIP_STAGE_PROBLEM
35863  * - \ref SCIP_STAGE_TRANSFORMED
35864  * - \ref SCIP_STAGE_INITPRESOLVE
35865  * - \ref SCIP_STAGE_PRESOLVING
35866  * - \ref SCIP_STAGE_EXITPRESOLVE
35867  * - \ref SCIP_STAGE_PRESOLVED
35868  * - \ref SCIP_STAGE_INITSOLVE
35869  * - \ref SCIP_STAGE_SOLVING
35870  * - \ref SCIP_STAGE_SOLVED
35871  * - \ref SCIP_STAGE_EXITSOLVE
35872  */
35874  SCIP* scip, /**< SCIP data structure */
35875  FILE* file, /**< output file (or NULL for standard output) */
35876  SCIP_Bool printzeros /**< should variables set to zero be printed? */
35877  )
35878 {
35879  SCIP_SOL* sol;
35880 
35881  SCIP_CALL( checkStage(scip, "SCIPprintBestTransSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35882 
35883  sol = SCIPgetBestSol(scip);
35884 
35885  if( sol != NULL && SCIPsolIsOriginal(sol) )
35886  {
35887  SCIPerrorMessage("best solution is defined in original space - cannot print it as transformed solution\n");
35888  return SCIP_INVALIDCALL;
35889  }
35890 
35891  if( sol == NULL )
35892  SCIPmessageFPrintInfo(scip->messagehdlr, file, "no solution available\n");
35893  else
35894  {
35895  SCIP_CALL( SCIPprintTransSol(scip, sol, file, printzeros) );
35896  }
35897 
35898  return SCIP_OKAY;
35899 }
35900 
35901 /** try to round given solution
35902  *
35903  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35904  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35905  *
35906  * @pre This method can be called if SCIP is in one of the following stages:
35907  * - \ref SCIP_STAGE_SOLVING
35908  */
35910  SCIP* scip, /**< SCIP data structure */
35911  SCIP_SOL* sol, /**< primal solution */
35912  SCIP_Bool* success /**< pointer to store whether rounding was successful */
35913  )
35914 {
35915  SCIP_CALL( checkStage(scip, "SCIProundSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35916 
35917  if( SCIPsolIsOriginal(sol) )
35918  {
35919  SCIPerrorMessage("cannot round original space solution\n");
35920  return SCIP_INVALIDCALL;
35921  }
35922 
35923  SCIP_CALL( SCIPsolRound(sol, scip->set, scip->stat, scip->transprob, scip->tree, success) );
35924 
35925  return SCIP_OKAY;
35926 }
35927 
35928 /** retransforms solution to original problem space
35929  *
35930  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35931  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35932  *
35933  * @pre This method can be called if SCIP is in one of the following stages:
35934  * - \ref SCIP_STAGE_TRANSFORMED
35935  * - \ref SCIP_STAGE_INITPRESOLVE
35936  * - \ref SCIP_STAGE_PRESOLVING
35937  * - \ref SCIP_STAGE_EXITPRESOLVE
35938  * - \ref SCIP_STAGE_PRESOLVED
35939  * - \ref SCIP_STAGE_INITSOLVE
35940  * - \ref SCIP_STAGE_SOLVING
35941  * - \ref SCIP_STAGE_SOLVED
35942  * - \ref SCIP_STAGE_EXITSOLVE
35943  * - \ref SCIP_STAGE_FREETRANS
35944  */
35946  SCIP* scip, /**< SCIP data structure */
35947  SCIP_SOL* sol /**< primal CIP solution */
35948  )
35949 {
35950  SCIP_CALL( checkStage(scip, "SCIPretransformSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35951 
35952  switch ( SCIPsolGetOrigin(sol) )
35953  {
35955  /* nothing to do */
35956  return SCIP_OKAY;
35957 
35958  case SCIP_SOLORIGIN_LPSOL:
35959  case SCIP_SOLORIGIN_NLPSOL:
35962 
35963  /* first unlink solution */
35964  SCIP_CALL( SCIPunlinkSol(scip, sol) );
35965 
35966  /*lint -fallthrough*/
35967  case SCIP_SOLORIGIN_ZERO:
35968  {
35969  SCIP_Bool hasinfval;
35970 
35971  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
35972  break;
35973  }
35975  SCIPerrorMessage("unkown solution origin.\n");
35976  return SCIP_INVALIDCALL;
35977 
35978  default:
35979  /* note that this is in an internal SCIP error since all solution origins are covert in the switch above */
35980  SCIPerrorMessage("invalid solution origin <%d>\n", SCIPsolGetOrigin(sol));
35981  return SCIP_ERROR;
35982  }
35983 
35984  return SCIP_OKAY;
35985 }
35986 
35987 /** reads a given solution file, problem has to be transformed in advance
35988  *
35989  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35990  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35991  *
35992  * @pre This method can be called if SCIP is in one of the following stages:
35993  * - \ref SCIP_STAGE_PROBLEM
35994  * - \ref SCIP_STAGE_TRANSFORMED
35995  * - \ref SCIP_STAGE_INITPRESOLVE
35996  * - \ref SCIP_STAGE_PRESOLVING
35997  * - \ref SCIP_STAGE_EXITPRESOLVE
35998  * - \ref SCIP_STAGE_PRESOLVED
35999  * - \ref SCIP_STAGE_INITSOLVE
36000  * - \ref SCIP_STAGE_SOLVING
36001  */
36003  SCIP* scip, /**< SCIP data structure */
36004  const char* filename /**< name of the input file */
36005  )
36006 {
36007  SCIP_CALL( checkStage(scip, "SCIPreadSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36008 
36009  /* we pass the reading of the solution file on to reader_sol via the following call */
36010  SCIP_CALL( SCIPreadProb(scip, filename, "sol") );
36011 
36012  return SCIP_OKAY;
36013 }
36014 
36015 /** adds feasible primal solution to solution storage by copying it
36016  *
36017  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36018  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36019  *
36020  * @pre This method can be called if SCIP is in one of the following stages:
36021  * - \ref SCIP_STAGE_PROBLEM
36022  * - \ref SCIP_STAGE_TRANSFORMED
36023  * - \ref SCIP_STAGE_INITPRESOLVE
36024  * - \ref SCIP_STAGE_PRESOLVING
36025  * - \ref SCIP_STAGE_EXITPRESOLVE
36026  * - \ref SCIP_STAGE_PRESOLVED
36027  * - \ref SCIP_STAGE_SOLVING
36028  * - \ref SCIP_STAGE_FREETRANS
36029  *
36030  * @note Do not call during propagation, use heur_trysol instead.
36031  */
36033  SCIP* scip, /**< SCIP data structure */
36034  SCIP_SOL* sol, /**< primal CIP solution */
36035  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
36036  )
36037 {
36038  SCIP_CALL( checkStage(scip, "SCIPaddSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE) );
36039 
36040  switch( scip->set->stage )
36041  {
36042  case SCIP_STAGE_PROBLEM:
36043  case SCIP_STAGE_FREETRANS:
36044  assert(SCIPsolIsOriginal(sol));
36045  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, stored) );
36046  return SCIP_OKAY;
36047 
36050  case SCIP_STAGE_PRESOLVING:
36052  /* if the solution is added during presolving and it is not defined on original variables,
36053  * presolving operations will destroy its validity, so we retransform it to the original space
36054  */
36055  if( !SCIPsolIsOriginal(sol) )
36056  {
36057  SCIP_Bool hasinfval;
36058 
36059  SCIP_CALL( SCIPsolUnlink(sol, scip->set, scip->transprob) );
36060  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
36061  }
36062  /*lint -fallthrough*/
36063  case SCIP_STAGE_PRESOLVED:
36064  case SCIP_STAGE_SOLVING:
36065  {
36066  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
36067 
36068  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
36069  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol,
36070  stored) );
36071 
36072  /* @todo use solution index rather than pointer */
36073  if( *stored && (bestsol != SCIPgetBestSol(scip)) )
36074  {
36075  SCIPstoreSolutionGap(scip);
36076  }
36077 
36078  return SCIP_OKAY;
36079  }
36081  case SCIP_STAGE_INITSOLVE:
36082  case SCIP_STAGE_SOLVED:
36083  case SCIP_STAGE_EXITSOLVE:
36084  default:
36085  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
36086  return SCIP_INVALIDCALL;
36087  } /*lint !e788*/
36088 }
36089 
36090 /** adds primal solution to solution storage, frees the solution afterwards
36091  *
36092  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36093  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36094  *
36095  * @pre This method can be called if SCIP is in one of the following stages:
36096  * - \ref SCIP_STAGE_PROBLEM
36097  * - \ref SCIP_STAGE_TRANSFORMED
36098  * - \ref SCIP_STAGE_INITPRESOLVE
36099  * - \ref SCIP_STAGE_PRESOLVING
36100  * - \ref SCIP_STAGE_EXITPRESOLVE
36101  * - \ref SCIP_STAGE_PRESOLVED
36102  * - \ref SCIP_STAGE_SOLVING
36103  * - \ref SCIP_STAGE_FREETRANS
36104  *
36105  * @note Do not call during propagation, use heur_trysol instead.
36106  */
36108  SCIP* scip, /**< SCIP data structure */
36109  SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */
36110  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
36111  )
36112 {
36113  SCIP_CALL( checkStage(scip, "SCIPaddSolFree", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE) );
36114 
36115  switch( scip->set->stage )
36116  {
36117  case SCIP_STAGE_PROBLEM:
36118  case SCIP_STAGE_FREETRANS:
36119  assert(SCIPsolIsOriginal(*sol));
36120  SCIP_CALL( SCIPprimalAddOrigSolFree(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, stored) );
36121  return SCIP_OKAY;
36122 
36125  case SCIP_STAGE_PRESOLVING:
36127  /* if the solution is added during presolving and it is not defined on original variables,
36128  * presolving operations will destroy its validity, so we retransform it to the original space
36129  */
36130  if( !SCIPsolIsOriginal(*sol) )
36131  {
36132  SCIP_Bool hasinfval;
36133 
36134  SCIP_CALL( SCIPsolUnlink(*sol, scip->set, scip->transprob) );
36135  SCIP_CALL( SCIPsolRetransform(*sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
36136  }
36137  /*lint -fallthrough*/
36138  case SCIP_STAGE_PRESOLVED:
36139  case SCIP_STAGE_SOLVING:
36140  {
36141  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
36142 
36143  SCIP_CALL( SCIPprimalAddSolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
36144  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
36145  sol, stored) );
36146 
36147  if( *stored )
36148  {
36149  if( bestsol != SCIPgetBestSol(scip) )
36150  {
36151  assert(SCIPgetBestSol(scip) != NULL);
36152  SCIPstoreSolutionGap(scip);
36153  }
36154  }
36155 
36156  return SCIP_OKAY;
36157  }
36159  case SCIP_STAGE_INITSOLVE:
36160  case SCIP_STAGE_SOLVED:
36161  case SCIP_STAGE_EXITSOLVE:
36162  default:
36163  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
36164  return SCIP_INVALIDCALL;
36165  } /*lint !e788*/
36166 }
36167 
36168 /** adds current LP/pseudo solution to solution storage
36169  *
36170  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36171  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36172  *
36173  * @pre This method can be called if SCIP is in one of the following stages:
36174  * - \ref SCIP_STAGE_PRESOLVED
36175  * - \ref SCIP_STAGE_SOLVING
36176  */
36178  SCIP* scip, /**< SCIP data structure */
36179  SCIP_HEUR* heur, /**< heuristic that found the solution */
36180  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
36181  )
36182 {
36183  SCIP_SOL* bestsol;
36184 
36185  SCIP_CALL( checkStage(scip, "SCIPaddCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36186 
36187  bestsol = SCIPgetBestSol(scip);
36188 
36189  SCIP_CALL( SCIPprimalAddCurrentSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
36190  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, heur,
36191  stored) );
36192 
36193  if( *stored )
36194  {
36195  if( bestsol != SCIPgetBestSol(scip) )
36196  SCIPstoreSolutionGap(scip);
36197  }
36198 
36199  return SCIP_OKAY;
36200 }
36201 
36202 /** checks solution for feasibility; if possible, adds it to storage by copying
36203  *
36204  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36205  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36206  *
36207  * @pre This method can be called if SCIP is in one of the following stages:
36208  * - \ref SCIP_STAGE_TRANSFORMED
36209  * - \ref SCIP_STAGE_INITPRESOLVE
36210  * - \ref SCIP_STAGE_PRESOLVING
36211  * - \ref SCIP_STAGE_EXITPRESOLVE
36212  * - \ref SCIP_STAGE_PRESOLVED
36213  * - \ref SCIP_STAGE_SOLVING
36214  *
36215  * @note Do not call during propagation, use heur_trysol instead.
36216  */
36218  SCIP* scip, /**< SCIP data structure */
36219  SCIP_SOL* sol, /**< primal CIP solution */
36220  SCIP_Bool printreason, /**< Should all reasons of violation be printed? */
36221  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
36222  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
36223  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
36224  SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */
36225  )
36226 {
36227  SCIP_SOL* bestsol;
36228 
36229  assert(stored != NULL);
36230 
36231  SCIP_CALL( checkStage(scip, "SCIPtrySol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36232 
36233  bestsol = SCIPgetBestSol(scip);
36234 
36235  /* if the solution is added during presolving and it is not defined on original variables,
36236  * presolving operations will destroy its validity, so we retransform it to the original space
36237  */
36238  if( scip->set->stage == SCIP_STAGE_PRESOLVING && !SCIPsolIsOriginal(sol) )
36239  {
36240  SCIP_Bool hasinfval;
36241 
36242  SCIP_CALL( SCIPsolUnlink(sol, scip->set, scip->transprob) );
36243  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
36244  }
36245 
36246  if( SCIPsolIsOriginal(sol) )
36247  {
36248  SCIP_Bool feasible;
36249 
36250  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
36251  * including modifiable constraints */
36252  SCIP_CALL( checkSolOrig(scip, sol, &feasible, printreason, FALSE, checkbounds, checkintegrality, checklprows, TRUE) );
36253  if( feasible )
36254  {
36255  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
36256  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
36257  sol, stored) );
36258 
36259  if( *stored )
36260  {
36261  if( bestsol != SCIPgetBestSol(scip) )
36262  SCIPstoreSolutionGap(scip);
36263  }
36264  }
36265  else
36266  *stored = FALSE;
36267  }
36268  else
36269  {
36270  SCIP_CALL( SCIPprimalTrySol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->origprob,
36271  scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol, printreason,
36272  checkbounds, checkintegrality, checklprows, stored) );
36273 
36274  if( *stored )
36275  {
36276  if( bestsol != SCIPgetBestSol(scip) )
36277  SCIPstoreSolutionGap(scip);
36278  }
36279  }
36280 
36281  return SCIP_OKAY;
36282 }
36283 
36284 /** checks primal solution; if feasible, adds it to storage; solution is freed afterwards
36285  *
36286  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36287  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36288  *
36289  * @pre This method can be called if SCIP is in one of the following stages:
36290  * - \ref SCIP_STAGE_TRANSFORMED
36291  * - \ref SCIP_STAGE_INITPRESOLVE
36292  * - \ref SCIP_STAGE_PRESOLVING
36293  * - \ref SCIP_STAGE_EXITPRESOLVE
36294  * - \ref SCIP_STAGE_PRESOLVED
36295  * - \ref SCIP_STAGE_SOLVING
36296  *
36297  * @note Do not call during propagation, use heur_trysol instead.
36298  */
36300  SCIP* scip, /**< SCIP data structure */
36301  SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */
36302  SCIP_Bool printreason, /**< Should all reasons of violations be printed */
36303  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
36304  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
36305  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
36306  SCIP_Bool* stored /**< stores whether solution was feasible and good enough to keep */
36307  )
36308 {
36309  SCIP_SOL* bestsol;
36310 
36311  assert(stored != NULL);
36312  assert(sol != NULL);
36313 
36314  SCIP_CALL( checkStage(scip, "SCIPtrySolFree", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36315 
36316  bestsol = SCIPgetBestSol(scip);
36317 
36318  /* if the solution is added during presolving and it is not defined on original variables,
36319  * presolving operations will destroy its validity, so we retransform it to the original space
36320  */
36321  if( scip->set->stage == SCIP_STAGE_PRESOLVING && !SCIPsolIsOriginal(*sol) )
36322  {
36323  SCIP_Bool hasinfval;
36324 
36325  SCIP_CALL( SCIPsolUnlink(*sol, scip->set, scip->transprob) );
36326  SCIP_CALL( SCIPsolRetransform(*sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
36327  }
36328 
36329  if( SCIPsolIsOriginal(*sol) )
36330  {
36331  SCIP_Bool feasible;
36332 
36333  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
36334  * including modifiable constraints
36335  */
36336  SCIP_CALL( checkSolOrig(scip, *sol, &feasible, printreason, FALSE, checkbounds, checkintegrality, checklprows, TRUE) );
36337 
36338  if( feasible )
36339  {
36340  SCIP_CALL( SCIPprimalAddSolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
36341  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
36342  sol, stored) );
36343 
36344  if( *stored )
36345  {
36346  if( bestsol != SCIPgetBestSol(scip) )
36347  SCIPstoreSolutionGap(scip);
36348  }
36349  }
36350  else
36351  {
36352  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->primal) );
36353  *stored = FALSE;
36354  }
36355  }
36356  else
36357  {
36358  SCIP_CALL( SCIPprimalTrySolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob,
36359  scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol, printreason, checkbounds, checkintegrality, checklprows, stored) );
36360 
36361  if( *stored )
36362  {
36363  if( bestsol != SCIPgetBestSol(scip) )
36364  SCIPstoreSolutionGap(scip);
36365  }
36366  }
36367 
36368  return SCIP_OKAY;
36369 }
36370 
36371 /** checks current LP/pseudo solution for feasibility; if possible, adds it to storage
36372  *
36373  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36374  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36375  *
36376  * @pre This method can be called if SCIP is in one of the following stages:
36377  * - \ref SCIP_STAGE_PRESOLVED
36378  * - \ref SCIP_STAGE_SOLVING
36379  */
36381  SCIP* scip, /**< SCIP data structure */
36382  SCIP_HEUR* heur, /**< heuristic that found the solution */
36383  SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
36384  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
36385  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
36386  SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */
36387  )
36388 {
36389  SCIP_SOL* bestsol;
36390 
36391  SCIP_CALL( checkStage(scip, "SCIPtryCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36392 
36393  bestsol = SCIPgetBestSol(scip);
36394 
36395  SCIP_CALL( SCIPprimalTryCurrentSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
36396  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, heur,
36397  printreason, checkintegrality, checklprows, stored) );
36398 
36399  if( *stored )
36400  {
36401  if( bestsol != SCIPgetBestSol(scip) )
36402  SCIPstoreSolutionGap(scip);
36403  }
36404 
36405  return SCIP_OKAY;
36406 }
36407 
36408 /** checks solution for feasibility without adding it to the solution store
36409  *
36410  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36411  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36412  *
36413  * @pre This method can be called if SCIP is in one of the following stages:
36414  * - \ref SCIP_STAGE_PROBLEM
36415  * - \ref SCIP_STAGE_TRANSFORMED
36416  * - \ref SCIP_STAGE_INITPRESOLVE
36417  * - \ref SCIP_STAGE_PRESOLVING
36418  * - \ref SCIP_STAGE_EXITPRESOLVE
36419  * - \ref SCIP_STAGE_PRESOLVED
36420  * - \ref SCIP_STAGE_INITSOLVE
36421  * - \ref SCIP_STAGE_SOLVING
36422  * - \ref SCIP_STAGE_SOLVED
36423  */
36425  SCIP* scip, /**< SCIP data structure */
36426  SCIP_SOL* sol, /**< primal CIP solution */
36427  SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
36428  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
36429  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
36430  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
36431  SCIP_Bool* feasible /**< stores whether given solution is feasible */
36432  )
36433 {
36434  SCIP_CALL( checkStage(scip, "SCIPcheckSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
36435 
36436  /* if we want to solve exactly, the constraint handlers cannot rely on the LP's feasibility */
36437  checklprows = checklprows || scip->set->misc_exactsolve;
36438 
36439  if( SCIPsolIsOriginal(sol) )
36440  {
36441  /* SCIPsolCheck() can only be called on transformed solutions */
36442  SCIP_CALL( checkSolOrig(scip, sol, feasible, printreason, FALSE, checkbounds, checkintegrality, checklprows, FALSE) );
36443  }
36444  else
36445  {
36446  SCIP_CALL( SCIPsolCheck(sol, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat, scip->transprob, printreason,
36447  checkbounds, checkintegrality, checklprows, feasible) );
36448  }
36449 
36450  return SCIP_OKAY;
36451 }
36452 
36453 /** checks solution for feasibility in original problem without adding it to the solution store;
36454  * this method is used to double check a solution in order to validate the presolving process
36455  *
36456  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36457  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36458  *
36459  * @pre This method can be called if SCIP is in one of the following stages:
36460  * - \ref SCIP_STAGE_PROBLEM
36461  * - \ref SCIP_STAGE_TRANSFORMED
36462  * - \ref SCIP_STAGE_INITPRESOLVE
36463  * - \ref SCIP_STAGE_PRESOLVING
36464  * - \ref SCIP_STAGE_EXITPRESOLVE
36465  * - \ref SCIP_STAGE_PRESOLVED
36466  * - \ref SCIP_STAGE_INITSOLVE
36467  * - \ref SCIP_STAGE_SOLVING
36468  * - \ref SCIP_STAGE_SOLVED
36469  */
36471  SCIP* scip, /**< SCIP data structure */
36472  SCIP_SOL* sol, /**< primal CIP solution */
36473  SCIP_Bool* feasible, /**< stores whether given solution is feasible */
36474  SCIP_Bool printreason, /**< should the reason for the violation be printed? */
36475  SCIP_Bool completely /**< should all violation be checked? */
36476  )
36477 {
36478  assert(scip != NULL);
36479  assert(sol != NULL);
36480  assert(feasible != NULL);
36481 
36482  SCIP_CALL( checkStage(scip, "SCIPcheckSolOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
36483 
36484  /* check solution in original problem; that includes bounds, integrality, and non modifiable constraints */
36485  SCIP_CALL( checkSolOrig(scip, sol, feasible, printreason, completely, TRUE, TRUE, TRUE, FALSE) );
36486 
36487  return SCIP_OKAY;
36488 }
36489 
36490 /** return whether a primal ray is stored that proves unboundedness of the LP relaxation
36491  *
36492  * @return return whether a primal ray is stored that proves unboundedness of the LP relaxation
36493  *
36494  * @pre This method can be called if SCIP is in one of the following stages:
36495  * - \ref SCIP_STAGE_SOLVING
36496  * - \ref SCIP_STAGE_SOLVED
36497  */
36499  SCIP* scip /**< SCIP data structure */
36500  )
36501 {
36502  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasPrimalRay", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
36503 
36504  return scip->primal->primalray != NULL;
36505 }
36506 
36507 /** gets value of given variable in primal ray causing unboundedness of the LP relaxation;
36508  * should only be called if such a ray is stored (check with SCIPhasPrimalRay())
36509  *
36510  * @return value of given variable in primal ray causing unboundedness of the LP relaxation
36511  *
36512  * @pre This method can be called if SCIP is in one of the following stages:
36513  * - \ref SCIP_STAGE_SOLVING
36514  * - \ref SCIP_STAGE_SOLVED
36515  */
36517  SCIP* scip, /**< SCIP data structure */
36518  SCIP_VAR* var /**< variable to get value for */
36519  )
36520 {
36521  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrimalRayVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
36522 
36523  assert(var != NULL);
36524  assert(scip->primal->primalray != NULL);
36525  assert(var->scip == scip);
36526 
36527  return SCIPsolGetRayVal(scip->primal->primalray, scip->set, scip->stat, var);
36528 }
36529 
36530 
36531 
36532 /*
36533  * event methods
36534  */
36535 
36536 /** catches a global (not variable or row dependent) event
36537  *
36538  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36539  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36540  *
36541  * @pre This method can be called if @p scip is in one of the following stages:
36542  * - \ref SCIP_STAGE_TRANSFORMING
36543  * - \ref SCIP_STAGE_TRANSFORMED
36544  * - \ref SCIP_STAGE_INITPRESOLVE
36545  * - \ref SCIP_STAGE_PRESOLVING
36546  * - \ref SCIP_STAGE_EXITPRESOLVE
36547  * - \ref SCIP_STAGE_PRESOLVED
36548  * - \ref SCIP_STAGE_INITSOLVE
36549  * - \ref SCIP_STAGE_SOLVING
36550  * - \ref SCIP_STAGE_SOLVED
36551  * - \ref SCIP_STAGE_EXITSOLVE
36552  * - \ref SCIP_STAGE_FREETRANS
36553  */
36555  SCIP* scip, /**< SCIP data structure */
36556  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
36557  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
36558  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
36559  int* filterpos /**< pointer to store position of event filter entry, or NULL */
36560  )
36561 {
36562  SCIP_CALL( checkStage(scip, "SCIPcatchEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
36563 
36564  SCIP_CALL( SCIPeventfilterAdd(scip->eventfilter, scip->mem->probmem, scip->set,
36565  eventtype, eventhdlr, eventdata, filterpos) );
36566 
36567  return SCIP_OKAY;
36568 }
36569 
36570 /** drops a global event (stops to track event)
36571  *
36572  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36573  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36574  *
36575  * @pre This method can be called if @p scip is in one of the following stages:
36576  * - \ref SCIP_STAGE_TRANSFORMING
36577  * - \ref SCIP_STAGE_TRANSFORMED
36578  * - \ref SCIP_STAGE_INITPRESOLVE
36579  * - \ref SCIP_STAGE_PRESOLVING
36580  * - \ref SCIP_STAGE_EXITPRESOLVE
36581  * - \ref SCIP_STAGE_PRESOLVED
36582  * - \ref SCIP_STAGE_INITSOLVE
36583  * - \ref SCIP_STAGE_SOLVING
36584  * - \ref SCIP_STAGE_SOLVED
36585  * - \ref SCIP_STAGE_EXITSOLVE
36586  * - \ref SCIP_STAGE_FREETRANS
36587  */
36589  SCIP* scip, /**< SCIP data structure */
36590  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
36591  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
36592  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
36593  int filterpos /**< position of event filter entry returned by SCIPcatchEvent(), or -1 */
36594  )
36595 {
36596  SCIP_CALL( checkStage(scip, "SCIPdropEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
36597 
36598  SCIP_CALL( SCIPeventfilterDel(scip->eventfilter, scip->mem->probmem, scip->set,
36599  eventtype, eventhdlr, eventdata, filterpos) );
36600 
36601  return SCIP_OKAY;
36602 }
36603 
36604 /** catches an objective value or domain change event on the given transformed variable
36605  *
36606  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36607  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36608  *
36609  * @pre This method can be called if @p scip is in one of the following stages:
36610  * - \ref SCIP_STAGE_TRANSFORMING
36611  * - \ref SCIP_STAGE_TRANSFORMED
36612  * - \ref SCIP_STAGE_INITPRESOLVE
36613  * - \ref SCIP_STAGE_PRESOLVING
36614  * - \ref SCIP_STAGE_EXITPRESOLVE
36615  * - \ref SCIP_STAGE_PRESOLVED
36616  * - \ref SCIP_STAGE_INITSOLVE
36617  * - \ref SCIP_STAGE_SOLVING
36618  * - \ref SCIP_STAGE_SOLVED
36619  * - \ref SCIP_STAGE_EXITSOLVE
36620  * - \ref SCIP_STAGE_FREETRANS
36621  */
36623  SCIP* scip, /**< SCIP data structure */
36624  SCIP_VAR* var, /**< transformed variable to catch event for */
36625  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
36626  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
36627  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
36628  int* filterpos /**< pointer to store position of event filter entry, or NULL */
36629  )
36630 {
36631  SCIP_CALL( checkStage(scip, "SCIPcatchVarEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
36632 
36633  if( (eventtype & SCIP_EVENTTYPE_VARCHANGED) == 0 )
36634  {
36635  SCIPerrorMessage("event does not operate on a single variable\n");
36636  return SCIP_INVALIDDATA;
36637  }
36638 
36639  if( SCIPvarIsOriginal(var) )
36640  {
36641  SCIPerrorMessage("cannot catch events on original variable <%s>\n", SCIPvarGetName(var));
36642  return SCIP_INVALIDDATA;
36643  }
36644 
36645  SCIP_CALL( SCIPvarCatchEvent(var, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
36646 
36647  return SCIP_OKAY;
36648 }
36649 
36650 /** drops an objective value or domain change event (stops to track event) on the given transformed variable
36651  *
36652  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36653  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36654  *
36655  * @pre This method can be called if @p scip is in one of the following stages:
36656  * - \ref SCIP_STAGE_TRANSFORMING
36657  * - \ref SCIP_STAGE_TRANSFORMED
36658  * - \ref SCIP_STAGE_INITPRESOLVE
36659  * - \ref SCIP_STAGE_PRESOLVING
36660  * - \ref SCIP_STAGE_EXITPRESOLVE
36661  * - \ref SCIP_STAGE_PRESOLVED
36662  * - \ref SCIP_STAGE_INITSOLVE
36663  * - \ref SCIP_STAGE_SOLVING
36664  * - \ref SCIP_STAGE_SOLVED
36665  * - \ref SCIP_STAGE_EXITSOLVE
36666  * - \ref SCIP_STAGE_FREETRANS
36667  */
36669  SCIP* scip, /**< SCIP data structure */
36670  SCIP_VAR* var, /**< transformed variable to drop event for */
36671  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
36672  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
36673  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
36674  int filterpos /**< position of event filter entry returned by SCIPcatchVarEvent(), or -1 */
36675  )
36676 {
36677  SCIP_CALL( checkStage(scip, "SCIPdropVarEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
36678 
36679  if( SCIPvarIsOriginal(var) )
36680  {
36681  SCIPerrorMessage("cannot drop events on original variable <%s>\n", SCIPvarGetName(var));
36682  return SCIP_INVALIDDATA;
36683  }
36684 
36685  SCIP_CALL( SCIPvarDropEvent(var, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
36686 
36687  return SCIP_OKAY;
36688 }
36689 
36690 /** catches a row coefficient, constant, or side change event on the given row
36691  *
36692  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36693  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36694  *
36695  * @pre This method can be called if @p scip is in one of the following stages:
36696  * - \ref SCIP_STAGE_TRANSFORMING
36697  * - \ref SCIP_STAGE_TRANSFORMED
36698  * - \ref SCIP_STAGE_INITPRESOLVE
36699  * - \ref SCIP_STAGE_PRESOLVING
36700  * - \ref SCIP_STAGE_EXITPRESOLVE
36701  * - \ref SCIP_STAGE_PRESOLVED
36702  * - \ref SCIP_STAGE_INITSOLVE
36703  * - \ref SCIP_STAGE_SOLVING
36704  * - \ref SCIP_STAGE_SOLVED
36705  * - \ref SCIP_STAGE_EXITSOLVE
36706  * - \ref SCIP_STAGE_FREETRANS
36707  */
36709  SCIP* scip, /**< SCIP data structure */
36710  SCIP_ROW* row, /**< linear row to catch event for */
36711  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
36712  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
36713  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
36714  int* filterpos /**< pointer to store position of event filter entry, or NULL */
36715  )
36716 {
36717  SCIP_CALL( checkStage(scip, "SCIPcatchRowEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
36718 
36719  if( (eventtype & SCIP_EVENTTYPE_ROWCHANGED) == 0 )
36720  {
36721  SCIPerrorMessage("event does not operate on a single row\n");
36722  return SCIP_INVALIDDATA;
36723  }
36724 
36725  SCIP_CALL( SCIProwCatchEvent(row, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
36726 
36727  return SCIP_OKAY;
36728 }
36729 
36730 /** drops a row coefficient, constant, or side change event (stops to track event) on the given row
36731  *
36732  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36733  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36734  *
36735  * @pre This method can be called if @p scip is in one of the following stages:
36736  * - \ref SCIP_STAGE_TRANSFORMING
36737  * - \ref SCIP_STAGE_TRANSFORMED
36738  * - \ref SCIP_STAGE_INITPRESOLVE
36739  * - \ref SCIP_STAGE_PRESOLVING
36740  * - \ref SCIP_STAGE_EXITPRESOLVE
36741  * - \ref SCIP_STAGE_PRESOLVED
36742  * - \ref SCIP_STAGE_INITSOLVE
36743  * - \ref SCIP_STAGE_SOLVING
36744  * - \ref SCIP_STAGE_SOLVED
36745  * - \ref SCIP_STAGE_EXITSOLVE
36746  * - \ref SCIP_STAGE_FREETRANS
36747  */
36749  SCIP* scip, /**< SCIP data structure */
36750  SCIP_ROW* row, /**< linear row to drop event for */
36751  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
36752  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
36753  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
36754  int filterpos /**< position of event filter entry returned by SCIPcatchVarEvent(), or -1 */
36755  )
36756 {
36757  SCIP_CALL( checkStage(scip, "SCIPdropRowEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
36758 
36759  SCIP_CALL( SCIProwDropEvent(row, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
36760 
36761  return SCIP_OKAY;
36762 }
36763 
36764 
36765 /*
36766  * tree methods
36767  */
36768 
36769 /** gets current node in the tree
36770  *
36771  * @return the current node of the search tree
36772  *
36773  * @pre This method can be called if @p scip is in one of the following stages:
36774  * - \ref SCIP_STAGE_INITPRESOLVE
36775  * - \ref SCIP_STAGE_PRESOLVING
36776  * - \ref SCIP_STAGE_EXITPRESOLVE
36777  * - \ref SCIP_STAGE_SOLVING
36778  */
36780  SCIP* scip /**< SCIP data structure */
36781  )
36782 {
36783  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCurrentNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36784 
36785  return SCIPtreeGetCurrentNode(scip->tree);
36786 }
36787 
36788 /** gets the root node of the tree
36789  *
36790  * @return the root node of the search tree
36791  *
36792  * @pre This method can be called if @p scip is in one of the following stages:
36793  * - \ref SCIP_STAGE_INITPRESOLVE
36794  * - \ref SCIP_STAGE_PRESOLVING
36795  * - \ref SCIP_STAGE_EXITPRESOLVE
36796  * - \ref SCIP_STAGE_SOLVING
36797  */
36799  SCIP* scip /**< SCIP data structure */
36800  )
36801 {
36802  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRootNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36803 
36804  return SCIPtreeGetRootNode(scip->tree);
36805 }
36806 
36807 /** gets the effective root depth, i.e., the depth of the deepest node which is part of all paths from the root node
36808  * to the unprocessed nodes.
36809  *
36810  * @return effective root depth
36811  *
36812  * @pre This method can be called if @p scip is in one of the following stages:
36813  * - \ref SCIP_STAGE_SOLVING
36814  */
36816  SCIP* scip /**< SCIP data structure */
36817  )
36818 {
36819  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetEffectiveRootDepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36820 
36821  return SCIPtreeGetEffectiveRootDepth(scip->tree);
36822 }
36823 
36824 /** returns whether the current node is already solved and only propagated again
36825  *
36826  * @return TRUE is returned if \SCIP performance repropagation, otherwise FALSE.
36827  *
36828  * @pre This method can be called if @p scip is in one of the following stages:
36829  * - \ref SCIP_STAGE_INITPRESOLVE
36830  * - \ref SCIP_STAGE_PRESOLVING
36831  * - \ref SCIP_STAGE_EXITPRESOLVE
36832  * - \ref SCIP_STAGE_SOLVING
36833  */
36835  SCIP* scip /**< SCIP data structure */
36836  )
36837 {
36838  SCIP_CALL_ABORT( checkStage(scip, "SCIPinRepropagation", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36839 
36840  return SCIPtreeInRepropagation(scip->tree);
36841 }
36842 
36843 /** gets children of focus node along with the number of children
36844  *
36845  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36846  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36847  *
36848  * @pre This method can be called if @p scip is in one of the following stages:
36849  * - \ref SCIP_STAGE_SOLVING
36850  */
36852  SCIP* scip, /**< SCIP data structure */
36853  SCIP_NODE*** children, /**< pointer to store children array, or NULL if not needed */
36854  int* nchildren /**< pointer to store number of children, or NULL if not needed */
36855  )
36856 {
36857  SCIP_CALL( checkStage(scip, "SCIPgetChildren", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36858 
36859  if( children != NULL )
36860  *children = scip->tree->children;
36861  if( nchildren != NULL )
36862  *nchildren = scip->tree->nchildren;
36863 
36864  return SCIP_OKAY;
36865 }
36866 
36867 /** gets number of children of focus node
36868  *
36869  * @return number of children of the focus node
36870  *
36871  * @pre This method can be called if @p scip is in one of the following stages:
36872  * - \ref SCIP_STAGE_SOLVING
36873  */
36875  SCIP* scip /**< SCIP data structure */
36876  )
36877 {
36878  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNChildren", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36879 
36880  return scip->tree->nchildren;
36881 }
36882 
36883 /** gets siblings of focus node along with the number of siblings
36884  *
36885  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36886  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36887  *
36888  * @pre This method can be called if @p scip is in one of the following stages:
36889  * - \ref SCIP_STAGE_SOLVING
36890  */
36892  SCIP* scip, /**< SCIP data structure */
36893  SCIP_NODE*** siblings, /**< pointer to store siblings array, or NULL if not needed */
36894  int* nsiblings /**< pointer to store number of siblings, or NULL if not needed */
36895  )
36896 {
36897  SCIP_CALL( checkStage(scip, "SCIPgetSiblings", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36898 
36899  if( siblings != NULL )
36900  *siblings = scip->tree->siblings;
36901  if( nsiblings != NULL )
36902  *nsiblings = scip->tree->nsiblings;
36903 
36904  return SCIP_OKAY;
36905 }
36906 
36907 /** gets number of siblings of focus node
36908  *
36909  * @return the number of siblings of focus node
36910  *
36911  * @pre This method can be called if @p scip is in one of the following stages:
36912  * - \ref SCIP_STAGE_SOLVING
36913  */
36915  SCIP* scip /**< SCIP data structure */
36916  )
36917 {
36918  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSiblings", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36919 
36920  return scip->tree->nsiblings;
36921 }
36922 
36923 /** gets leaves of the tree along with the number of leaves
36924  *
36925  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36926  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36927  *
36928  * @pre This method can be called if @p scip is in one of the following stages:
36929  * - \ref SCIP_STAGE_SOLVING
36930  */
36932  SCIP* scip, /**< SCIP data structure */
36933  SCIP_NODE*** leaves, /**< pointer to store leaves array, or NULL if not needed */
36934  int* nleaves /**< pointer to store number of leaves, or NULL if not needed */
36935  )
36936 {
36937  SCIP_CALL( checkStage(scip, "SCIPgetLeaves", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36938 
36939  if( leaves != NULL )
36940  *leaves = SCIPnodepqNodes(scip->tree->leaves);
36941  if( nleaves != NULL )
36942  *nleaves = SCIPnodepqLen(scip->tree->leaves);
36943 
36944  return SCIP_OKAY;
36945 }
36946 
36947 /** gets number of leaves in the tree
36948  *
36949  * @return the number of leaves in the tree
36950  *
36951  * @pre This method can be called if @p scip is in one of the following stages:
36952  * - \ref SCIP_STAGE_SOLVING
36953  */
36955  SCIP* scip /**< SCIP data structure */
36956  )
36957 {
36958  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLeaves", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36959 
36960  return SCIPnodepqLen(scip->tree->leaves);
36961 }
36962 
36963 /** gets the best child of the focus node w.r.t. the node selection priority assigned by the branching rule
36964  *
36965  * @return the best child of the focus node w.r.t. the node selection priority assigned by the branching rule
36966  *
36967  * @pre This method can be called if @p scip is in one of the following stages:
36968  * - \ref SCIP_STAGE_SOLVING
36969  */
36971  SCIP* scip /**< SCIP data structure */
36972  )
36973 {
36974  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrioChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36975 
36976  return SCIPtreeGetPrioChild(scip->tree);
36977 }
36978 
36979 /** gets the best sibling of the focus node w.r.t. the node selection priority assigned by the branching rule
36980  *
36981  * @return the best sibling of the focus node w.r.t. the node selection priority assigned by the branching rule
36982  *
36983  * @pre This method can be called if @p scip is in one of the following stages:
36984  * - \ref SCIP_STAGE_SOLVING
36985  */
36987  SCIP* scip /**< SCIP data structure */
36988  )
36989 {
36990  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrioSibling", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36991 
36992  return SCIPtreeGetPrioSibling(scip->tree);
36993 }
36994 
36995 /** gets the best child of the focus node w.r.t. the node selection strategy
36996  *
36997  * @return the best child of the focus node w.r.t. the node selection strategy
36998  *
36999  * @pre This method can be called if @p scip is in one of the following stages:
37000  * - \ref SCIP_STAGE_SOLVING
37001  */
37003  SCIP* scip /**< SCIP data structure */
37004  )
37005 {
37006  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37007 
37008  return SCIPtreeGetBestChild(scip->tree, scip->set);
37009 }
37010 
37011 /** gets the best sibling of the focus node w.r.t. the node selection strategy
37012  *
37013  * @return the best sibling of the focus node w.r.t. the node selection strategy
37014  *
37015  * @pre This method can be called if @p scip is in one of the following stages:
37016  * - \ref SCIP_STAGE_SOLVING
37017  */
37019  SCIP* scip /**< SCIP data structure */
37020  )
37021 {
37022  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestSibling", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37023 
37024  return SCIPtreeGetBestSibling(scip->tree, scip->set);
37025 }
37026 
37027 /** gets the best leaf from the node queue w.r.t. the node selection strategy
37028  *
37029  * @return the best leaf from the node queue w.r.t. the node selection strategy
37030  *
37031  * @pre This method can be called if @p scip is in one of the following stages:
37032  * - \ref SCIP_STAGE_SOLVING
37033  */
37035  SCIP* scip /**< SCIP data structure */
37036  )
37037 {
37038  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestLeaf", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37039 
37040  return SCIPtreeGetBestLeaf(scip->tree);
37041 }
37042 
37043 /** gets the best node from the tree (child, sibling, or leaf) w.r.t. the node selection strategy
37044  *
37045  * @return the best node from the tree (child, sibling, or leaf) w.r.t. the node selection strategy
37046  *
37047  * @pre This method can be called if @p scip is in one of the following stages:
37048  * - \ref SCIP_STAGE_SOLVING
37049  */
37051  SCIP* scip /**< SCIP data structure */
37052  )
37053 {
37054  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37055 
37056  return SCIPtreeGetBestNode(scip->tree, scip->set);
37057 }
37058 
37059 /** gets the node with smallest lower bound from the tree (child, sibling, or leaf)
37060  *
37061  * @return the node with smallest lower bound from the tree (child, sibling, or leaf)
37062  *
37063  * @pre This method can be called if @p scip is in one of the following stages:
37064  * - \ref SCIP_STAGE_SOLVING
37065  */
37067  SCIP* scip /**< SCIP data structure */
37068  )
37069 {
37070  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestboundNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37071 
37072  return SCIPtreeGetLowerboundNode(scip->tree, scip->set);
37073 }
37074 
37075 /** access to all data of open nodes (leaves, children, and siblings)
37076  *
37077  * @pre This method can be called if @p scip is in one of the following stages:
37078  * - \ref SCIP_STAGE_SOLVING
37079  */
37081  SCIP* scip, /**< SCIP data structure */
37082  SCIP_NODE*** leaves, /**< pointer to store the leaves, or NULL if not needed */
37083  SCIP_NODE*** children, /**< pointer to store the children, or NULL if not needed */
37084  SCIP_NODE*** siblings, /**< pointer to store the siblings, or NULL if not needed */
37085  int* nleaves, /**< pointer to store the number of leaves, or NULL */
37086  int* nchildren, /**< pointer to store the number of children, or NULL */
37087  int* nsiblings /**< pointer to store the number of siblings, or NULL */
37088  )
37089 {
37090  SCIP_CALL( checkStage(scip, "SCIPgetOpenNodesData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37091 
37092  if( leaves != NULL )
37093  *leaves = SCIPnodepqNodes(scip->tree->leaves);
37094  if( children != NULL )
37095  *children = scip->tree->children;
37096  if( siblings != NULL )
37097  *siblings = scip->tree->siblings;
37098  if( nleaves != NULL )
37099  *nleaves = SCIPnodepqLen(scip->tree->leaves);
37100  if( nchildren != NULL )
37101  *nchildren = SCIPtreeGetNChildren(scip->tree);
37102  if( nsiblings != NULL )
37103  *nsiblings = SCIPtreeGetNSiblings(scip->tree);
37104 
37105  return SCIP_OKAY;
37106 }
37107 
37108 /** cuts off node and whole sub tree from branch and bound tree
37109  *
37110  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37111  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37112  *
37113  * @pre This method can be called if @p scip is in one of the following stages:
37114  * - \ref SCIP_STAGE_SOLVING
37115  */
37117  SCIP* scip, /**< SCIP data structure */
37118  SCIP_NODE* node /**< node that should be cut off */
37119  )
37120 {
37121  SCIP_CALL( checkStage(scip, "SCIPcutoffNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37122 
37123  SCIP_CALL( SCIPnodeCutoff(node, scip->set, scip->stat, scip->tree, scip->reopt, scip->lp, scip->mem->probmem) );
37124 
37125  return SCIP_OKAY;
37126 }
37127 
37128 /** marks the given node to be propagated again the next time a node of its subtree is processed
37129  *
37130  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37131  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37132  *
37133  * @pre This method can be called if @p scip is in one of the following stages:
37134  * - \ref SCIP_STAGE_SOLVING
37135  */
37137  SCIP* scip, /**< SCIP data structure */
37138  SCIP_NODE* node /**< node that should be propagated again */
37139  )
37140 {
37141  SCIP_CALL( checkStage(scip, "SCIPrepropagateNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37142 
37143  SCIPnodePropagateAgain(node, scip->set, scip->stat, scip->tree);
37144 
37145  return SCIP_OKAY;
37146 }
37147 
37148 /** returns depth of first node in active path that is marked being cutoff
37149  *
37150  * @return depth of first node in active path that is marked being cutoff
37151  *
37152  * @pre This method can be called if @p scip is in one of the following stages:
37153  * - \ref SCIP_STAGE_SOLVING
37154  */
37156  SCIP* scip /**< SCIP data structure */
37157  )
37158 {
37159  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutoffdepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37160 
37161  return scip->tree->cutoffdepth;
37162 }
37163 
37164 /** returns depth of first node in active path that has to be propagated again
37165  *
37166  * @return depth of first node in active path that has to be propagated again
37167  *
37168  * @pre This method can be called if @p scip is in one of the following stages:
37169  * - \ref SCIP_STAGE_SOLVING
37170  */
37172  SCIP* scip /**< SCIP data structure */
37173  )
37174 {
37175  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRepropdepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37176 
37177  return scip->tree->repropdepth;
37178 }
37179 
37180 /** prints all branching decisions on variables from the root to the given node
37181  *
37182  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37183  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37184  *
37185  * @pre This method can be called if @p scip is in one of the following stages:
37186  * - \ref SCIP_STAGE_SOLVING
37187  */
37189  SCIP* scip, /**< SCIP data structure */
37190  SCIP_NODE* node, /**< node data */
37191  FILE* file /**< output file (or NULL for standard output) */
37192  )
37193 {
37194  SCIP_VAR** branchvars; /* array of variables on which the branchings has been performed in all ancestors */
37195  SCIP_Real* branchbounds; /* array of bounds which the branchings in all ancestors set */
37196  SCIP_BOUNDTYPE* boundtypes; /* array of boundtypes which the branchings in all ancestors set */
37197  int* nodeswitches; /* marks, where in the arrays the branching decisions of the next node on the path start
37198  * branchings performed at the parent of node always start at position 0. For single variable branching,
37199  * nodeswitches[i] = i holds */
37200  int nbranchvars; /* number of variables on which branchings have been performed in all ancestors
37201  * if this is larger than the array size, arrays should be reallocated and method should be called again */
37202  int branchvarssize; /* available slots in arrays */
37203  int nnodes; /* number of nodes in the nodeswitch array */
37204  int nodeswitchsize; /* available slots in node switch array */
37205 
37206  branchvarssize = SCIPnodeGetDepth(node);
37207  nodeswitchsize = branchvarssize;
37208 
37209  /* memory allocation */
37210  SCIP_CALL( SCIPallocBufferArray(scip, &branchvars, branchvarssize) );
37211  SCIP_CALL( SCIPallocBufferArray(scip, &branchbounds, branchvarssize) );
37212  SCIP_CALL( SCIPallocBufferArray(scip, &boundtypes, branchvarssize) );
37213  SCIP_CALL( SCIPallocBufferArray(scip, &nodeswitches, nodeswitchsize) );
37214 
37215  SCIPnodeGetAncestorBranchingPath(node, branchvars, branchbounds, boundtypes, &nbranchvars, branchvarssize, nodeswitches, &nnodes, nodeswitchsize );
37216 
37217  /* if the arrays were to small, we have to reallocate them and recall SCIPnodeGetAncestorBranchingPath */
37218  if( nbranchvars > branchvarssize || nnodes > nodeswitchsize )
37219  {
37220  branchvarssize = nbranchvars;
37221  nodeswitchsize = nnodes;
37222 
37223  /* memory reallocation */
37224  SCIP_CALL( SCIPreallocBufferArray(scip, &branchvars, branchvarssize) );
37225  SCIP_CALL( SCIPreallocBufferArray(scip, &branchbounds, branchvarssize) );
37226  SCIP_CALL( SCIPreallocBufferArray(scip, &boundtypes, branchvarssize) );
37227  SCIP_CALL( SCIPreallocBufferArray(scip, &nodeswitches, nodeswitchsize) );
37228 
37229  SCIPnodeGetAncestorBranchingPath(node, branchvars, branchbounds, boundtypes, &nbranchvars, branchvarssize, nodeswitches, &nnodes, nodeswitchsize);
37230  assert(nbranchvars == branchvarssize);
37231  }
37232 
37233  /* we only want to create output, if branchings were performed */
37234  if( nbranchvars >= 1 )
37235  {
37236  int i;
37237  int j;
37238 
37239  /* print all nodes, starting from the root, which is last in the arrays */
37240  for( j = nnodes-1; j >= 0; --j)
37241  {
37242  int end;
37243  if(j == nnodes-1)
37244  end = nbranchvars;
37245  else
37246  end = nodeswitches[j+1];
37247 
37248  for( i = nodeswitches[j]; i < end; ++i )
37249  {
37250  if( i > nodeswitches[j] )
37251  SCIPmessageFPrintInfo(scip->messagehdlr, file, " AND ");
37252  SCIPmessageFPrintInfo(scip->messagehdlr, file, "<%s> %s %.1f",SCIPvarGetName(branchvars[i]), boundtypes[i] == SCIP_BOUNDTYPE_LOWER ? ">=" : "<=", branchbounds[i]);
37253  }
37254  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
37255  if( j > 0 )
37256  {
37257  if( nodeswitches[j]-nodeswitches[j-1] != 1 )
37258  SCIPmessageFPrintInfo(scip->messagehdlr, file, " |\n |\n");
37259  else if( boundtypes[i-1] == SCIP_BOUNDTYPE_LOWER )
37260  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\\ \n \\\n");
37261  else
37262  SCIPmessageFPrintInfo(scip->messagehdlr, file, " /\n/ \n");
37263  }
37264  }
37265  }
37266 
37267  /* free all local memory */
37268  SCIPfreeBufferArray(scip, &nodeswitches);
37269  SCIPfreeBufferArray(scip, &boundtypes);
37270  SCIPfreeBufferArray(scip, &branchbounds);
37271  SCIPfreeBufferArray(scip, &branchvars);
37272 
37273  return SCIP_OKAY;
37274 }
37275 
37276 /** sets whether the LP should be solved at the focus node
37277  *
37278  * @note In order to have an effect, this method needs to be called after a node is focused but before the LP is
37279  * solved.
37280  *
37281  * @pre This method can be called if @p scip is in one of the following stages:
37282  * - \ref SCIP_STAGE_SOLVING
37283  */
37285  SCIP* scip, /**< SCIP data structure */
37286  SCIP_Bool solvelp /**< should the LP be solved? */
37287  )
37288 {
37289  SCIP_CALL_ABORT( checkStage(scip, "SCIPsetFocusnodeLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37290 
37291  SCIPtreeSetFocusNodeLP(scip->tree, solvelp);
37292 }
37293 
37294 
37295 
37296 /*
37297  * statistic methods
37298  */
37299 
37300 /** gets number of branch and bound runs performed, including the current run
37301  *
37302  * @return the number of branch and bound runs performed, including the current run
37303  *
37304  * @pre This method can be called if SCIP is in one of the following stages:
37305  * - \ref SCIP_STAGE_PROBLEM
37306  * - \ref SCIP_STAGE_TRANSFORMING
37307  * - \ref SCIP_STAGE_TRANSFORMED
37308  * - \ref SCIP_STAGE_INITPRESOLVE
37309  * - \ref SCIP_STAGE_PRESOLVING
37310  * - \ref SCIP_STAGE_EXITPRESOLVE
37311  * - \ref SCIP_STAGE_PRESOLVED
37312  * - \ref SCIP_STAGE_INITSOLVE
37313  * - \ref SCIP_STAGE_SOLVING
37314  * - \ref SCIP_STAGE_SOLVED
37315  * - \ref SCIP_STAGE_EXITSOLVE
37316  * - \ref SCIP_STAGE_FREETRANS
37317  */
37319  SCIP* scip /**< SCIP data structure */
37320  )
37321 {
37322  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRuns", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
37323 
37324  return scip->stat->nruns;
37325 }
37326 
37327 /** gets number of reoptimization runs performed, including the current run
37328  *
37329  * @return the number of reoptimization runs performed, including the current run
37330  *
37331  * @pre This method can be called if SCIP is in one of the following stages:
37332  * - \ref SCIP_STAGE_PROBLEM
37333  * - \ref SCIP_STAGE_TRANSFORMING
37334  * - \ref SCIP_STAGE_TRANSFORMED
37335  * - \ref SCIP_STAGE_INITPRESOLVE
37336  * - \ref SCIP_STAGE_PRESOLVING
37337  * - \ref SCIP_STAGE_EXITPRESOLVE
37338  * - \ref SCIP_STAGE_PRESOLVED
37339  * - \ref SCIP_STAGE_INITSOLVE
37340  * - \ref SCIP_STAGE_SOLVING
37341  * - \ref SCIP_STAGE_SOLVED
37342  * - \ref SCIP_STAGE_EXITSOLVE
37343  * - \ref SCIP_STAGE_FREETRANS
37344  */
37346  SCIP* scip /**< SCIP data structure */
37347  )
37348 {
37349  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNReoptRuns", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
37350 
37351  return scip->stat->nreoptruns;
37352 }
37353 
37354 /** gets number of processed nodes in current run, including the focus node
37355  *
37356  * @return the number of processed nodes in current run, including the focus node
37357  *
37358  * @pre This method can be called if SCIP is in one of the following stages:
37359  * - \ref SCIP_STAGE_PROBLEM
37360  * - \ref SCIP_STAGE_TRANSFORMING
37361  * - \ref SCIP_STAGE_TRANSFORMED
37362  * - \ref SCIP_STAGE_INITPRESOLVE
37363  * - \ref SCIP_STAGE_PRESOLVING
37364  * - \ref SCIP_STAGE_EXITPRESOLVE
37365  * - \ref SCIP_STAGE_PRESOLVED
37366  * - \ref SCIP_STAGE_INITSOLVE
37367  * - \ref SCIP_STAGE_SOLVING
37368  * - \ref SCIP_STAGE_SOLVED
37369  * - \ref SCIP_STAGE_EXITSOLVE
37370  * - \ref SCIP_STAGE_FREETRANS
37371  */
37373  SCIP* scip /**< SCIP data structure */
37374  )
37375 {
37376  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
37377 
37378  return scip->stat->nnodes;
37379 }
37380 
37381 /** gets total number of processed nodes in all runs, including the focus node
37382  *
37383  * @return the total number of processed nodes in all runs, including the focus node
37384  *
37385  * @pre This method can be called if SCIP is in one of the following stages:
37386  * - \ref SCIP_STAGE_PROBLEM
37387  * - \ref SCIP_STAGE_TRANSFORMING
37388  * - \ref SCIP_STAGE_TRANSFORMED
37389  * - \ref SCIP_STAGE_INITPRESOLVE
37390  * - \ref SCIP_STAGE_PRESOLVING
37391  * - \ref SCIP_STAGE_EXITPRESOLVE
37392  * - \ref SCIP_STAGE_PRESOLVED
37393  * - \ref SCIP_STAGE_INITSOLVE
37394  * - \ref SCIP_STAGE_SOLVING
37395  * - \ref SCIP_STAGE_SOLVED
37396  * - \ref SCIP_STAGE_EXITSOLVE
37397  * - \ref SCIP_STAGE_FREETRANS
37398  */
37400  SCIP* scip /**< SCIP data structure */
37401  )
37402 {
37403  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNTotalNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
37404 
37405  return scip->stat->ntotalnodes;
37406 }
37407 
37408 /** gets number of nodes left in the tree (children + siblings + leaves)
37409  *
37410  * @return the number of nodes left in the tree (children + siblings + leaves)
37411  *
37412  * @pre This method can be called if SCIP is in one of the following stages:
37413  * - \ref SCIP_STAGE_PRESOLVED
37414  * - \ref SCIP_STAGE_SOLVING
37415  * - \ref SCIP_STAGE_SOLVED
37416  */
37418  SCIP* scip /**< SCIP data structure */
37419  )
37420 {
37421  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodesLeft", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37422 
37423  return SCIPtreeGetNNodes(scip->tree);
37424 }
37425 
37426 /** gets total number of LPs solved so far
37427  *
37428  * @return the total number of LPs solved so far
37429  *
37430  * @pre This method can be called if SCIP is in one of the following stages:
37431  * - \ref SCIP_STAGE_PRESOLVED
37432  * - \ref SCIP_STAGE_SOLVING
37433  * - \ref SCIP_STAGE_SOLVED
37434  */
37436  SCIP* scip /**< SCIP data structure */
37437  )
37438 {
37439  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37440 
37441  return scip->stat->nlps;
37442 }
37443 
37444 /** gets total number of iterations used so far in primal and dual simplex and barrier algorithm
37445  *
37446  * @return the total number of iterations used so far in primal and dual simplex and barrier algorithm
37447  *
37448  * @pre This method can be called if SCIP is in one of the following stages:
37449  * - \ref SCIP_STAGE_PRESOLVING
37450  * - \ref SCIP_STAGE_PRESOLVED
37451  * - \ref SCIP_STAGE_SOLVING
37452  * - \ref SCIP_STAGE_SOLVED
37453  */
37455  SCIP* scip /**< SCIP data structure */
37456  )
37457 {
37458  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37459 
37460  return scip->stat->nlpiterations;
37461 }
37462 
37463 /** gets total number of iterations used so far in primal and dual simplex and barrier algorithm for the root node
37464  *
37465  * @return the total number of iterations used so far in primal and dual simplex and barrier algorithm for the root node
37466  *
37467  * @pre This method can be called if SCIP is in one of the following stages:
37468  * - \ref SCIP_STAGE_PRESOLVED
37469  * - \ref SCIP_STAGE_SOLVING
37470  * - \ref SCIP_STAGE_SOLVED
37471  */
37473  SCIP* scip /**< SCIP data structure */
37474  )
37475 {
37476  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37477 
37478  return scip->stat->nrootlpiterations;
37479 }
37480 
37481 /** gets total number of iterations used in primal and dual simplex and barrier algorithm for the first LP at the root
37482  * node
37483  *
37484  * @return the total number of iterations used in primal and dual simplex and barrier algorithm for the first root LP
37485  *
37486  * @pre This method can be called if SCIP is in one of the following stages:
37487  * - \ref SCIP_STAGE_PRESOLVED
37488  * - \ref SCIP_STAGE_SOLVING
37489  * - \ref SCIP_STAGE_SOLVED
37490  */
37492  SCIP* scip /**< SCIP data structure */
37493  )
37494 {
37495  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootFirstLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37496 
37497  return scip->stat->nrootfirstlpiterations;
37498 }
37499 
37500 /** gets total number of primal LPs solved so far
37501  *
37502  * @return the total number of primal LPs solved so far
37503  *
37504  * @pre This method can be called if SCIP is in one of the following stages:
37505  * - \ref SCIP_STAGE_PRESOLVED
37506  * - \ref SCIP_STAGE_SOLVING
37507  * - \ref SCIP_STAGE_SOLVED
37508  */
37510  SCIP* scip /**< SCIP data structure */
37511  )
37512 {
37513  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37514 
37515  return scip->stat->nprimallps;
37516 }
37517 
37518 /** gets total number of iterations used so far in primal simplex
37519  *
37520  * @return total number of iterations used so far in primal simplex
37521  *
37522  * @pre This method can be called if SCIP is in one of the following stages:
37523  * - \ref SCIP_STAGE_PRESOLVED
37524  * - \ref SCIP_STAGE_SOLVING
37525  * - \ref SCIP_STAGE_SOLVED
37526  */
37528  SCIP* scip /**< SCIP data structure */
37529  )
37530 {
37531  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37532 
37533  return scip->stat->nprimallpiterations;
37534 }
37535 
37536 /** gets total number of dual LPs solved so far
37537  *
37538  * @return the total number of dual LPs solved so far
37539  *
37540  * @pre This method can be called if SCIP is in one of the following stages:
37541  * - \ref SCIP_STAGE_PRESOLVED
37542  * - \ref SCIP_STAGE_SOLVING
37543  * - \ref SCIP_STAGE_SOLVED
37544  */
37546  SCIP* scip /**< SCIP data structure */
37547  )
37548 {
37549  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37550 
37551  return scip->stat->nduallps;
37552 }
37553 
37554 /** gets total number of iterations used so far in dual simplex
37555  *
37556  * @return the total number of iterations used so far in dual simplex
37557  *
37558  * @pre This method can be called if SCIP is in one of the following stages:
37559  * - \ref SCIP_STAGE_PRESOLVED
37560  * - \ref SCIP_STAGE_SOLVING
37561  * - \ref SCIP_STAGE_SOLVED
37562  */
37564  SCIP* scip /**< SCIP data structure */
37565  )
37566 {
37567  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37568 
37569  return scip->stat->nduallpiterations;
37570 }
37571 
37572 /** gets total number of barrier LPs solved so far
37573  *
37574  * @return the total number of barrier LPs solved so far
37575  *
37576  * @pre This method can be called if SCIP is in one of the following stages:
37577  * - \ref SCIP_STAGE_PRESOLVED
37578  * - \ref SCIP_STAGE_SOLVING
37579  * - \ref SCIP_STAGE_SOLVED
37580  */
37582  SCIP* scip /**< SCIP data structure */
37583  )
37584 {
37585  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBarrierLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37586 
37587  return scip->stat->nbarrierlps;
37588 }
37589 
37590 /** gets total number of iterations used so far in barrier algorithm
37591  *
37592  * @return the total number of iterations used so far in barrier algorithm
37593  *
37594  * @pre This method can be called if SCIP is in one of the following stages:
37595  * - \ref SCIP_STAGE_PRESOLVED
37596  * - \ref SCIP_STAGE_SOLVING
37597  * - \ref SCIP_STAGE_SOLVED
37598  */
37600  SCIP* scip /**< SCIP data structure */
37601  )
37602 {
37603  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBarrierLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37604 
37605  return scip->stat->nbarrierlpiterations;
37606 }
37607 
37608 /** gets total number of LPs solved so far that were resolved from an advanced start basis
37609  *
37610  * @return the total number of LPs solved so far that were resolved from an advanced start basis
37611  *
37612  * @pre This method can be called if SCIP is in one of the following stages:
37613  * - \ref SCIP_STAGE_PRESOLVED
37614  * - \ref SCIP_STAGE_SOLVING
37615  * - \ref SCIP_STAGE_SOLVED
37616  */
37618  SCIP* scip /**< SCIP data structure */
37619  )
37620 {
37621  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37622 
37623  return scip->stat->nprimalresolvelps + scip->stat->ndualresolvelps;
37624 }
37625 
37626 /** gets total number of simplex iterations used so far in primal and dual simplex calls where an advanced start basis
37627  * was available
37628  *
37629  * @return the total number of simplex iterations used so far in primal and dual simplex calls where an advanced start
37630  * basis was available
37631  *
37632  * @pre This method can be called if SCIP is in one of the following stages:
37633  * - \ref SCIP_STAGE_PRESOLVED
37634  * - \ref SCIP_STAGE_SOLVING
37635  * - \ref SCIP_STAGE_SOLVED
37636  */
37638  SCIP* scip /**< SCIP data structure */
37639  )
37640 {
37641  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37642 
37644 }
37645 
37646 /** gets total number of primal LPs solved so far that were resolved from an advanced start basis
37647  *
37648  * @return the total number of primal LPs solved so far that were resolved from an advanced start basis
37649  *
37650  * @pre This method can be called if SCIP is in one of the following stages:
37651  * - \ref SCIP_STAGE_PRESOLVED
37652  * - \ref SCIP_STAGE_SOLVING
37653  * - \ref SCIP_STAGE_SOLVED
37654  */
37656  SCIP* scip /**< SCIP data structure */
37657  )
37658 {
37659  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37660 
37661  return scip->stat->nprimalresolvelps;
37662 }
37663 
37664 /** gets total number of simplex iterations used so far in primal simplex calls where an advanced start basis
37665  * was available
37666  *
37667  * @return the total number of simplex iterations used so far in primal simplex calls where an advanced start
37668  * basis was available
37669  *
37670  * @pre This method can be called if SCIP is in one of the following stages:
37671  * - \ref SCIP_STAGE_PRESOLVED
37672  * - \ref SCIP_STAGE_SOLVING
37673  * - \ref SCIP_STAGE_SOLVED
37674  */
37676  SCIP* scip /**< SCIP data structure */
37677  )
37678 {
37679  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37680 
37681  return scip->stat->nprimalresolvelpiterations;
37682 }
37683 
37684 /** gets total number of dual LPs solved so far that were resolved from an advanced start basis
37685  *
37686  * @return the total number of dual LPs solved so far that were resolved from an advanced start basis
37687  *
37688  * @pre This method can be called if SCIP is in one of the following stages:
37689  * - \ref SCIP_STAGE_PRESOLVED
37690  * - \ref SCIP_STAGE_SOLVING
37691  * - \ref SCIP_STAGE_SOLVED
37692  */
37694  SCIP* scip /**< SCIP data structure */
37695  )
37696 {
37697  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37698 
37699  return scip->stat->ndualresolvelps;
37700 }
37701 
37702 /** gets total number of simplex iterations used so far in dual simplex calls where an advanced start basis
37703  * was available
37704  *
37705  * @return the total number of simplex iterations used so far in dual simplex calls where an advanced start
37706  * basis was available
37707  *
37708  * @pre This method can be called if SCIP is in one of the following stages:
37709  * - \ref SCIP_STAGE_PRESOLVED
37710  * - \ref SCIP_STAGE_SOLVING
37711  * - \ref SCIP_STAGE_SOLVED
37712  */
37714  SCIP* scip /**< SCIP data structure */
37715  )
37716 {
37717  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37718 
37719  return scip->stat->ndualresolvelpiterations;
37720 }
37721 
37722 /** gets total number of LPs solved so far for node relaxations
37723  *
37724  * @return the total number of LPs solved so far for node relaxations
37725  *
37726  * @pre This method can be called if SCIP is in one of the following stages:
37727  * - \ref SCIP_STAGE_PRESOLVED
37728  * - \ref SCIP_STAGE_SOLVING
37729  * - \ref SCIP_STAGE_SOLVED
37730  */
37732  SCIP* scip /**< SCIP data structure */
37733  )
37734 {
37735  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37736 
37737  return scip->stat->nnodelps;
37738 }
37739 
37740 /** gets total number of simplex iterations used so far for node relaxations
37741  *
37742  * @return the total number of simplex iterations used so far for node relaxations
37743  *
37744  * @pre This method can be called if SCIP is in one of the following stages:
37745  * - \ref SCIP_STAGE_PRESOLVED
37746  * - \ref SCIP_STAGE_SOLVING
37747  * - \ref SCIP_STAGE_SOLVED
37748  */
37750  SCIP* scip /**< SCIP data structure */
37751  )
37752 {
37753  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37754 
37755  return scip->stat->nnodelpiterations;
37756 }
37757 
37758 /** gets total number of LPs solved so far for initial LP in node relaxations
37759  *
37760  * @return the total number of LPs solved so far for initial LP in node relaxations
37761  *
37762  * @pre This method can be called if SCIP is in one of the following stages:
37763  * - \ref SCIP_STAGE_PRESOLVED
37764  * - \ref SCIP_STAGE_SOLVING
37765  * - \ref SCIP_STAGE_SOLVED
37766  */
37768  SCIP* scip /**< SCIP data structure */
37769  )
37770 {
37771  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeInitLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37772 
37773  return scip->stat->ninitlps;
37774 }
37775 
37776 /** gets total number of simplex iterations used so far for initial LP in node relaxations
37777  *
37778  * @return the total number of simplex iterations used so far for initial LP in node relaxations
37779  *
37780  * @pre This method can be called if SCIP is in one of the following stages:
37781  * - \ref SCIP_STAGE_PRESOLVED
37782  * - \ref SCIP_STAGE_SOLVING
37783  * - \ref SCIP_STAGE_SOLVED
37784  */
37786  SCIP* scip /**< SCIP data structure */
37787  )
37788 {
37789  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeInitLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37790 
37791  return scip->stat->ninitlpiterations;
37792 }
37793 
37794 /** gets total number of LPs solved so far during diving and probing
37795  *
37796  * @return total number of LPs solved so far during diving and probing
37797  *
37798  * @pre This method can be called if SCIP is in one of the following stages:
37799  * - \ref SCIP_STAGE_PRESOLVED
37800  * - \ref SCIP_STAGE_SOLVING
37801  * - \ref SCIP_STAGE_SOLVED
37802  */
37804  SCIP* scip /**< SCIP data structure */
37805  )
37806 {
37807  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDivingLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37808 
37809  return scip->stat->ndivinglps;
37810 }
37811 
37812 /** gets total number of simplex iterations used so far during diving and probing
37813  *
37814  * @return the total number of simplex iterations used so far during diving and probing
37815  *
37816  * @pre This method can be called if SCIP is in one of the following stages:
37817  * - \ref SCIP_STAGE_PRESOLVED
37818  * - \ref SCIP_STAGE_SOLVING
37819  * - \ref SCIP_STAGE_SOLVED
37820  */
37822  SCIP* scip /**< SCIP data structure */
37823  )
37824 {
37825  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDivingLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37826 
37827  return scip->stat->ndivinglpiterations;
37828 }
37829 
37830 /** gets total number of times, strong branching was called (each call represents solving two LPs)
37831  *
37832  * @return the total number of times, strong branching was called (each call represents solving two LPs)
37833  *
37834  * @pre This method can be called if SCIP is in one of the following stages:
37835  * - \ref SCIP_STAGE_PRESOLVED
37836  * - \ref SCIP_STAGE_SOLVING
37837  * - \ref SCIP_STAGE_SOLVED
37838  */
37840  SCIP* scip /**< SCIP data structure */
37841  )
37842 {
37843  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNStrongbranchs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37844 
37845  return scip->stat->nstrongbranchs;
37846 }
37847 
37848 /** gets total number of simplex iterations used so far in strong branching
37849  *
37850  * @return the total number of simplex iterations used so far in strong branching
37851  *
37852  * @pre This method can be called if SCIP is in one of the following stages:
37853  * - \ref SCIP_STAGE_PRESOLVED
37854  * - \ref SCIP_STAGE_SOLVING
37855  * - \ref SCIP_STAGE_SOLVED
37856  */
37858  SCIP* scip /**< SCIP data structure */
37859  )
37860 {
37861  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNStrongbranchLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37862 
37863  return scip->stat->nsblpiterations;
37864 }
37865 
37866 /** gets total number of times, strong branching was called at the root node (each call represents solving two LPs)
37867  *
37868  * @return the total number of times, strong branching was called at the root node (each call represents solving two LPs)
37869  *
37870  * @pre This method can be called if SCIP is in one of the following stages:
37871  * - \ref SCIP_STAGE_PRESOLVED
37872  * - \ref SCIP_STAGE_SOLVING
37873  * - \ref SCIP_STAGE_SOLVED
37874  */
37876  SCIP* scip /**< SCIP data structure */
37877  )
37878 {
37879  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootStrongbranchs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37880 
37881  return scip->stat->nrootstrongbranchs;
37882 }
37883 
37884 /** gets total number of simplex iterations used so far in strong branching at the root node
37885  *
37886  * @return the total number of simplex iterations used so far in strong branching at the root node
37887  *
37888  * @pre This method can be called if SCIP is in one of the following stages:
37889  * - \ref SCIP_STAGE_PRESOLVED
37890  * - \ref SCIP_STAGE_SOLVING
37891  * - \ref SCIP_STAGE_SOLVED
37892  */
37894  SCIP* scip /**< SCIP data structure */
37895  )
37896 {
37897  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootStrongbranchLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37898 
37899  return scip->stat->nrootsblpiterations;
37900 }
37901 
37902 /** gets number of pricing rounds performed so far at the current node
37903  *
37904  * @return the number of pricing rounds performed so far at the current node
37905  *
37906  * @pre This method can be called if SCIP is in one of the following stages:
37907  * - \ref SCIP_STAGE_SOLVING
37908  */
37910  SCIP* scip /**< SCIP data structure */
37911  )
37912 {
37913  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPriceRounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37914 
37915  return scip->stat->npricerounds;
37916 }
37917 
37918 /** get current number of variables in the pricing store
37919  *
37920  * @return the current number of variables in the pricing store
37921  *
37922  * @pre This method can be called if SCIP is in one of the following stages:
37923  * - \ref SCIP_STAGE_PRESOLVED
37924  * - \ref SCIP_STAGE_SOLVING
37925  * - \ref SCIP_STAGE_SOLVED
37926  */
37928  SCIP* scip /**< SCIP data structure */
37929  )
37930 {
37931  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37932 
37933  return SCIPpricestoreGetNVars(scip->pricestore);
37934 }
37935 
37936 /** get total number of pricing variables found so far
37937  *
37938  * @return the total number of pricing variables found so far
37939  *
37940  * @pre This method can be called if SCIP is in one of the following stages:
37941  * - \ref SCIP_STAGE_PRESOLVED
37942  * - \ref SCIP_STAGE_SOLVING
37943  * - \ref SCIP_STAGE_SOLVED
37944  */
37946  SCIP* scip /**< SCIP data structure */
37947  )
37948 {
37949  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevarsFound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37950 
37952 }
37953 
37954 /** get total number of pricing variables applied to the LPs
37955  *
37956  * @return the total number of pricing variables applied to the LPs
37957  *
37958  * @pre This method can be called if SCIP is in one of the following stages:
37959  * - \ref SCIP_STAGE_PRESOLVED
37960  * - \ref SCIP_STAGE_SOLVING
37961  * - \ref SCIP_STAGE_SOLVED
37962  */
37964  SCIP* scip /**< SCIP data structure */
37965  )
37966 {
37967  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevarsApplied", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37968 
37970 }
37971 
37972 /** gets number of separation rounds performed so far at the current node
37973  *
37974  * @return the number of separation rounds performed so far at the current node
37975  *
37976  * @pre This method can be called if SCIP is in one of the following stages:
37977  * - \ref SCIP_STAGE_SOLVING
37978  */
37980  SCIP* scip /**< SCIP data structure */
37981  )
37982 {
37983  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSepaRounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37984 
37985  return scip->stat->nseparounds;
37986 }
37987 
37988 /** get total number of cuts found so far
37989  *
37990  * @return the total number of cuts found so far
37991  *
37992  * @pre This method can be called if SCIP is in one of the following stages:
37993  * - \ref SCIP_STAGE_PRESOLVED
37994  * - \ref SCIP_STAGE_SOLVING
37995  * - \ref SCIP_STAGE_SOLVED
37996  */
37998  SCIP* scip /**< SCIP data structure */
37999  )
38000 {
38001  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsFound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38002 
38003  return SCIPsepastoreGetNCutsFound(scip->sepastore);
38004 }
38005 
38006 /** get number of cuts found so far in current separation round
38007  *
38008  * @return the number of cuts found so far in current separation round
38009  *
38010  * @pre This method can be called if SCIP is in one of the following stages:
38011  * - \ref SCIP_STAGE_PRESOLVED
38012  * - \ref SCIP_STAGE_SOLVING
38013  * - \ref SCIP_STAGE_SOLVED
38014  */
38016  SCIP* scip /**< SCIP data structure */
38017  )
38018 {
38019  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsFoundRound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38020 
38022 }
38023 
38024 /** get total number of cuts applied to the LPs
38025  *
38026  * @return the total number of cuts applied to the LPs
38027  *
38028  * @pre This method can be called if SCIP is in one of the following stages:
38029  * - \ref SCIP_STAGE_PRESOLVED
38030  * - \ref SCIP_STAGE_SOLVING
38031  * - \ref SCIP_STAGE_SOLVED
38032  */
38034  SCIP* scip /**< SCIP data structure */
38035  )
38036 {
38037  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsApplied", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38038 
38040 }
38041 
38042 /** get total number of constraints found in conflict analysis (conflict and reconvergence constraints)
38043  *
38044  * @return the total number of constraints found in conflict analysis (conflict and reconvergence constraints)
38045  *
38046  * @pre This method can be called if SCIP is in one of the following stages:
38047  * - \ref SCIP_STAGE_TRANSFORMED
38048  * - \ref SCIP_STAGE_INITPRESOLVE
38049  * - \ref SCIP_STAGE_PRESOLVING
38050  * - \ref SCIP_STAGE_EXITPRESOLVE
38051  * - \ref SCIP_STAGE_PRESOLVED
38052  * - \ref SCIP_STAGE_INITSOLVE
38053  * - \ref SCIP_STAGE_SOLVING
38054  * - \ref SCIP_STAGE_SOLVED
38055  * - \ref SCIP_STAGE_EXITSOLVE
38056  */
38058  SCIP* scip /**< SCIP data structure */
38059  )
38060 {
38061  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38062 
38073 }
38074 
38075 /** get number of conflict constraints found so far at the current node
38076  *
38077  * @return the number of conflict constraints found so far at the current node
38078  *
38079  * @pre This method can be called if SCIP is in one of the following stages:
38080  * - \ref SCIP_STAGE_TRANSFORMED
38081  * - \ref SCIP_STAGE_INITPRESOLVE
38082  * - \ref SCIP_STAGE_PRESOLVING
38083  * - \ref SCIP_STAGE_EXITPRESOLVE
38084  * - \ref SCIP_STAGE_PRESOLVED
38085  * - \ref SCIP_STAGE_INITSOLVE
38086  * - \ref SCIP_STAGE_SOLVING
38087  * - \ref SCIP_STAGE_SOLVED
38088  * - \ref SCIP_STAGE_EXITSOLVE
38089  */
38091  SCIP* scip /**< SCIP data structure */
38092  )
38093 {
38094  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssFoundNode", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38095 
38096  return SCIPconflictGetNConflicts(scip->conflict);
38097 }
38098 
38099 /** get total number of conflict constraints added to the problem
38100  *
38101  * @return the total number of conflict constraints added to the problem
38102  *
38103  * @pre This method can be called if SCIP is in one of the following stages:
38104  * - \ref SCIP_STAGE_TRANSFORMED
38105  * - \ref SCIP_STAGE_INITPRESOLVE
38106  * - \ref SCIP_STAGE_PRESOLVING
38107  * - \ref SCIP_STAGE_EXITPRESOLVE
38108  * - \ref SCIP_STAGE_PRESOLVED
38109  * - \ref SCIP_STAGE_INITSOLVE
38110  * - \ref SCIP_STAGE_SOLVING
38111  * - \ref SCIP_STAGE_SOLVED
38112  * - \ref SCIP_STAGE_EXITSOLVE
38113  */
38115  SCIP* scip /**< SCIP data structure */
38116  )
38117 {
38118  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssApplied", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38119 
38120  return SCIPconflictGetNAppliedConss(scip->conflict);
38121 }
38122 
38123 /** gets depth of current node, or -1 if no current node exists; in probing, the current node is the last probing node,
38124  * such that the depth includes the probing path
38125  *
38126  * @return the depth of current node, or -1 if no current node exists; in probing, the current node is the last probing node,
38127  * such that the depth includes the probing path
38128  *
38129  * @pre This method can be called if SCIP is in one of the following stages:
38130  * - \ref SCIP_STAGE_TRANSFORMED
38131  * - \ref SCIP_STAGE_INITPRESOLVE
38132  * - \ref SCIP_STAGE_PRESOLVING
38133  * - \ref SCIP_STAGE_EXITPRESOLVE
38134  * - \ref SCIP_STAGE_PRESOLVED
38135  * - \ref SCIP_STAGE_INITSOLVE
38136  * - \ref SCIP_STAGE_SOLVING
38137  * - \ref SCIP_STAGE_SOLVED
38138  * - \ref SCIP_STAGE_EXITSOLVE
38139  */
38141  SCIP* scip /**< SCIP data structure */
38142  )
38143 {
38144  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38145 
38146  return SCIPtreeGetCurrentDepth(scip->tree);
38147 }
38148 
38149 /** gets depth of the focus node, or -1 if no focus node exists; the focus node is the currently processed node in the
38150  * branching tree, excluding the nodes of the probing path
38151  *
38152  * @return the depth of the focus node, or -1 if no focus node exists; the focus node is the currently processed node in the
38153  * branching tree, excluding the nodes of the probing path
38154  *
38155  * @pre This method can be called if SCIP is in one of the following stages:
38156  * - \ref SCIP_STAGE_TRANSFORMED
38157  * - \ref SCIP_STAGE_INITPRESOLVE
38158  * - \ref SCIP_STAGE_PRESOLVING
38159  * - \ref SCIP_STAGE_EXITPRESOLVE
38160  * - \ref SCIP_STAGE_PRESOLVED
38161  * - \ref SCIP_STAGE_INITSOLVE
38162  * - \ref SCIP_STAGE_SOLVING
38163  * - \ref SCIP_STAGE_SOLVED
38164  * - \ref SCIP_STAGE_EXITSOLVE
38165  */
38167  SCIP* scip /**< SCIP data structure */
38168  )
38169 {
38170  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFocusDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38171 
38172  return SCIPtreeGetFocusDepth(scip->tree);
38173 }
38174 
38175 /** gets maximal allowed tree depth
38176  *
38177  * @return gets maximal allowed tree depth
38178  *
38179  * @pre This method can be called if SCIP is in one of the following stages:
38180  * - \ref SCIP_STAGE_TRANSFORMED
38181  * - \ref SCIP_STAGE_INITPRESOLVE
38182  * - \ref SCIP_STAGE_PRESOLVING
38183  * - \ref SCIP_STAGE_EXITPRESOLVE
38184  * - \ref SCIP_STAGE_PRESOLVED
38185  * - \ref SCIP_STAGE_INITSOLVE
38186  * - \ref SCIP_STAGE_SOLVING
38187  * - \ref SCIP_STAGE_SOLVED
38188  * - \ref SCIP_STAGE_EXITSOLVE
38189  */
38191  SCIP* scip /**< SCIP data structure */
38192  )
38193 {
38194  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDepthLimit", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38195 
38196  return SCIPtreeGetDepthLimit(scip->tree);
38197 }
38198 
38199 /** gets maximal depth of all processed nodes in current branch and bound run (excluding probing nodes)
38200  *
38201  * @return the maximal depth of all processed nodes in current branch and bound run (excluding probing nodes)
38202  *
38203  * @pre This method can be called if SCIP is in one of the following stages:
38204  * - \ref SCIP_STAGE_TRANSFORMED
38205  * - \ref SCIP_STAGE_INITPRESOLVE
38206  * - \ref SCIP_STAGE_PRESOLVING
38207  * - \ref SCIP_STAGE_EXITPRESOLVE
38208  * - \ref SCIP_STAGE_PRESOLVED
38209  * - \ref SCIP_STAGE_INITSOLVE
38210  * - \ref SCIP_STAGE_SOLVING
38211  * - \ref SCIP_STAGE_SOLVED
38212  * - \ref SCIP_STAGE_EXITSOLVE
38213  */
38215  SCIP* scip /**< SCIP data structure */
38216  )
38217 {
38218  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetMaxDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38219 
38220  return scip->stat->maxdepth;
38221 }
38222 
38223 /** gets maximal depth of all processed nodes over all branch and bound runs
38224  *
38225  * @return the maximal depth of all processed nodes over all branch and bound runs
38226  *
38227  * @pre This method can be called if SCIP is in one of the following stages:
38228  * - \ref SCIP_STAGE_TRANSFORMED
38229  * - \ref SCIP_STAGE_INITPRESOLVE
38230  * - \ref SCIP_STAGE_PRESOLVING
38231  * - \ref SCIP_STAGE_EXITPRESOLVE
38232  * - \ref SCIP_STAGE_PRESOLVED
38233  * - \ref SCIP_STAGE_INITSOLVE
38234  * - \ref SCIP_STAGE_SOLVING
38235  * - \ref SCIP_STAGE_SOLVED
38236  * - \ref SCIP_STAGE_EXITSOLVE
38237  */
38239  SCIP* scip /**< SCIP data structure */
38240  )
38241 {
38242  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetMaxTotalDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38243 
38244  return scip->stat->maxtotaldepth;
38245 }
38246 
38247 /** gets total number of backtracks, i.e. number of times, the new node was selected from the leaves queue
38248  *
38249  * @return the total number of backtracks, i.e. number of times, the new node was selected from the leaves queue
38250  *
38251  * @pre This method can be called if SCIP is in one of the following stages:
38252  * - \ref SCIP_STAGE_TRANSFORMED
38253  * - \ref SCIP_STAGE_INITPRESOLVE
38254  * - \ref SCIP_STAGE_PRESOLVING
38255  * - \ref SCIP_STAGE_EXITPRESOLVE
38256  * - \ref SCIP_STAGE_PRESOLVED
38257  * - \ref SCIP_STAGE_INITSOLVE
38258  * - \ref SCIP_STAGE_SOLVING
38259  * - \ref SCIP_STAGE_SOLVED
38260  * - \ref SCIP_STAGE_EXITSOLVE
38261  */
38263  SCIP* scip /**< SCIP data structure */
38264  )
38265 {
38266  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBacktracks", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38267 
38268  return scip->stat->nbacktracks;
38269 }
38270 
38271 /** gets current plunging depth (successive times, a child was selected as next node)
38272  *
38273  * @return the current plunging depth (successive times, a child was selected as next node)
38274  *
38275  * @pre This method can be called if SCIP is in one of the following stages:
38276  * - \ref SCIP_STAGE_PRESOLVED
38277  * - \ref SCIP_STAGE_SOLVING
38278  */
38280  SCIP* scip /**< SCIP data structure */
38281  )
38282 {
38283  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPlungeDepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38284 
38285  return scip->stat->plungedepth;
38286 }
38287 
38288 /** gets total number of active constraints at the current node
38289  *
38290  * @return the total number of active constraints at the current node
38291  *
38292  * @pre This method can be called if SCIP is in one of the following stages:
38293  * - \ref SCIP_STAGE_PRESOLVED
38294  * - \ref SCIP_STAGE_SOLVING
38295  */
38297  SCIP* scip /**< SCIP data structure */
38298  )
38299 {
38300  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNActiveConss", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38301 
38302  return scip->stat->nactiveconss;
38303 }
38304 
38305 /** gets total number of enabled constraints at the current node
38306  *
38307  * @return the total number of enabled constraints at the current node
38308  *
38309  * @pre This method can be called if SCIP is in one of the following stages:
38310  * - \ref SCIP_STAGE_PRESOLVED
38311  * - \ref SCIP_STAGE_SOLVING
38312  */
38314  SCIP* scip /**< SCIP data structure */
38315  )
38316 {
38317  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNEnabledConss", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38318 
38319  return scip->stat->nenabledconss;
38320 }
38321 
38322 /** gets average dual bound of all unprocessed nodes for original problem
38323  *
38324  * @return the average dual bound of all unprocessed nodes for original problem
38325  *
38326  * @pre This method can be called if SCIP is in one of the following stages:
38327  * - \ref SCIP_STAGE_PRESOLVED
38328  * - \ref SCIP_STAGE_SOLVING
38329  * - \ref SCIP_STAGE_SOLVED
38330  */
38332  SCIP* scip /**< SCIP data structure */
38333  )
38334 {
38335  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38336 
38337  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set,
38339 }
38340 
38341 /** gets average lower (dual) bound of all unprocessed nodes in transformed problem
38342  *
38343  * @return the average lower (dual) bound of all unprocessed nodes in transformed problem
38344  *
38345  * @pre This method can be called if SCIP is in one of the following stages:
38346  * - \ref SCIP_STAGE_PRESOLVED
38347  * - \ref SCIP_STAGE_SOLVING
38348  * - \ref SCIP_STAGE_SOLVED
38349  */
38351  SCIP* scip /**< SCIP data structure */
38352  )
38353 {
38354  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38355 
38356  return SCIPtreeGetAvgLowerbound(scip->tree, scip->primal->cutoffbound);
38357 }
38358 
38359 /** gets global dual bound
38360  *
38361  * @return the global dual bound
38362  *
38363  * @pre This method can be called if SCIP is in one of the following stages:
38364  * - \ref SCIP_STAGE_PRESOLVING
38365  * - \ref SCIP_STAGE_EXITPRESOLVE
38366  * - \ref SCIP_STAGE_PRESOLVED
38367  * - \ref SCIP_STAGE_INITSOLVE
38368  * - \ref SCIP_STAGE_SOLVING
38369  * - \ref SCIP_STAGE_SOLVED
38370  * - \ref SCIP_STAGE_EXITSOLVE
38371  */
38373  SCIP* scip /**< SCIP data structure */
38374  )
38375 {
38376  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38377 
38378  return getDualbound(scip);
38379 }
38380 
38381 /** gets global lower (dual) bound in transformed problem
38382  *
38383  * @return the global lower (dual) bound in transformed problem
38384  *
38385  * @pre This method can be called if SCIP is in one of the following stages:
38386  * - \ref SCIP_STAGE_PRESOLVING
38387  * - \ref SCIP_STAGE_EXITPRESOLVE
38388  * - \ref SCIP_STAGE_PRESOLVED
38389  * - \ref SCIP_STAGE_INITSOLVE
38390  * - \ref SCIP_STAGE_SOLVING
38391  * - \ref SCIP_STAGE_SOLVED
38392  */
38394  SCIP* scip /**< SCIP data structure */
38395  )
38396 {
38397  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38398 
38399  return getLowerbound(scip);
38400 }
38401 
38402 /** gets dual bound of the root node for the original problem
38403  *
38404  * @return the dual bound of the root node for the original problem
38405  *
38406  * @pre This method can be called if SCIP is in one of the following stages:
38407  * - \ref SCIP_STAGE_PRESOLVING
38408  * - \ref SCIP_STAGE_EXITPRESOLVE
38409  * - \ref SCIP_STAGE_PRESOLVED
38410  * - \ref SCIP_STAGE_INITSOLVE
38411  * - \ref SCIP_STAGE_SOLVING
38412  * - \ref SCIP_STAGE_SOLVED
38413  */
38415  SCIP* scip /**< SCIP data structure */
38416  )
38417 {
38418  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDualboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38419 
38420  if( SCIPsetIsInfinity(scip->set, scip->stat->rootlowerbound) )
38421  return getPrimalbound(scip);
38422  else
38423  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, scip->stat->rootlowerbound);
38424 }
38425 
38426 /** gets lower (dual) bound in transformed problem of the root node
38427  *
38428  * @return the lower (dual) bound in transformed problem of the root node
38429  *
38430  * @pre This method can be called if SCIP is in one of the following stages:
38431  * - \ref SCIP_STAGE_PRESOLVING
38432  * - \ref SCIP_STAGE_EXITPRESOLVE
38433  * - \ref SCIP_STAGE_PRESOLVED
38434  * - \ref SCIP_STAGE_INITSOLVE
38435  * - \ref SCIP_STAGE_SOLVING
38436  * - \ref SCIP_STAGE_SOLVED
38437  */
38439  SCIP* scip /**< SCIP data structure */
38440  )
38441 {
38442  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLowerboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38443 
38444  if( SCIPsetIsInfinity(scip->set, scip->stat->rootlowerbound) )
38445  return getUpperbound(scip);
38446  else
38447  return scip->stat->rootlowerbound;
38448 }
38449 
38450 /** gets dual bound for the original problem obtained by the first LP solve at the root node
38451  *
38452  * @return the dual bound for the original problem of the first LP solve at the root node
38453  *
38454  * @pre This method can be called if SCIP is in one of the following stages:
38455  * - \ref SCIP_STAGE_PRESOLVING
38456  * - \ref SCIP_STAGE_EXITPRESOLVE
38457  * - \ref SCIP_STAGE_PRESOLVED
38458  * - \ref SCIP_STAGE_INITSOLVE
38459  * - \ref SCIP_STAGE_SOLVING
38460  * - \ref SCIP_STAGE_SOLVED
38461  */
38463  SCIP* scip /**< SCIP data structure */
38464  )
38465 {
38466  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPDualboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38467 
38468  return scip->stat->firstlpdualbound;
38469 }
38470 
38471 /** gets lower (dual) bound in transformed problem obtained by the first LP solve at the root node
38472  *
38473  * @return the lower (dual) bound in transformed problem obtained by first LP solve at the root node
38474  *
38475  * @pre This method can be called if SCIP is in one of the following stages:
38476  * - \ref SCIP_STAGE_PRESOLVING
38477  * - \ref SCIP_STAGE_EXITPRESOLVE
38478  * - \ref SCIP_STAGE_PRESOLVED
38479  * - \ref SCIP_STAGE_INITSOLVE
38480  * - \ref SCIP_STAGE_SOLVING
38481  * - \ref SCIP_STAGE_SOLVED
38482  */
38484  SCIP* scip /**< SCIP data structure */
38485  )
38486 {
38487  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPLowerboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38488 
38489  if( scip->stat->firstlpdualbound == SCIP_INVALID ) /*lint !e777*/
38490  return -SCIPinfinity(scip);
38491  else
38492  return SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->stat->firstlpdualbound);
38493 }
38494 
38495 /** gets global primal bound (objective value of best solution or user objective limit) for the original problem
38496  *
38497  * @return the global primal bound (objective value of best solution or user objective limit) for the original problem
38498  *
38499  * @pre This method can be called if SCIP is in one of the following stages:
38500  * - \ref SCIP_STAGE_TRANSFORMED
38501  * - \ref SCIP_STAGE_INITPRESOLVE
38502  * - \ref SCIP_STAGE_PRESOLVING
38503  * - \ref SCIP_STAGE_EXITPRESOLVE
38504  * - \ref SCIP_STAGE_PRESOLVED
38505  * - \ref SCIP_STAGE_INITSOLVE
38506  * - \ref SCIP_STAGE_SOLVING
38507  * - \ref SCIP_STAGE_SOLVED
38508  * - \ref SCIP_STAGE_EXITSOLVE
38509  */
38511  SCIP* scip /**< SCIP data structure */
38512  )
38513 {
38514  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrimalbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38515 
38516  return getPrimalbound(scip);
38517 }
38518 
38519 /** gets global upper (primal) bound in transformed problem (objective value of best solution or user objective limit)
38520  *
38521  * @return the global upper (primal) bound in transformed problem (objective value of best solution or user objective limit)
38522  *
38523  * @pre This method can be called if SCIP is in one of the following stages:
38524  * - \ref SCIP_STAGE_TRANSFORMED
38525  * - \ref SCIP_STAGE_INITPRESOLVE
38526  * - \ref SCIP_STAGE_PRESOLVING
38527  * - \ref SCIP_STAGE_EXITPRESOLVE
38528  * - \ref SCIP_STAGE_PRESOLVED
38529  * - \ref SCIP_STAGE_INITSOLVE
38530  * - \ref SCIP_STAGE_SOLVING
38531  * - \ref SCIP_STAGE_SOLVED
38532  * - \ref SCIP_STAGE_EXITSOLVE
38533  */
38535  SCIP* scip /**< SCIP data structure */
38536  )
38537 {
38538  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetUpperbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38539 
38540  return getUpperbound(scip);
38541 }
38542 
38543 /** gets global cutoff bound in transformed problem: a sub problem with lower bound larger than the cutoff
38544  * cannot contain a better feasible solution; usually, this bound is equal to the upper bound, but if the
38545  * objective value is always integral, the cutoff bound is (nearly) one less than the upper bound;
38546  * additionally, due to objective function domain propagation, the cutoff bound can be further reduced
38547  *
38548  * @return global cutoff bound in transformed problem
38549  *
38550  * @pre This method can be called if SCIP is in one of the following stages:
38551  * - \ref SCIP_STAGE_TRANSFORMED
38552  * - \ref SCIP_STAGE_INITPRESOLVE
38553  * - \ref SCIP_STAGE_PRESOLVING
38554  * - \ref SCIP_STAGE_EXITPRESOLVE
38555  * - \ref SCIP_STAGE_PRESOLVED
38556  * - \ref SCIP_STAGE_INITSOLVE
38557  * - \ref SCIP_STAGE_SOLVING
38558  * - \ref SCIP_STAGE_SOLVED
38559  * - \ref SCIP_STAGE_EXITSOLVE
38560  */
38562  SCIP* scip /**< SCIP data structure */
38563  )
38564 {
38565  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutoffbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38566 
38567  return scip->primal->cutoffbound;
38568 }
38569 
38570 /** updates the cutoff bound
38571  *
38572  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38573  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38574  *
38575  * @note using this method in the solving stage can lead to an erroneous SCIP solving status; in particular,
38576  * if a solution not respecting the cutoff bound was found before installing a cutoff bound which
38577  * renders the remaining problem infeasible, this solution may be reported as optimal
38578  *
38579  * @pre This method can be called if SCIP is in one of the following stages:
38580  * - \ref SCIP_STAGE_TRANSFORMED
38581  * - \ref SCIP_STAGE_PRESOLVING
38582  * - \ref SCIP_STAGE_PRESOLVED
38583  * - \ref SCIP_STAGE_INITSOLVE
38584  * - \ref SCIP_STAGE_SOLVING
38585  *
38586  * @note the given cutoff bound has to better or equal to known one (SCIPgetCutoffbound())
38587  * @note a given cutoff bound is also used for updating the objective limit, if possible
38588  */
38590  SCIP* scip, /**< SCIP data structure */
38591  SCIP_Real cutoffbound /**< new cutoff bound */
38592  )
38593 {
38594  SCIP_CALL( checkStage(scip, "SCIPupdateCutoffbound", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38595 
38596  assert(cutoffbound <= SCIPgetCutoffbound(scip));
38597 
38598  SCIP_CALL( SCIPprimalSetCutoffbound(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
38599  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, cutoffbound, FALSE) );
38600 
38601  return SCIP_OKAY;
38602 }
38603 
38604 
38605 /** returns whether the current primal bound is justified with a feasible primal solution; if not, the primal bound
38606  * was set from the user as objective limit
38607  *
38608  * @return TRUE if the current primal bound is justified with a feasible primal solution, otherwise FALSE
38609  *
38610  * @pre This method can be called if SCIP is in one of the following stages:
38611  * - \ref SCIP_STAGE_TRANSFORMED
38612  * - \ref SCIP_STAGE_INITPRESOLVE
38613  * - \ref SCIP_STAGE_PRESOLVING
38614  * - \ref SCIP_STAGE_EXITPRESOLVE
38615  * - \ref SCIP_STAGE_PRESOLVED
38616  * - \ref SCIP_STAGE_INITSOLVE
38617  * - \ref SCIP_STAGE_SOLVING
38618  * - \ref SCIP_STAGE_SOLVED
38619  * - \ref SCIP_STAGE_EXITSOLVE
38620  */
38622  SCIP* scip /**< SCIP data structure */
38623  )
38624 {
38625  SCIP_CALL_ABORT( checkStage(scip, "SCIPisPrimalboundSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38626 
38627  return SCIPprimalUpperboundIsSol(scip->primal, scip->set, scip->transprob, scip->origprob);
38628 }
38629 
38630 /** gets current gap |(primalbound - dualbound)/min(|primalbound|,|dualbound|)| if both bounds have same sign,
38631  * or infinity, if they have opposite sign
38632  *
38633  * @return the current gap |(primalbound - dualbound)/min(|primalbound|,|dualbound|)| if both bounds have same sign,
38634  * or infinity, if they have opposite sign
38635  *
38636  * @pre This method can be called if SCIP is in one of the following stages:
38637  * - \ref SCIP_STAGE_PRESOLVING
38638  * - \ref SCIP_STAGE_EXITPRESOLVE
38639  * - \ref SCIP_STAGE_PRESOLVED
38640  * - \ref SCIP_STAGE_SOLVING
38641  * - \ref SCIP_STAGE_SOLVED
38642  */
38644  SCIP* scip /**< SCIP data structure */
38645  )
38646 {
38647  SCIP_Real primalbound;
38648  SCIP_Real dualbound;
38649 
38650  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGap", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38651 
38652  if( SCIPsetIsInfinity(scip->set, getLowerbound(scip)) )
38653  {
38654  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with
38655  * gap = +inf instead of gap = 0
38656  */
38657  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
38658  return SCIPsetInfinity(scip->set);
38659  else
38660  return 0.0;
38661  }
38662 
38663  primalbound = getPrimalbound(scip);
38664  dualbound = getDualbound(scip);
38665 
38666  if( SCIPsetIsEQ(scip->set, primalbound, dualbound) )
38667  return 0.0;
38668  else if( SCIPsetIsZero(scip->set, dualbound)
38669  || SCIPsetIsZero(scip->set, primalbound)
38670  || SCIPsetIsInfinity(scip->set, REALABS(primalbound))
38671  || SCIPsetIsInfinity(scip->set, REALABS(dualbound))
38672  || primalbound * dualbound < 0.0 )
38673  return SCIPsetInfinity(scip->set);
38674  else
38675  {
38676  SCIP_Real absdual = REALABS(dualbound);
38677  SCIP_Real absprimal = REALABS(primalbound);
38678 
38679  return REALABS((primalbound - dualbound)/MIN(absdual, absprimal));
38680  }
38681 }
38682 
38683 /** gets current gap |(upperbound - lowerbound)/min(|upperbound|,|lowerbound|)| in transformed problem if both bounds
38684  * have same sign, or infinity, if they have opposite sign
38685  *
38686  * @return current gap |(upperbound - lowerbound)/min(|upperbound|,|lowerbound|)| in transformed problem if both bounds
38687  * have same sign, or infinity, if they have opposite sign
38688  *
38689  * @pre This method can be called if SCIP is in one of the following stages:
38690  * - \ref SCIP_STAGE_PRESOLVED
38691  * - \ref SCIP_STAGE_SOLVING
38692  * - \ref SCIP_STAGE_SOLVED
38693  */
38695  SCIP* scip /**< SCIP data structure */
38696  )
38697 {
38698  SCIP_Real upperbound;
38699  SCIP_Real lowerbound;
38700 
38701  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransGap", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38702 
38703  upperbound = getUpperbound(scip);
38704  lowerbound = getLowerbound(scip);
38705 
38706  if( SCIPsetIsInfinity(scip->set, lowerbound) )
38707  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with
38708  * gap = +inf instead of gap = 0
38709  */
38710  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
38711  return SCIPsetInfinity(scip->set);
38712  else
38713  return 0.0;
38714  else if( SCIPsetIsEQ(scip->set, upperbound, lowerbound) )
38715  return 0.0;
38716  else if( SCIPsetIsZero(scip->set, lowerbound)
38717  || SCIPsetIsZero(scip->set, upperbound)
38718  || SCIPsetIsInfinity(scip->set, upperbound)
38719  || SCIPsetIsInfinity(scip->set, -lowerbound)
38720  || lowerbound * upperbound < 0.0 )
38721  return SCIPsetInfinity(scip->set);
38722  else
38723  {
38724  SCIP_Real abslower = REALABS(lowerbound);
38725  SCIP_Real absupper = REALABS(upperbound);
38726 
38727  return REALABS((upperbound - lowerbound)/MIN(abslower, absupper));
38728  }
38729 }
38730 
38731 /** gets number of feasible primal solutions found so far
38732  *
38733  * @return the number of feasible primal solutions found so far
38734  *
38735  * @pre This method can be called if SCIP is in one of the following stages:
38736  * - \ref SCIP_STAGE_TRANSFORMED
38737  * - \ref SCIP_STAGE_INITPRESOLVE
38738  * - \ref SCIP_STAGE_PRESOLVING
38739  * - \ref SCIP_STAGE_EXITPRESOLVE
38740  * - \ref SCIP_STAGE_PRESOLVED
38741  * - \ref SCIP_STAGE_INITSOLVE
38742  * - \ref SCIP_STAGE_SOLVING
38743  * - \ref SCIP_STAGE_SOLVED
38744  * - \ref SCIP_STAGE_EXITSOLVE
38745  */
38747  SCIP* scip /**< SCIP data structure */
38748  )
38749 {
38750  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38751 
38752  return scip->primal->nsolsfound;
38753 }
38754 
38755 /** gets number of feasible primal solutions respecting the objective limit found so far
38756  *
38757  * @return the number of feasible primal solutions respecting the objective limit found so far
38758  *
38759  * @pre This method can be called if SCIP is in one of the following stages:
38760  * - \ref SCIP_STAGE_TRANSFORMED
38761  * - \ref SCIP_STAGE_INITPRESOLVE
38762  * - \ref SCIP_STAGE_PRESOLVING
38763  * - \ref SCIP_STAGE_EXITPRESOLVE
38764  * - \ref SCIP_STAGE_PRESOLVED
38765  * - \ref SCIP_STAGE_INITSOLVE
38766  * - \ref SCIP_STAGE_SOLVING
38767  * - \ref SCIP_STAGE_SOLVED
38768  * - \ref SCIP_STAGE_EXITSOLVE
38769  */
38771  SCIP* scip /**< SCIP data structure */
38772  )
38773 {
38774  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLimSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38775 
38776  return scip->primal->nlimsolsfound;
38777 }
38778 
38779 /** gets number of feasible primal solutions found so far, that improved the primal bound at the time they were found
38780  *
38781  * @return the number of feasible primal solutions found so far, that improved the primal bound at the time they were found
38782  *
38783  * @pre This method can be called if SCIP is in one of the following stages:
38784  * - \ref SCIP_STAGE_TRANSFORMED
38785  * - \ref SCIP_STAGE_INITPRESOLVE
38786  * - \ref SCIP_STAGE_PRESOLVING
38787  * - \ref SCIP_STAGE_EXITPRESOLVE
38788  * - \ref SCIP_STAGE_PRESOLVED
38789  * - \ref SCIP_STAGE_INITSOLVE
38790  * - \ref SCIP_STAGE_SOLVING
38791  * - \ref SCIP_STAGE_SOLVED
38792  * - \ref SCIP_STAGE_EXITSOLVE
38793  */
38795  SCIP* scip /**< SCIP data structure */
38796  )
38797 {
38798  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBestSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38799 
38800  return scip->primal->nbestsolsfound;
38801 }
38802 
38803 /** gets the average pseudo cost value for the given direction over all variables
38804  *
38805  * @return the average pseudo cost value for the given direction over all variables
38806  *
38807  * @pre This method can be called if SCIP is in one of the following stages:
38808  * - \ref SCIP_STAGE_SOLVING
38809  * - \ref SCIP_STAGE_SOLVED
38810  */
38812  SCIP* scip, /**< SCIP data structure */
38813  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
38814  )
38815 {
38816  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38817 
38818  return SCIPhistoryGetPseudocost(scip->stat->glbhistory, solvaldelta);
38819 }
38820 
38821 /** gets the average pseudo cost value for the given direction over all variables,
38822  * only using the pseudo cost information of the current run
38823  *
38824  * @return the average pseudo cost value for the given direction over all variables,
38825  * only using the pseudo cost information of the current run
38826  *
38827  * @pre This method can be called if SCIP is in one of the following stages:
38828  * - \ref SCIP_STAGE_SOLVING
38829  * - \ref SCIP_STAGE_SOLVED
38830  */
38832  SCIP* scip, /**< SCIP data structure */
38833  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
38834  )
38835 {
38836  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38837 
38838  return SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, solvaldelta);
38839 }
38840 
38841 /** gets the average number of pseudo cost updates for the given direction over all variables
38842  *
38843  * @return the average number of pseudo cost updates for the given direction over all variables
38844  *
38845  * @pre This method can be called if SCIP is in one of the following stages:
38846  * - \ref SCIP_STAGE_SOLVING
38847  * - \ref SCIP_STAGE_SOLVED
38848  */
38850  SCIP* scip, /**< SCIP data structure */
38851  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
38852  )
38853 {
38854  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCount", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38855 
38856  return SCIPhistoryGetPseudocostCount(scip->stat->glbhistory, dir)
38857  / MAX(scip->transprob->nbinvars + scip->transprob->nintvars, 1);
38858 }
38859 
38860 /** gets the average number of pseudo cost updates for the given direction over all variables,
38861  * only using the pseudo cost information of the current run
38862  *
38863  * @return the average number of pseudo cost updates for the given direction over all variables,
38864  * only using the pseudo cost information of the current run
38865  *
38866  * @pre This method can be called if SCIP is in one of the following stages:
38867  * - \ref SCIP_STAGE_SOLVING
38868  * - \ref SCIP_STAGE_SOLVED
38869  */
38871  SCIP* scip, /**< SCIP data structure */
38872  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
38873  )
38874 {
38875  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCountCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38876 
38878  / MAX(scip->transprob->nbinvars + scip->transprob->nintvars, 1);
38879 }
38880 
38881 /** gets the average pseudo cost score value over all variables, assuming a fractionality of 0.5
38882  *
38883  * @return the average pseudo cost score value over all variables, assuming a fractionality of 0.5
38884  *
38885  * @pre This method can be called if SCIP is in one of the following stages:
38886  * - \ref SCIP_STAGE_SOLVING
38887  * - \ref SCIP_STAGE_SOLVED
38888  */
38890  SCIP* scip /**< SCIP data structure */
38891  )
38892 {
38893  SCIP_Real pscostdown;
38894  SCIP_Real pscostup;
38895 
38896  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38897 
38898  pscostdown = SCIPhistoryGetPseudocost(scip->stat->glbhistory, -0.5);
38899  pscostup = SCIPhistoryGetPseudocost(scip->stat->glbhistory, +0.5);
38900 
38901  return SCIPbranchGetScore(scip->set, NULL, pscostdown, pscostup);
38902 }
38903 
38904 /** gets the average pseudo cost score value over all variables, assuming a fractionality of 0.5,
38905  * only using the pseudo cost information of the current run
38906  *
38907  * @return the average pseudo cost score value over all variables, assuming a fractionality of 0.5,
38908  * only using the pseudo cost information of the current run
38909  *
38910  * @pre This method can be called if SCIP is in one of the following stages:
38911  * - \ref SCIP_STAGE_SOLVING
38912  * - \ref SCIP_STAGE_SOLVED
38913  */
38915  SCIP* scip /**< SCIP data structure */
38916  )
38917 {
38918  SCIP_Real pscostdown;
38919  SCIP_Real pscostup;
38920 
38921  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38922 
38923  pscostdown = SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, -0.5);
38924  pscostup = SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, +0.5);
38925 
38926  return SCIPbranchGetScore(scip->set, NULL, pscostdown, pscostup);
38927 }
38928 
38929 /** gets the average conflict score value over all variables
38930  *
38931  * @return the average conflict score value over all variables
38932  *
38933  * @pre This method can be called if SCIP is in one of the following stages:
38934  * - \ref SCIP_STAGE_SOLVING
38935  * - \ref SCIP_STAGE_SOLVED
38936  */
38938  SCIP* scip /**< SCIP data structure */
38939  )
38940 {
38941  SCIP_Real conflictscoredown;
38942  SCIP_Real conflictscoreup;
38943  SCIP_Real scale;
38944 
38945  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38946 
38947  scale = scip->transprob->nvars * scip->stat->vsidsweight;
38948  conflictscoredown = SCIPhistoryGetVSIDS(scip->stat->glbhistory, SCIP_BRANCHDIR_DOWNWARDS) / scale;
38949  conflictscoreup = SCIPhistoryGetVSIDS(scip->stat->glbhistory, SCIP_BRANCHDIR_UPWARDS) / scale;
38950 
38951  return SCIPbranchGetScore(scip->set, NULL, conflictscoredown, conflictscoreup);
38952 }
38953 
38954 /** gets the average conflict score value over all variables, only using the pseudo cost information of the current run
38955  *
38956  * @return the average conflict score value over all variables, only using the pseudo cost information of the current run
38957  *
38958  * @pre This method can be called if SCIP is in one of the following stages:
38959  * - \ref SCIP_STAGE_SOLVING
38960  * - \ref SCIP_STAGE_SOLVED
38961  */
38963  SCIP* scip /**< SCIP data structure */
38964  )
38965 {
38966  SCIP_Real conflictscoredown;
38967  SCIP_Real conflictscoreup;
38968  SCIP_Real scale;
38969 
38970  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38971 
38972  scale = scip->transprob->nvars * scip->stat->vsidsweight;
38973  conflictscoredown = SCIPhistoryGetVSIDS(scip->stat->glbhistorycrun, SCIP_BRANCHDIR_DOWNWARDS) / scale;
38974  conflictscoreup = SCIPhistoryGetVSIDS(scip->stat->glbhistorycrun, SCIP_BRANCHDIR_UPWARDS) / scale;
38975 
38976  return SCIPbranchGetScore(scip->set, NULL, conflictscoredown, conflictscoreup);
38977 }
38978 
38979 /** gets the average inference score value over all variables
38980  *
38981  * @return the average inference score value over all variables
38982  *
38983  * @pre This method can be called if SCIP is in one of the following stages:
38984  * - \ref SCIP_STAGE_SOLVING
38985  * - \ref SCIP_STAGE_SOLVED
38986  */
38988  SCIP* scip /**< SCIP data structure */
38989  )
38990 {
38991  SCIP_Real conflictlengthdown;
38992  SCIP_Real conflictlengthup;
38993 
38994  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictlengthScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38995 
38998 
38999  return SCIPbranchGetScore(scip->set, NULL, conflictlengthdown, conflictlengthup);
39000 }
39001 
39002 /** gets the average conflictlength score value over all variables, only using the pseudo cost information of the
39003  * current run
39004  *
39005  * @return the average conflictlength score value over all variables, only using the pseudo cost information of the
39006  * current run
39007  *
39008  * @pre This method can be called if SCIP is in one of the following stages:
39009  * - \ref SCIP_STAGE_SOLVING
39010  * - \ref SCIP_STAGE_SOLVED
39011  */
39013  SCIP* scip /**< SCIP data structure */
39014  )
39015 {
39016  SCIP_Real conflictlengthdown;
39017  SCIP_Real conflictlengthup;
39018 
39019  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictlengthScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39020 
39023 
39024  return SCIPbranchGetScore(scip->set, NULL, conflictlengthdown, conflictlengthup);
39025 }
39026 
39027 /** returns the average number of inferences found after branching in given direction over all variables
39028  *
39029  * @return the average number of inferences found after branching in given direction over all variables
39030  *
39031  * @pre This method can be called if SCIP is in one of the following stages:
39032  * - \ref SCIP_STAGE_SOLVING
39033  * - \ref SCIP_STAGE_SOLVED
39034  */
39036  SCIP* scip, /**< SCIP data structure */
39037  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
39038  )
39039 {
39040  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferences", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39041 
39042  return SCIPhistoryGetAvgInferences(scip->stat->glbhistory, dir);
39043 }
39044 
39045 /** returns the average number of inferences found after branching in given direction over all variables,
39046  * only using the pseudo cost information of the current run
39047  *
39048  * @return the average number of inferences found after branching in given direction over all variables,
39049  * only using the pseudo cost information of the current run
39050  *
39051  * @pre This method can be called if SCIP is in one of the following stages:
39052  * - \ref SCIP_STAGE_SOLVING
39053  * - \ref SCIP_STAGE_SOLVED
39054  */
39056  SCIP* scip, /**< SCIP data structure */
39057  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
39058  )
39059 {
39060  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferencesCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39061 
39062  return SCIPhistoryGetAvgInferences(scip->stat->glbhistorycrun, dir);
39063 }
39064 
39065 /** gets the average inference score value over all variables
39066  *
39067  * @return the average inference score value over all variables
39068  *
39069  * @pre This method can be called if SCIP is in one of the following stages:
39070  * - \ref SCIP_STAGE_SOLVING
39071  * - \ref SCIP_STAGE_SOLVED
39072  */
39074  SCIP* scip /**< SCIP data structure */
39075  )
39076 {
39077  SCIP_Real inferencesdown;
39078  SCIP_Real inferencesup;
39079 
39080  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferenceScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39081 
39084 
39085  return SCIPbranchGetScore(scip->set, NULL, inferencesdown, inferencesup);
39086 }
39087 
39088 /** gets the average inference score value over all variables, only using the inference information information of the
39089  * current run
39090  *
39091  * @return the average inference score value over all variables, only using the inference information information of the
39092  * current run
39093  *
39094  * @pre This method can be called if SCIP is in one of the following stages:
39095  * - \ref SCIP_STAGE_SOLVING
39096  * - \ref SCIP_STAGE_SOLVED
39097  */
39099  SCIP* scip /**< SCIP data structure */
39100  )
39101 {
39102  SCIP_Real inferencesdown;
39103  SCIP_Real inferencesup;
39104 
39105  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferenceScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39106 
39109 
39110  return SCIPbranchGetScore(scip->set, NULL, inferencesdown, inferencesup);
39111 }
39112 
39113 /** returns the average number of cutoffs found after branching in given direction over all variables
39114  *
39115  * @return the average number of cutoffs found after branching in given direction over all variables
39116  *
39117  * @pre This method can be called if SCIP is in one of the following stages:
39118  * - \ref SCIP_STAGE_SOLVING
39119  * - \ref SCIP_STAGE_SOLVED
39120  */
39122  SCIP* scip, /**< SCIP data structure */
39123  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
39124  )
39125 {
39126  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39127 
39128  return SCIPhistoryGetAvgCutoffs(scip->stat->glbhistory, dir);
39129 }
39130 
39131 /** returns the average number of cutoffs found after branching in given direction over all variables,
39132  * only using the pseudo cost information of the current run
39133  *
39134  * @return the average number of cutoffs found after branching in given direction over all variables,
39135  * only using the pseudo cost information of the current run
39136  *
39137  * @pre This method can be called if SCIP is in one of the following stages:
39138  * - \ref SCIP_STAGE_SOLVING
39139  * - \ref SCIP_STAGE_SOLVED
39140  */
39142  SCIP* scip, /**< SCIP data structure */
39143  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
39144  )
39145 {
39146  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffsCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39147 
39148  return SCIPhistoryGetAvgCutoffs(scip->stat->glbhistorycrun, dir);
39149 }
39150 
39151 /** gets the average cutoff score value over all variables
39152  *
39153  * @return the average cutoff score value over all variables
39154  *
39155  * @pre This method can be called if SCIP is in one of the following stages:
39156  * - \ref SCIP_STAGE_SOLVING
39157  * - \ref SCIP_STAGE_SOLVED
39158  */
39160  SCIP* scip /**< SCIP data structure */
39161  )
39162 {
39163  SCIP_Real cutoffsdown;
39164  SCIP_Real cutoffsup;
39165 
39166  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39167 
39170 
39171  return SCIPbranchGetScore(scip->set, NULL, cutoffsdown, cutoffsup);
39172 }
39173 
39174 /** gets the average cutoff score value over all variables, only using the pseudo cost information of the current run
39175  *
39176  * @return the average cutoff score value over all variables, only using the pseudo cost information of the current run
39177  *
39178  * @pre This method can be called if SCIP is in one of the following stages:
39179  * - \ref SCIP_STAGE_SOLVING
39180  * - \ref SCIP_STAGE_SOLVED
39181  */
39183  SCIP* scip /**< SCIP data structure */
39184  )
39185 {
39186  SCIP_Real cutoffsdown;
39187  SCIP_Real cutoffsup;
39188 
39189  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39190 
39193 
39194  return SCIPbranchGetScore(scip->set, NULL, cutoffsdown, cutoffsup);
39195 }
39196 
39197 /** outputs problem to file stream */
39198 static
39200  SCIP* scip, /**< SCIP data structure */
39201  SCIP_PROB* prob, /**< problem data */
39202  FILE* file, /**< output file (or NULL for standard output) */
39203  const char* extension, /**< file format (or NULL for default CIP format) */
39204  SCIP_Bool genericnames /**< using generic variable and constraint names? */
39205  )
39206 {
39207  SCIP_RESULT result;
39208  int i;
39209  assert(scip != NULL);
39210  assert(prob != NULL);
39211 
39212  /* try all readers until one could read the file */
39213  result = SCIP_DIDNOTRUN;
39214  for( i = 0; i < scip->set->nreaders && result == SCIP_DIDNOTRUN; ++i )
39215  {
39216  SCIP_RETCODE retcode;
39217 
39218  if( extension != NULL )
39219  retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, file, extension, genericnames, &result);
39220  else
39221  retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, file, "cip", genericnames, &result);
39222 
39223  /* check for reader errors */
39224  if( retcode == SCIP_WRITEERROR )
39225  return retcode;
39226 
39227  SCIP_CALL( retcode );
39228  }
39229 
39230  switch( result )
39231  {
39232  case SCIP_DIDNOTRUN:
39233  return SCIP_PLUGINNOTFOUND;
39234 
39235  case SCIP_SUCCESS:
39236  return SCIP_OKAY;
39237 
39238  default:
39239  assert(i < scip->set->nreaders);
39240  SCIPerrorMessage("invalid result code <%d> from reader <%s> writing <%s> format\n",
39241  result, SCIPreaderGetName(scip->set->readers[i]), extension);
39242  return SCIP_READERROR;
39243  } /*lint !e788*/
39244 }
39245 
39246 /** outputs original problem to file stream
39247  *
39248  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39249  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39250  *
39251  * @pre This method can be called if SCIP is in one of the following stages:
39252  * - \ref SCIP_STAGE_PROBLEM
39253  * - \ref SCIP_STAGE_TRANSFORMING
39254  * - \ref SCIP_STAGE_TRANSFORMED
39255  * - \ref SCIP_STAGE_INITPRESOLVE
39256  * - \ref SCIP_STAGE_PRESOLVING
39257  * - \ref SCIP_STAGE_EXITPRESOLVE
39258  * - \ref SCIP_STAGE_PRESOLVED
39259  * - \ref SCIP_STAGE_INITSOLVE
39260  * - \ref SCIP_STAGE_SOLVING
39261  * - \ref SCIP_STAGE_SOLVED
39262  * - \ref SCIP_STAGE_EXITSOLVE
39263  * - \ref SCIP_STAGE_FREETRANS
39264  */
39266  SCIP* scip, /**< SCIP data structure */
39267  FILE* file, /**< output file (or NULL for standard output) */
39268  const char* extension, /**< file format (or NULL for default CIP format)*/
39269  SCIP_Bool genericnames /**< using generic variable and constraint names? */
39270  )
39271 {
39272  SCIP_RETCODE retcode;
39273 
39274  SCIP_CALL( checkStage(scip, "SCIPprintOrigProblem", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39275 
39276  assert(scip != NULL);
39277  assert( scip->origprob != NULL );
39278 
39279  retcode = printProblem(scip, scip->origprob, file, extension, genericnames);
39280 
39281  /* check for write errors */
39282  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
39283  return retcode;
39284  else
39285  {
39286  SCIP_CALL( retcode );
39287  }
39288 
39289  return SCIP_OKAY;
39290 }
39291 
39292 /** outputs transformed problem of the current node to file stream
39293  *
39294  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39295  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39296  *
39297  * @pre This method can be called if SCIP is in one of the following stages:
39298  * - \ref SCIP_STAGE_TRANSFORMED
39299  * - \ref SCIP_STAGE_INITPRESOLVE
39300  * - \ref SCIP_STAGE_PRESOLVING
39301  * - \ref SCIP_STAGE_EXITPRESOLVE
39302  * - \ref SCIP_STAGE_PRESOLVED
39303  * - \ref SCIP_STAGE_INITSOLVE
39304  * - \ref SCIP_STAGE_SOLVING
39305  * - \ref SCIP_STAGE_SOLVED
39306  * - \ref SCIP_STAGE_EXITSOLVE
39307  * - \ref SCIP_STAGE_FREETRANS
39308  */
39310  SCIP* scip, /**< SCIP data structure */
39311  FILE* file, /**< output file (or NULL for standard output) */
39312  const char* extension, /**< file format (or NULL for default CIP format)*/
39313  SCIP_Bool genericnames /**< using generic variable and constraint names? */
39314  )
39315 {
39316  SCIP_RETCODE retcode;
39317 
39318  SCIP_CALL( checkStage(scip, "SCIPprintTransProblem", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39319 
39320  assert(scip != NULL);
39321  assert(scip->transprob != NULL );
39322 
39323  retcode = printProblem(scip, scip->transprob, file, extension, genericnames);
39324 
39325  /* check for write errors */
39326  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
39327  return retcode;
39328  else
39329  {
39330  SCIP_CALL( retcode );
39331  }
39332 
39333  return SCIP_OKAY;
39334 }
39335 
39336 static
39338  SCIP* scip, /**< SCIP data structure */
39339  FILE* file /**< output file */
39340  )
39341 {
39342  int i;
39343 
39344  assert(scip != NULL);
39345  assert(scip->set != NULL);
39346 
39347  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolvers : ExecTime SetupTime Calls FixedVars AggrVars ChgTypes ChgBounds AddHoles DelCons AddCons ChgSides ChgCoefs\n");
39348 
39349  /* sort presolvers w.r.t. their name */
39350  SCIPsetSortPresolsName(scip->set);
39351 
39352  /* presolver statistics */
39353  for( i = 0; i < scip->set->npresols; ++i )
39354  {
39355  SCIP_PRESOL* presol;
39356  presol = scip->set->presols[i];
39357  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpresolGetName(presol));
39358  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
39359  SCIPpresolGetTime(presol),
39360  SCIPpresolGetSetupTime(presol),
39361  SCIPpresolGetNCalls(presol),
39362  SCIPpresolGetNFixedVars(presol),
39363  SCIPpresolGetNAggrVars(presol),
39364  SCIPpresolGetNChgVarTypes(presol),
39365  SCIPpresolGetNChgBds(presol),
39366  SCIPpresolGetNAddHoles(presol),
39367  SCIPpresolGetNDelConss(presol),
39368  SCIPpresolGetNAddConss(presol),
39369  SCIPpresolGetNChgSides(presol),
39370  SCIPpresolGetNChgCoefs(presol));
39371  }
39372 
39373  /* sort propagators w.r.t. their name */
39374  SCIPsetSortPropsName(scip->set);
39375 
39376  for( i = 0; i < scip->set->nprops; ++i )
39377  {
39378  SCIP_PROP* prop;
39379  prop = scip->set->props[i];
39380  if( SCIPpropDoesPresolve(prop) )
39381  {
39382  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpropGetName(prop));
39383  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
39384  SCIPpropGetPresolTime(prop),
39385  SCIPpropGetSetupTime(prop),
39387  SCIPpropGetNFixedVars(prop),
39388  SCIPpropGetNAggrVars(prop),
39390  SCIPpropGetNChgBds(prop),
39391  SCIPpropGetNAddHoles(prop),
39392  SCIPpropGetNDelConss(prop),
39393  SCIPpropGetNAddConss(prop),
39394  SCIPpropGetNChgSides(prop),
39395  SCIPpropGetNChgCoefs(prop));
39396  }
39397  }
39398 
39399  /* constraint handler presolving methods statistics */
39400  for( i = 0; i < scip->set->nconshdlrs; ++i )
39401  {
39402  SCIP_CONSHDLR* conshdlr;
39403  int maxnactiveconss;
39404 
39405  conshdlr = scip->set->conshdlrs[i];
39406  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
39407  if( SCIPconshdlrDoesPresolve(conshdlr)
39408  && (maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr)
39409  || SCIPconshdlrGetNFixedVars(conshdlr) > 0
39410  || SCIPconshdlrGetNAggrVars(conshdlr) > 0
39411  || SCIPconshdlrGetNChgVarTypes(conshdlr) > 0
39412  || SCIPconshdlrGetNChgBds(conshdlr) > 0
39413  || SCIPconshdlrGetNAddHoles(conshdlr) > 0
39414  || SCIPconshdlrGetNDelConss(conshdlr) > 0
39415  || SCIPconshdlrGetNAddConss(conshdlr) > 0
39416  || SCIPconshdlrGetNChgSides(conshdlr) > 0
39417  || SCIPconshdlrGetNChgCoefs(conshdlr) > 0
39418  || SCIPconshdlrGetNUpgdConss(conshdlr) > 0) )
39419  {
39420  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
39421  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
39422  SCIPconshdlrGetPresolTime(conshdlr),
39423  SCIPconshdlrGetSetupTime(conshdlr),
39424  SCIPconshdlrGetNPresolCalls(conshdlr),
39425  SCIPconshdlrGetNFixedVars(conshdlr),
39426  SCIPconshdlrGetNAggrVars(conshdlr),
39427  SCIPconshdlrGetNChgVarTypes(conshdlr),
39428  SCIPconshdlrGetNChgBds(conshdlr),
39429  SCIPconshdlrGetNAddHoles(conshdlr),
39430  SCIPconshdlrGetNDelConss(conshdlr),
39431  SCIPconshdlrGetNAddConss(conshdlr),
39432  SCIPconshdlrGetNChgSides(conshdlr),
39433  SCIPconshdlrGetNChgCoefs(conshdlr));
39434  }
39435  }
39436 
39437  /* root node bound changes */
39438  SCIPmessageFPrintInfo(scip->messagehdlr, file, " root node : - - - %10d - - %10d - - - - -\n",
39439  scip->stat->nrootintfixings, scip->stat->nrootboundchgs);
39440 }
39441 
39442 /** print constraint statistics to output file */
39443 static
39445  SCIP* scip, /**< SCIP data structure */
39446  FILE* file /**< output file */
39447  )
39448 {
39449  int i;
39450 
39451  assert(scip != NULL);
39452  assert(scip->set != NULL);
39453 
39454  /* Add maximal number of constraints of the same type? So far this information is not added because of lack of space. */
39455  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Constraints : Number MaxNumber #Separate #Propagate #EnfoLP #EnfoPS #Check #ResProp Cutoffs DomReds Cuts Applied Conss Children\n");
39456 
39457  for( i = 0; i < scip->set->nconshdlrs; ++i )
39458  {
39459  SCIP_CONSHDLR* conshdlr;
39460  int startnactiveconss;
39461  int maxnactiveconss;
39462 
39463  conshdlr = scip->set->conshdlrs[i];
39464  startnactiveconss = SCIPconshdlrGetStartNActiveConss(conshdlr);
39465  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
39466  if( maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr) )
39467  {
39468  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
39469  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10d%c%10d %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
39470  startnactiveconss,
39471  maxnactiveconss > startnactiveconss ? '+' : ' ',
39472  maxnactiveconss,
39473  SCIPconshdlrGetNSepaCalls(conshdlr),
39474  SCIPconshdlrGetNPropCalls(conshdlr),
39475  SCIPconshdlrGetNEnfoLPCalls(conshdlr),
39476  SCIPconshdlrGetNEnfoPSCalls(conshdlr),
39477  SCIPconshdlrGetNCheckCalls(conshdlr),
39478  SCIPconshdlrGetNRespropCalls(conshdlr),
39479  SCIPconshdlrGetNCutoffs(conshdlr),
39480  SCIPconshdlrGetNDomredsFound(conshdlr),
39481  SCIPconshdlrGetNCutsFound(conshdlr),
39482  SCIPconshdlrGetNCutsApplied(conshdlr),
39483  SCIPconshdlrGetNConssFound(conshdlr),
39484  SCIPconshdlrGetNChildren(conshdlr));
39485  }
39486  }
39487 }
39488 
39489 /** print constraint timing statistics to output file */
39490 static
39492  SCIP* scip, /**< SCIP data structure */
39493  FILE* file /**< output file */
39494  )
39495 {
39496  int i;
39497 
39498  assert(scip != NULL);
39499  assert(scip->set != NULL);
39500 
39501  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Constraint Timings : TotalTime SetupTime Separate Propagate EnfoLP EnfoPS Check ResProp SB-Prop\n");
39502 
39503  for( i = 0; i < scip->set->nconshdlrs; ++i )
39504  {
39505  SCIP_CONSHDLR* conshdlr;
39506  int maxnactiveconss;
39507 
39508  conshdlr = scip->set->conshdlrs[i];
39509  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
39510  if( maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr) )
39511  {
39512  SCIP_Real totaltime;
39513 
39514  totaltime = SCIPconshdlrGetSepaTime(conshdlr) + SCIPconshdlrGetPropTime(conshdlr)
39516  + SCIPconshdlrGetEnfoLPTime(conshdlr)
39517  + SCIPconshdlrGetEnfoPSTime(conshdlr)
39518  + SCIPconshdlrGetCheckTime(conshdlr)
39519  + SCIPconshdlrGetRespropTime(conshdlr)
39520  + SCIPconshdlrGetSetupTime(conshdlr);
39521 
39522  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
39523  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
39524  totaltime,
39525  SCIPconshdlrGetSetupTime(conshdlr),
39526  SCIPconshdlrGetSepaTime(conshdlr),
39527  SCIPconshdlrGetPropTime(conshdlr),
39528  SCIPconshdlrGetEnfoLPTime(conshdlr),
39529  SCIPconshdlrGetEnfoPSTime(conshdlr),
39530  SCIPconshdlrGetCheckTime(conshdlr),
39531  SCIPconshdlrGetRespropTime(conshdlr),
39533  }
39534  }
39535 }
39536 
39537 /** print propagator statistics to output file */
39538 static
39540  SCIP* scip, /**< SCIP data structure */
39541  FILE* file /**< output file */
39542  )
39543 {
39544  int i;
39545 
39546  assert(scip != NULL);
39547  assert(scip->set != NULL);
39548 
39549  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Propagators : #Propagate #ResProp Cutoffs DomReds\n");
39550 
39551  /* sort propagaters w.r.t. their name */
39552  SCIPsetSortPropsName(scip->set);
39553 
39554  for( i = 0; i < scip->set->nprops; ++i )
39555  {
39556  SCIP_PROP* prop;
39557  prop = scip->set->props[i];
39558 
39559  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
39560  SCIPpropGetName(prop),
39561  SCIPpropGetNCalls(prop),
39563  SCIPpropGetNCutoffs(prop),
39564  SCIPpropGetNDomredsFound(prop));
39565  }
39566 
39567  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Propagator Timings : TotalTime SetupTime Presolve Propagate ResProp SB-Prop\n");
39568 
39569  for( i = 0; i < scip->set->nprops; ++i )
39570  {
39571  SCIP_PROP* prop;
39572  SCIP_Real totaltime;
39573 
39574  prop = scip->set->props[i];
39575  totaltime = SCIPpropGetPresolTime(prop) + SCIPpropGetTime(prop) + SCIPpropGetRespropTime(prop)
39577 
39578  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpropGetName(prop));
39579  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
39580  totaltime,
39581  SCIPpropGetSetupTime(prop),
39582  SCIPpropGetPresolTime(prop),
39583  SCIPpropGetTime(prop),
39584  SCIPpropGetRespropTime(prop),
39586  }
39587 }
39588 
39589 /** print conflict statistic to given output stream */
39590 static
39592  SCIP* scip, /**< SCIP data structure */
39593  FILE* file /**< output file */
39594  )
39595 {
39596  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Conflict Analysis : Time Calls Success DomReds Conflicts Literals Reconvs ReconvLits LP Iters\n");
39597  SCIPmessageFPrintInfo(scip->messagehdlr, file, " propagation : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " - %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT " %10.1f -\n",
39609  SCIPmessageFPrintInfo(scip->messagehdlr, file, " infeasible LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " - %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT "\n",
39622  SCIPmessageFPrintInfo(scip->messagehdlr, file, " bound exceed. LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " - %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT "\n",
39635  SCIPmessageFPrintInfo(scip->messagehdlr, file, " strong branching : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " - %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT "\n",
39648  SCIPmessageFPrintInfo(scip->messagehdlr, file, " pseudo solution : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " - %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT " %10.1f -\n",
39660  SCIPmessageFPrintInfo(scip->messagehdlr, file, " applied globally : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.1f - - -\n",
39667  SCIPmessageFPrintInfo(scip->messagehdlr, file, " applied locally : - - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.1f - - -\n",
39673 }
39674 
39675 static
39677  SCIP* scip, /**< SCIP data structure */
39678  FILE* file /**< output file */
39679  )
39680 {
39681  int i;
39682 
39683  assert(scip != NULL);
39684  assert(scip->set != NULL);
39685 
39686  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Separators : ExecTime SetupTime Calls Cutoffs DomReds Cuts Applied Conss\n");
39687  SCIPmessageFPrintInfo(scip->messagehdlr, file, " cut pool : %10.2f %10" SCIP_LONGINT_FORMAT " - - %10" SCIP_LONGINT_FORMAT " - - (maximal pool size: %d)\n",
39688  SCIPcutpoolGetTime(scip->cutpool),
39692 
39693  /* sort separators w.r.t. their name */
39694  SCIPsetSortSepasName(scip->set);
39695 
39696  for( i = 0; i < scip->set->nsepas; ++i )
39697  {
39698  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
39699  SCIPsepaGetName(scip->set->sepas[i]),
39700  SCIPsepaGetTime(scip->set->sepas[i]),
39701  SCIPsepaGetSetupTime(scip->set->sepas[i]),
39702  SCIPsepaGetNCalls(scip->set->sepas[i]),
39703  SCIPsepaGetNCutoffs(scip->set->sepas[i]),
39704  SCIPsepaGetNDomredsFound(scip->set->sepas[i]),
39705  SCIPsepaGetNCutsFound(scip->set->sepas[i]),
39706  SCIPsepaGetNCutsApplied(scip->set->sepas[i]),
39707  SCIPsepaGetNConssFound(scip->set->sepas[i]));
39708  }
39709 }
39710 
39711 static
39713  SCIP* scip, /**< SCIP data structure */
39714  FILE* file /**< output file */
39715  )
39716 {
39717  int i;
39718 
39719  assert(scip != NULL);
39720  assert(scip->set != NULL);
39721 
39722  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Pricers : ExecTime SetupTime Calls Vars\n");
39723  SCIPmessageFPrintInfo(scip->messagehdlr, file, " problem variables: %10.2f - %10d %10d\n",
39727 
39728  /* sort pricers w.r.t. their name */
39729  SCIPsetSortPricersName(scip->set);
39730 
39731  for( i = 0; i < scip->set->nactivepricers; ++i )
39732  {
39733  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10d %10d\n",
39734  SCIPpricerGetName(scip->set->pricers[i]),
39735  SCIPpricerGetTime(scip->set->pricers[i]),
39736  SCIPpricerGetSetupTime(scip->set->pricers[i]),
39737  SCIPpricerGetNCalls(scip->set->pricers[i]),
39738  SCIPpricerGetNVarsFound(scip->set->pricers[i]));
39739  }
39740 }
39741 
39742 static
39744  SCIP* scip, /**< SCIP data structure */
39745  FILE* file /**< output file */
39746  )
39747 {
39748  int i;
39749 
39750  assert(scip != NULL);
39751  assert(scip->set != NULL);
39752 
39753  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Branching Rules : ExecTime SetupTime BranchLP BranchExt BranchPS Cutoffs DomReds Cuts Conss Children\n");
39754 
39755  /* sort branching rules w.r.t. their name */
39757 
39758  for( i = 0; i < scip->set->nbranchrules; ++i )
39759  {
39760  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
39772  }
39773 }
39774 
39775 static
39777  SCIP* scip, /**< SCIP data structure */
39778  FILE* file /**< output file */
39779  )
39780 {
39781  int ndivesets = 0;
39782  int i;
39783 
39784  assert(scip != NULL);
39785  assert(scip->set != NULL);
39786  assert(scip->tree != NULL);
39787 
39788  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Primal Heuristics : ExecTime SetupTime Calls Found\n");
39789  SCIPmessageFPrintInfo(scip->messagehdlr, file, " LP solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT "\n",
39791  scip->stat->nlpsolsfound);
39792  SCIPmessageFPrintInfo(scip->messagehdlr, file, " pseudo solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT "\n",
39794  scip->stat->npssolsfound);
39795  SCIPmessageFPrintInfo(scip->messagehdlr, file, " strong branching : %10.2f - - %10" SCIP_LONGINT_FORMAT "\n",
39797  scip->stat->nsbsolsfound);
39798 
39799  /* sort heuristics w.r.t. their names */
39800  SCIPsetSortHeursName(scip->set);
39801 
39802  for( i = 0; i < scip->set->nheurs; ++i )
39803  {
39804  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
39805  SCIPheurGetName(scip->set->heurs[i]),
39806  SCIPheurGetTime(scip->set->heurs[i]),
39807  SCIPheurGetSetupTime(scip->set->heurs[i]),
39808  SCIPheurGetNCalls(scip->set->heurs[i]),
39809  SCIPheurGetNSolsFound(scip->set->heurs[i]));
39810 
39811  /* count heuristics that use diving; needed to determine output later */
39812  ndivesets += SCIPheurGetNDivesets(scip->set->heurs[i]);
39813  }
39814 
39815  SCIPmessageFPrintInfo(scip->messagehdlr, file, " other solutions : - - - %10" SCIP_LONGINT_FORMAT "\n",
39816  scip->stat->nexternalsolsfound);
39817 
39818  if ( ndivesets > 0 )
39819  {
39820  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Diving Statistics : Calls Nodes LP Iters Backtracks MinDepth MaxDepth AvgDepth NLeafSols MinSolDpt MaxSolDpt AvgSolDpt\n");
39821  for( i = 0; i < scip->set->nheurs; ++i )
39822  {
39823  int s;
39824  for( s = 0; s < SCIPheurGetNDivesets(scip->set->heurs[i]); ++s )
39825  {
39826  SCIP_DIVESET* diveset = SCIPheurGetDivesets(scip->set->heurs[i])[s];
39827  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10d", SCIPdivesetGetName(diveset), SCIPdivesetGetNCalls(diveset));
39828  if( SCIPdivesetGetNCalls(diveset) > 0 )
39829  {
39830  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10d %10d %10.1f",
39831  SCIPdivesetGetNProbingNodes(diveset),
39832  SCIPdivesetGetNLPIterations(diveset),
39833  SCIPdivesetGetNBacktracks(diveset),
39834  SCIPdivesetGetMinDepth(diveset),
39835  SCIPdivesetGetMaxDepth(diveset),
39836  SCIPdivesetGetAvgDepth(diveset));
39837  if( SCIPdivesetGetNSolutionCalls(diveset) > 0 )
39838  {
39839  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10d %10d %10d %10.1f\n",
39844  }
39845  else
39846  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - - -\n");
39847  }
39848  else
39849  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - - - - - - - - -\n");
39850  }
39851  }
39852  }
39853 }
39854 
39855 /* print compression statistics if tree reoptimization is enabled */
39856 static
39858  SCIP* scip, /**< SCIP data structure */
39859  FILE* file /**< output file */
39860  )
39861 {
39862  int i;
39863 
39864  assert(scip != NULL);
39865 
39866  /* only print compression statistics if tree reoptimization is enabled */
39867  if( !scip->set->reopt_enable )
39868  return;
39869 
39870  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Tree Compressions : ExecTime SetupTime Calls Found\n");
39871 
39872  /* sort compressions w.r.t. their names */
39873  SCIPsetSortComprsName(scip->set);
39874 
39875  for( i = 0; i < scip->set->ncomprs; ++i )
39876  {
39877  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
39878  SCIPcomprGetName(scip->set->comprs[i]),
39879  SCIPcomprGetTime(scip->set->comprs[i]),
39880  SCIPcomprGetSetupTime(scip->set->comprs[i]),
39881  SCIPcomprGetNCalls(scip->set->comprs[i]),
39882  SCIPcomprGetNFound(scip->set->comprs[i]));
39883  }
39884 }
39885 
39886 static
39888  SCIP* scip, /**< SCIP data structure */
39889  FILE* file /**< output file */
39890  )
39891 {
39892  assert(scip != NULL);
39893  assert(scip->stat != NULL);
39894  assert(scip->lp != NULL);
39895 
39896  SCIPmessageFPrintInfo(scip->messagehdlr, file, "LP : Time Calls Iterations Iter/call Iter/sec Time-0-It Calls-0-It\n");
39897 
39898  SCIPmessageFPrintInfo(scip->messagehdlr, file, " primal LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
39900  scip->stat->nprimallps + scip->stat->nprimalzeroitlps,
39901  scip->stat->nprimallpiterations,
39902  scip->stat->nprimallps > 0 ? (SCIP_Real)scip->stat->nprimallpiterations/(SCIP_Real)scip->stat->nprimallps : 0.0);
39903  if( SCIPclockGetTime(scip->stat->primallptime) >= 0.01 )
39905  else
39906  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
39907  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
39908  scip->stat->primalzeroittime,
39909  scip->stat->nprimalzeroitlps);
39910 
39911  SCIPmessageFPrintInfo(scip->messagehdlr, file, " dual LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
39913  scip->stat->nduallps + scip->stat->ndualzeroitlps,
39914  scip->stat->nduallpiterations,
39915  scip->stat->nduallps > 0 ? (SCIP_Real)scip->stat->nduallpiterations/(SCIP_Real)scip->stat->nduallps : 0.0);
39916  if( SCIPclockGetTime(scip->stat->duallptime) >= 0.01 )
39918  else
39919  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
39920  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
39921  scip->stat->dualzeroittime,
39922  scip->stat->ndualzeroitlps);
39923 
39924  SCIPmessageFPrintInfo(scip->messagehdlr, file, " lex dual LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
39926  scip->stat->nlexduallps,
39927  scip->stat->nlexduallpiterations,
39928  scip->stat->nlexduallps > 0 ? (SCIP_Real)scip->stat->nlexduallpiterations/(SCIP_Real)scip->stat->nlexduallps : 0.0);
39929  if( SCIPclockGetTime(scip->stat->lexduallptime) >= 0.01 )
39931  else
39932  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
39933 
39934  SCIPmessageFPrintInfo(scip->messagehdlr, file, " barrier LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
39936  scip->stat->nbarrierlps,
39937  scip->stat->nbarrierlpiterations,
39938  scip->stat->nbarrierlps > 0 ? (SCIP_Real)scip->stat->nbarrierlpiterations/(SCIP_Real)scip->stat->nbarrierlps : 0.0);
39939  if( SCIPclockGetTime(scip->stat->barrierlptime) >= 0.01 )
39941  else
39942  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
39943  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
39944  scip->stat->barrierzeroittime,
39945  scip->stat->nbarrierzeroitlps);
39946 
39947  SCIPmessageFPrintInfo(scip->messagehdlr, file, " diving/probing LP: %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
39949  scip->stat->ndivinglps,
39950  scip->stat->ndivinglpiterations,
39951  scip->stat->ndivinglps > 0 ? (SCIP_Real)scip->stat->ndivinglpiterations/(SCIP_Real)scip->stat->ndivinglps : 0.0);
39952  if( SCIPclockGetTime(scip->stat->divinglptime) >= 0.01 )
39954  else
39955  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
39956 
39957  SCIPmessageFPrintInfo(scip->messagehdlr, file, " strong branching : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
39959  scip->stat->nstrongbranchs,
39960  scip->stat->nsblpiterations,
39961  scip->stat->nstrongbranchs > 0 ? (SCIP_Real)scip->stat->nsblpiterations/(SCIP_Real)scip->stat->nstrongbranchs : 0.0);
39962  if( SCIPclockGetTime(scip->stat->strongbranchtime) >= 0.01 )
39964  else
39965  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
39966 
39967  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (at root node) : - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f -\n",
39968  scip->stat->nrootstrongbranchs,
39969  scip->stat->nrootsblpiterations,
39970  scip->stat->nrootstrongbranchs > 0
39972 
39973  SCIPmessageFPrintInfo(scip->messagehdlr, file, " conflict analysis: %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
39975  scip->stat->nconflictlps,
39976  scip->stat->nconflictlpiterations,
39977  scip->stat->nconflictlps > 0 ? (SCIP_Real)scip->stat->nconflictlpiterations/(SCIP_Real)scip->stat->nconflictlps : 0.0);
39978  if( SCIPclockGetTime(scip->stat->conflictlptime) >= 0.01 )
39980  else
39981  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
39982 }
39983 
39984 static
39986  SCIP* scip, /**< SCIP data structure */
39987  FILE* file /**< output file */
39988  )
39989 {
39990  assert(scip != NULL);
39991  assert(scip->stat != NULL);
39992 
39993  if( scip->nlp == NULL )
39994  return;
39995 
39996  SCIPmessageFPrintInfo(scip->messagehdlr, file, "NLP : Time Calls\n");
39997 
39998  SCIPmessageFPrintInfo(scip->messagehdlr, file, " all NLPs : %10.2f %10" SCIP_LONGINT_FORMAT "\n",
40000  scip->stat->nnlps);
40001 }
40002 
40003 static
40005  SCIP* scip, /**< SCIP data structure */
40006  FILE* file /**< output file */
40007  )
40008 {
40009  int i;
40010 
40011  assert(scip != NULL);
40012  assert(scip->set != NULL);
40013 
40014  if( scip->set->nrelaxs == 0 )
40015  return;
40016 
40017  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Relaxators : Time Calls\n");
40018 
40019  /* sort relaxators w.r.t. their name */
40020  SCIPsetSortRelaxsName(scip->set);
40021 
40022  for( i = 0; i < scip->set->nrelaxs; ++i )
40023  {
40024  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10" SCIP_LONGINT_FORMAT "\n",
40025  SCIPrelaxGetName(scip->set->relaxs[i]),
40026  SCIPrelaxGetTime(scip->set->relaxs[i]),
40027  SCIPrelaxGetNCalls(scip->set->relaxs[i]));
40028  }
40029 }
40030 
40031 static
40033  SCIP* scip, /**< SCIP data structure */
40034  FILE* file /**< output file */
40035  )
40036 {
40037  assert(scip != NULL);
40038  assert(scip->stat != NULL);
40039  assert(scip->tree != NULL);
40040 
40041  SCIPmessageFPrintInfo(scip->messagehdlr, file, "B&B Tree :\n");
40042  SCIPmessageFPrintInfo(scip->messagehdlr, file, " number of runs : %10d\n", scip->stat->nruns);
40043  SCIPmessageFPrintInfo(scip->messagehdlr, file,
40044  " nodes : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " internal, %" SCIP_LONGINT_FORMAT " leaves)\n",
40045  scip->stat->nnodes, scip->stat->ninternalnodes, scip->stat->nnodes - scip->stat->ninternalnodes );
40046  SCIPmessageFPrintInfo(scip->messagehdlr, file,
40047  " nodes (total) : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " internal, %" SCIP_LONGINT_FORMAT " leaves)\n",
40049  SCIPmessageFPrintInfo(scip->messagehdlr, file, " nodes left : %10d\n", SCIPtreeGetNNodes(scip->tree));
40050  SCIPmessageFPrintInfo(scip->messagehdlr, file, " max depth : %10d\n", scip->stat->maxdepth);
40051  SCIPmessageFPrintInfo(scip->messagehdlr, file, " max depth (total): %10d\n", scip->stat->maxtotaldepth);
40052  SCIPmessageFPrintInfo(scip->messagehdlr, file, " backtracks : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nbacktracks,
40053  scip->stat->nnodes > 0 ? 100.0 * (SCIP_Real)scip->stat->nbacktracks / (SCIP_Real)scip->stat->nnodes : 0.0);
40054  SCIPmessageFPrintInfo(scip->messagehdlr, file, " delayed cutoffs : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->ndelayedcutoffs);
40055  SCIPmessageFPrintInfo(scip->messagehdlr, file, " repropagations : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " domain reductions, %" SCIP_LONGINT_FORMAT " cutoffs)\n",
40056  scip->stat->nreprops, scip->stat->nrepropboundchgs, scip->stat->nrepropcutoffs);
40057  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg switch length: %10.2f\n",
40058  scip->stat->nnodes > 0
40059  ? (SCIP_Real)(scip->stat->nactivatednodes + scip->stat->ndeactivatednodes) / (SCIP_Real)scip->stat->nnodes : 0.0);
40060  SCIPmessageFPrintInfo(scip->messagehdlr, file, " switching time : %10.2f\n", SCIPclockGetTime(scip->stat->nodeactivationtime));
40061 }
40062 
40063 /** display solution statistics */
40064 static
40066  SCIP* scip, /**< SCIP data structure */
40067  FILE* file /**< output file */
40068  )
40069 {
40070  SCIP_Real primalbound;
40071  SCIP_Real dualbound;
40072  SCIP_Real bestsol;
40073  SCIP_Real gap;
40074  SCIP_Real firstprimalbound;
40075  SCIP_Bool objlimitreached;
40076  char limsolstring[SCIP_MAXSTRLEN];
40077 
40078  assert(scip != NULL);
40079  assert(scip->stat != NULL);
40080  assert(scip->primal != NULL);
40081 
40082  primalbound = getPrimalbound(scip);
40083  dualbound = getDualbound(scip);
40084  gap = SCIPgetGap(scip);
40085 
40086  objlimitreached = FALSE;
40087  if( SCIPgetStage(scip) == SCIP_STAGE_SOLVED && scip->primal->nlimsolsfound == 0
40088  && !SCIPisInfinity(scip, primalbound) )
40089  objlimitreached = TRUE;
40090 
40091  if( scip->primal->nsolsfound != scip->primal->nlimsolsfound )
40092  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN, ", %" SCIP_LONGINT_FORMAT " respecting the objective limit", scip->primal->nlimsolsfound);
40093  else
40094  limsolstring[0] = '\0';
40095 
40096  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Solution :\n");
40097  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Solutions found : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " improvements%s)\n",
40098  scip->primal->nsolsfound, scip->primal->nbestsolsfound, limsolstring);
40099 
40100  if( objlimitreached || SCIPsetIsInfinity(scip->set, REALABS(primalbound)) )
40101  {
40102  if( scip->set->stage == SCIP_STAGE_SOLVED )
40103  {
40104  if( scip->primal->nlimsolsfound == 0 )
40105  {
40106  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
40107  {
40108  assert(!objlimitreached);
40109  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible or unbounded\n");
40110  }
40111  else
40112  {
40113  assert(SCIPgetStatus(scip) == SCIP_STATUS_INFEASIBLE);
40114  if( objlimitreached )
40115  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible (objective limit reached)\n");
40116  else
40117  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible\n");
40118  }
40119  }
40120  else
40121  {
40122  assert(!objlimitreached);
40123  assert(SCIPgetStatus(scip) == SCIP_STATUS_UNBOUNDED);
40124  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : unbounded\n");
40125  }
40126  }
40127  else
40128  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : -\n");
40129  }
40130  else
40131  {
40132  if( scip->primal->nlimsolsfound == 0 )
40133  {
40134  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : %+21.14e", primalbound);
40135  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (user objective limit)\n");
40136  }
40137  else
40138  {
40139  /* display first primal bound line */
40140  firstprimalbound = scip->stat->firstprimalbound;
40141  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First Solution : %+21.14e", firstprimalbound);
40142 
40143  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (in run %d, after %" SCIP_LONGINT_FORMAT " nodes, %.2f seconds, depth %d, found by <%s>)\n",
40144  scip->stat->nrunsbeforefirst,
40145  scip->stat->nnodesbeforefirst,
40146  scip->stat->firstprimaltime,
40147  scip->stat->firstprimaldepth,
40148  ( scip->stat->firstprimalheur != NULL )
40149  ? ( SCIPheurGetName(scip->stat->firstprimalheur) )
40150  : (( scip->stat->nrunsbeforefirst == 0 ) ? "initial" : "relaxation"));
40151 
40152  if( SCIPisInfinity(scip, scip->stat->firstsolgap) )
40153  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap First Sol. : infinite\n");
40154  else
40155  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap First Sol. : %10.2f %%\n", 100.0 * scip->stat->firstsolgap);
40156 
40157  if( SCIPisInfinity(scip, scip->stat->lastsolgap) )
40158  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap Last Sol. : infinite\n");
40159  else
40160  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap Last Sol. : %10.2f %%\n", 100.0 * scip->stat->lastsolgap);
40161 
40162  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : %+21.14e", primalbound);
40163 
40164  /* display (best) primal bound */
40165  bestsol = SCIPsolGetObj(scip->primal->sols[0], scip->set, scip->transprob, scip->origprob);
40166  bestsol = SCIPretransformObj(scip, bestsol);
40167  if( SCIPsetIsGT(scip->set, bestsol, primalbound) )
40168  {
40169  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (user objective limit)\n");
40170  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Best Solution : %+21.14e", bestsol);
40171  }
40172  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (in run %d, after %" SCIP_LONGINT_FORMAT " nodes, %.2f seconds, depth %d, found by <%s>)\n",
40173  SCIPsolGetRunnum(scip->primal->sols[0]),
40174  SCIPsolGetNodenum(scip->primal->sols[0]),
40175  SCIPsolGetTime(scip->primal->sols[0]),
40176  SCIPsolGetDepth(scip->primal->sols[0]),
40177  SCIPsolGetHeur(scip->primal->sols[0]) != NULL
40179  : (SCIPsolGetRunnum(scip->primal->sols[0]) == 0 ? "initial" : "relaxation"));
40180  }
40181  }
40182  if( objlimitreached || SCIPsetIsInfinity(scip->set, REALABS(dualbound)) )
40183  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Dual Bound : -\n");
40184  else
40185  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Dual Bound : %+21.14e\n", dualbound);
40186  if( SCIPsetIsInfinity(scip->set, gap) )
40187  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap : infinite\n");
40188  else
40189  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap : %10.2f %%\n", 100.0 * gap);
40190 
40191  if( scip->set->misc_calcintegral )
40192  {
40193  if( SCIPgetStatus(scip) == SCIP_STATUS_INFEASIBLE )
40194  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : - (problem infeasible)\n");
40195  else
40196  {
40197  SCIP_Real avggap;
40198 
40199  avggap = 0.0;
40200 
40201  if( !SCIPisFeasZero(scip, SCIPgetSolvingTime(scip)) )
40202  avggap = scip->stat->primaldualintegral/SCIPgetSolvingTime(scip);
40203 
40204  /* caution: this assert is non-deterministic since it depends on the solving time */
40205  assert(0.0 <= avggap && SCIPisLE(scip, avggap, 100.0));
40206 
40207  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : %10.2f %% (%.2f primal-dual integral)\n",
40208  avggap, scip->stat->primaldualintegral);
40209  }
40210  }
40211  else
40212  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : - (not evaluated)\n");
40213 }
40214 
40215 /** display first LP statistics */
40216 static
40218  SCIP* scip, /**< SCIP data structure */
40219  FILE* file /**< output file */
40220  )
40221 {
40222  SCIP_Real dualboundroot;
40223  SCIP_Real firstdualboundroot;
40224  SCIP_Real firstlptime;
40225  SCIP_Real firstlpspeed;
40226 
40227  assert(scip != NULL);
40228  assert(scip->stat != NULL);
40229  assert(scip->primal != NULL);
40230 
40231  dualboundroot = SCIPgetDualboundRoot(scip);
40232  firstdualboundroot = SCIPgetFirstLPDualboundRoot(scip);
40233  firstlptime = SCIPgetFirstLPTime(scip);
40234 
40235  if( firstlptime > 0.0 )
40236  firstlpspeed = (SCIP_Real)scip->stat->nrootfirstlpiterations/firstlptime;
40237  else
40238  firstlpspeed = 0.0;
40239 
40240  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Root Node :\n");
40241  if( SCIPsetIsInfinity(scip->set, REALABS(firstdualboundroot)) )
40242  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP value : -\n");
40243  else
40244  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP value : %+21.14e\n", firstdualboundroot);
40245  if( firstlpspeed > 0.0 )
40246  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Iters : %10" SCIP_LONGINT_FORMAT " (%.2f Iter/sec)\n",
40248  (SCIP_Real)scip->stat->nrootfirstlpiterations/firstlptime);
40249  else
40250  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Iters : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->nrootfirstlpiterations);
40251  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Time : %10.2f\n", firstlptime);
40252 
40253  if( SCIPsetIsInfinity(scip->set, REALABS(dualboundroot)) )
40254  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Dual Bound : -\n");
40255  else
40256  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Dual Bound : %+21.14e\n", dualboundroot);
40257  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Root Iters : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->nrootlpiterations);
40258 
40259 }
40260 
40261 /** display timing statistics */
40262 static
40264  SCIP* scip, /**< SCIP data structure */
40265  FILE* file /**< output file */
40266  )
40267 {
40268  SCIP_Real readingtime;
40269 
40270  assert(SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM);
40271 
40272  readingtime = SCIPgetReadingTime(scip);
40273 
40274  if( SCIPgetStage(scip) == SCIP_STAGE_PROBLEM )
40275  {
40276  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Total Time : %10.2f\n", readingtime);
40277  SCIPmessageFPrintInfo(scip->messagehdlr, file, " reading : %10.2f\n", readingtime);
40278  }
40279  else
40280  {
40281  SCIP_Real totaltime;
40282  SCIP_Real solvingtime;
40283 
40284  solvingtime = SCIPclockGetTime(scip->stat->solvingtime);
40285 
40286  if( scip->set->time_reading )
40287  totaltime = solvingtime;
40288  else
40289  totaltime = solvingtime + readingtime;
40290 
40291  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Total Time : %10.2f\n", totaltime);
40292  SCIPmessageFPrintInfo(scip->messagehdlr, file, " solving : %10.2f\n", solvingtime);
40293  SCIPmessageFPrintInfo(scip->messagehdlr, file, " presolving : %10.2f (included in solving)\n", SCIPclockGetTime(scip->stat->presolvingtime));
40294  SCIPmessageFPrintInfo(scip->messagehdlr, file, " reading : %10.2f%s\n", readingtime, scip->set->time_reading ? " (included in solving)" : "");
40295 
40296  if( scip->stat->ncopies > 0 )
40297  {
40298  SCIP_Real copytime;
40299 
40300  copytime = SCIPclockGetTime(scip->stat->copyclock);
40301 
40302  SCIPmessageFPrintInfo(scip->messagehdlr, file, " copying : %10.2f (%d #copies) (minimal %.2f, maximal %.2f, average %.2f)\n",
40303  copytime, scip->stat->ncopies, scip->stat->mincopytime, scip->stat->maxcopytime, copytime / scip->stat->ncopies);
40304  }
40305  else
40306  SCIPmessageFPrintInfo(scip->messagehdlr, file, " copying : %10.2f %s\n", 0.0, "(0 times copied the problem)");
40307  }
40308 }
40309 
40310 /** outputs solving statistics
40311  *
40312  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40313  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40314  *
40315  * @note If limits have been changed between the solution and the call to this function, the status is recomputed and
40316  * thus may to correspond to the original status.
40317  *
40318  * @pre This method can be called if SCIP is in one of the following stages:
40319  * - \ref SCIP_STAGE_INIT
40320  * - \ref SCIP_STAGE_PROBLEM
40321  * - \ref SCIP_STAGE_TRANSFORMED
40322  * - \ref SCIP_STAGE_INITPRESOLVE
40323  * - \ref SCIP_STAGE_PRESOLVING
40324  * - \ref SCIP_STAGE_EXITPRESOLVE
40325  * - \ref SCIP_STAGE_PRESOLVED
40326  * - \ref SCIP_STAGE_SOLVING
40327  * - \ref SCIP_STAGE_SOLVED
40328  */
40330  SCIP* scip, /**< SCIP data structure */
40331  FILE* file /**< output file (or NULL for standard output) */
40332  )
40333 {
40334  SCIP_CALL( checkStage(scip, "SCIPprintStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40335 
40336  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP Status : ");
40337  SCIP_CALL( SCIPprintStage(scip, file) );
40338  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
40339 
40340  switch( scip->set->stage )
40341  {
40342  case SCIP_STAGE_INIT:
40343  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem : no problem exists.\n");
40344  return SCIP_OKAY;
40345 
40346  case SCIP_STAGE_PROBLEM:
40347  {
40348  printTimingStatistics(scip, file);
40349  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem :\n");
40350  SCIPprobPrintStatistics(scip->origprob, scip->messagehdlr, file);
40351  return SCIP_OKAY;
40352  }
40355  {
40356  printTimingStatistics(scip, file);
40357  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem :\n");
40358  SCIPprobPrintStatistics(scip->origprob, scip->messagehdlr, file);
40359  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolved Problem :\n");
40360  SCIPprobPrintStatistics(scip->transprob, scip->messagehdlr, file);
40361  printPresolverStatistics(scip, file);
40362  printConstraintStatistics(scip, file);
40363  printConstraintTimingStatistics(scip, file);
40364  printPropagatorStatistics(scip, file);
40365  printConflictStatistics(scip, file);
40366  return SCIP_OKAY;
40367  }
40368  case SCIP_STAGE_PRESOLVING:
40370  case SCIP_STAGE_PRESOLVED:
40371  {
40372  printTimingStatistics(scip, file);
40373  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem :\n");
40374  SCIPprobPrintStatistics(scip->origprob, scip->messagehdlr, file);
40375  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolved Problem :\n");
40376  SCIPprobPrintStatistics(scip->transprob, scip->messagehdlr, file);
40377  printPresolverStatistics(scip, file);
40378  printConstraintStatistics(scip, file);
40379  printConstraintTimingStatistics(scip, file);
40380  printPropagatorStatistics(scip, file);
40381  printConflictStatistics(scip, file);
40382  printHeuristicStatistics(scip, file);
40383  printCompressionStatistics(scip, file);
40384  printSolutionStatistics(scip, file);
40385  return SCIP_OKAY;
40386  }
40387  case SCIP_STAGE_SOLVING:
40388  case SCIP_STAGE_SOLVED:
40389  {
40390  printTimingStatistics(scip, file);
40391  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem :\n");
40392  SCIPprobPrintStatistics(scip->origprob, scip->messagehdlr, file);
40393  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolved Problem :\n");
40394  SCIPprobPrintStatistics(scip->transprob, scip->messagehdlr, file);
40395  printPresolverStatistics(scip, file);
40396  printConstraintStatistics(scip, file);
40397  printConstraintTimingStatistics(scip, file);
40398  printPropagatorStatistics(scip, file);
40399  printConflictStatistics(scip, file);
40400  printSeparatorStatistics(scip, file);
40401  printPricerStatistics(scip, file);
40402  printBranchruleStatistics(scip, file);
40403  printHeuristicStatistics(scip, file);
40404  printCompressionStatistics(scip, file);
40405  printLPStatistics(scip, file);
40406  printNLPStatistics(scip, file);
40407  printRelaxatorStatistics(scip, file);
40408  printTreeStatistics(scip, file);
40409  printRootStatistics(scip, file);
40410  printSolutionStatistics(scip, file);
40411 
40412  return SCIP_OKAY;
40413  }
40414  default:
40415  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
40416  return SCIP_INVALIDCALL;
40417  } /*lint !e788*/
40418 }
40419 
40420 /** outputs reoptimization statistics
40421  *
40422  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40423  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40424  *
40425  * @pre This method can be called if SCIP is in one of the following stages:
40426  * - \ref SCIP_STAGE_INIT
40427  * - \ref SCIP_STAGE_PROBLEM
40428  * - \ref SCIP_STAGE_TRANSFORMED
40429  * - \ref SCIP_STAGE_INITPRESOLVE
40430  * - \ref SCIP_STAGE_PRESOLVING
40431  * - \ref SCIP_STAGE_EXITPRESOLVE
40432  * - \ref SCIP_STAGE_PRESOLVED
40433  * - \ref SCIP_STAGE_SOLVING
40434  * - \ref SCIP_STAGE_SOLVED
40435  */
40437  SCIP* scip, /**< SCIP data structure */
40438  FILE* file /**< output file (or NULL for standard output) */
40439  )
40440 {
40441  int nsolsupdated;
40442  int nimprovingsols;
40443  SCIP_Real solving;
40444  SCIP_Real presolving;
40445  SCIP_Real updatetime;
40446 
40447  SCIP_CALL( checkStage(scip, "SCIPprintReoptStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40448 
40449  /* skip if reoptimization is disabled */
40450  if( !scip->set->reopt_enable )
40451  return SCIP_OKAY;
40452 
40453  nsolsupdated = SCIPreoptGetNCheckedSols(scip->reopt);
40454  nimprovingsols = SCIPreoptGetNImprovingSols(scip->reopt);
40455 
40456  solving = SCIPclockGetTime(scip->stat->solvingtimeoverall);
40457  presolving = SCIPclockGetTime(scip->stat->presolvingtimeoverall);
40458  updatetime = SCIPclockGetTime(scip->stat->reoptupdatetime);
40459 
40460  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP Reopt Status : finish after %d runs.\n", scip->stat->nreoptruns);
40461  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Time (sec) :\n");
40462  SCIPmessageFPrintInfo(scip->messagehdlr, file, " solving : %10.2f\n", solving);
40463  SCIPmessageFPrintInfo(scip->messagehdlr, file, " presolving : %10.2f (included in solving)\n", presolving);
40464  SCIPmessageFPrintInfo(scip->messagehdlr, file, " save time : %10.2f\n", SCIPreoptGetSavingtime(scip->reopt));
40465  SCIPmessageFPrintInfo(scip->messagehdlr, file, " update time : %10.2f\n", updatetime);
40466  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Nodes : feas infeas pruned cutoff\n");
40467  SCIPmessageFPrintInfo(scip->messagehdlr, file, " total : %10d %10d %10d %10d\n",
40470  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg : %10.2f %10.2f %10.2f %10.2f\n",
40475 
40476  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Solutions : updated improving\n");
40477  SCIPmessageFPrintInfo(scip->messagehdlr, file, " total : %10d %10d\n", nsolsupdated, nimprovingsols);
40478  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg : %10.2f %10.2f\n",
40479  (SCIP_Real)nsolsupdated/scip->stat->nreoptruns, (SCIP_Real)nimprovingsols/scip->stat->nreoptruns);
40480  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Inf Subtrees : %10d\n", SCIPreoptGetNInfSubtrees(scip->reopt));
40481  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Restarts : global local\n");
40482  SCIPmessageFPrintInfo(scip->messagehdlr, file, " first : %10d --\n", SCIPreoptGetFirstRestarts(scip->reopt));
40483  SCIPmessageFPrintInfo(scip->messagehdlr, file, " last : %10d --\n", SCIPreoptGetLastRestarts(scip->reopt));
40484  SCIPmessageFPrintInfo(scip->messagehdlr, file, " total : %10d %10d\n", SCIPreoptGetNRestartsGlobal(scip->reopt),
40486  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg : -- %10.2f\n",
40488 
40489  return SCIP_OKAY;
40490 }
40491 
40492 /** outputs history statistics about branchings on variables
40493  *
40494  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40495  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40496  *
40497  * @pre This method can be called if SCIP is in one of the following stages:
40498  * - \ref SCIP_STAGE_INIT
40499  * - \ref SCIP_STAGE_PROBLEM
40500  * - \ref SCIP_STAGE_TRANSFORMED
40501  * - \ref SCIP_STAGE_INITPRESOLVE
40502  * - \ref SCIP_STAGE_PRESOLVING
40503  * - \ref SCIP_STAGE_EXITPRESOLVE
40504  * - \ref SCIP_STAGE_PRESOLVED
40505  * - \ref SCIP_STAGE_SOLVING
40506  * - \ref SCIP_STAGE_SOLVED
40507  */
40509  SCIP* scip, /**< SCIP data structure */
40510  FILE* file /**< output file (or NULL for standard output) */
40511  )
40512 {
40513  SCIP_VAR** vars;
40514  int totalnstrongbranchs;
40515  int v;
40516 
40517  SCIP_CALL( checkStage(scip, "SCIPprintBranchingStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40518 
40519  switch( scip->set->stage )
40520  {
40521  case SCIP_STAGE_INIT:
40522  case SCIP_STAGE_PROBLEM:
40523  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem not yet solved. branching statistics not available.\n");
40524  return SCIP_OKAY;
40525 
40528  case SCIP_STAGE_PRESOLVING:
40530  case SCIP_STAGE_PRESOLVED:
40531  case SCIP_STAGE_SOLVING:
40532  case SCIP_STAGE_SOLVED:
40533  SCIP_CALL( SCIPallocBufferArray(scip, &vars, scip->transprob->nvars) );
40534  for( v = 0; v < scip->transprob->nvars; ++v )
40535  {
40536  SCIP_VAR* var;
40537  int i;
40538 
40539  var = scip->transprob->vars[v];
40540  for( i = v; i > 0 && strcmp(SCIPvarGetName(var), SCIPvarGetName(vars[i-1])) < 0; i-- )
40541  vars[i] = vars[i-1];
40542  vars[i] = var;
40543  }
40544 
40545  SCIPmessageFPrintInfo(scip->messagehdlr, file, " locks branchings inferences cutoffs LP gain pscostcount gain variance \n");
40546  SCIPmessageFPrintInfo(scip->messagehdlr, file, "variable prio factor down up depth down up sb down up down up down up down up down up\n");
40547 
40548  totalnstrongbranchs = 0;
40549  for( v = 0; v < scip->transprob->nvars; ++v )
40550  {
40553  || SCIPgetVarNStrongbranchs(scip, vars[v]) > 0 )
40554  {
40555  int nstrongbranchs;
40556 
40557  nstrongbranchs = SCIPgetVarNStrongbranchs(scip, vars[v]);
40558  totalnstrongbranchs += nstrongbranchs;
40559  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%-16s %5d %8.1f %6d %6d %6.1f %7" SCIP_LONGINT_FORMAT " %7" SCIP_LONGINT_FORMAT " %5d %8.1f %8.1f %5.1f%% %5.1f%% %15.4f %15.4f %7.1f %7.1f %15.2f %15.2f\n",
40560  SCIPvarGetName(vars[v]),
40561  SCIPvarGetBranchPriority(vars[v]),
40562  SCIPvarGetBranchFactor(vars[v]),
40563  SCIPvarGetNLocksDown(vars[v]),
40564  SCIPvarGetNLocksUp(vars[v]),
40566  + SCIPvarGetAvgBranchdepth(vars[v], SCIP_BRANCHDIR_UPWARDS))/2.0 - 1.0,
40569  nstrongbranchs,
40572  100.0 * SCIPvarGetAvgCutoffs(vars[v], scip->stat, SCIP_BRANCHDIR_DOWNWARDS),
40573  100.0 * SCIPvarGetAvgCutoffs(vars[v], scip->stat, SCIP_BRANCHDIR_UPWARDS),
40574  SCIPvarGetPseudocost(vars[v], scip->stat, -1.0),
40575  SCIPvarGetPseudocost(vars[v], scip->stat, +1.0),
40580  }
40581  }
40582  SCIPmessageFPrintInfo(scip->messagehdlr, file, "total %7" SCIP_LONGINT_FORMAT " %7" SCIP_LONGINT_FORMAT " %5d %8.1f %8.1f %5.1f%% %5.1f%% %15.4f %15.4f %7.1f %7.1f %15.2f %15.2f\n",
40585  totalnstrongbranchs,
40604 
40605  SCIPfreeBufferArray(scip, &vars);
40606 
40607  return SCIP_OKAY;
40608 
40609  default:
40610  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
40611  return SCIP_INVALIDCALL;
40612  } /*lint !e788*/
40613 }
40614 
40615 /** outputs node information display line
40616  *
40617  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40618  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40619  *
40620  * @pre This method can be called if SCIP is in one of the following stages:
40621  * - \ref SCIP_STAGE_SOLVING
40622  */
40624  SCIP* scip, /**< SCIP data structure */
40625  FILE* file, /**< output file (or NULL for standard output) */
40626  SCIP_VERBLEVEL verblevel, /**< minimal verbosity level to actually display the information line */
40627  SCIP_Bool endline /**< should the line be terminated with a newline symbol? */
40628  )
40629 {
40630  SCIP_CALL( checkStage(scip, "SCIPprintDisplayLine", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40631 
40632  if( (SCIP_VERBLEVEL)scip->set->disp_verblevel >= verblevel )
40633  {
40634  SCIP_CALL( SCIPdispPrintLine(scip->set, scip->messagehdlr, scip->stat, file, TRUE, endline) );
40635  }
40636 
40637  return SCIP_OKAY;
40638 }
40639 
40640 /** gets total number of implications between variables that are stored in the implication graph
40641  *
40642  * @return the total number of implications between variables that are stored in the implication graph
40643  *
40644  * @pre This method can be called if SCIP is in one of the following stages:
40645  * - \ref SCIP_STAGE_INITPRESOLVE
40646  * - \ref SCIP_STAGE_PRESOLVING
40647  * - \ref SCIP_STAGE_EXITPRESOLVE
40648  * - \ref SCIP_STAGE_PRESOLVED
40649  * - \ref SCIP_STAGE_INITSOLVE
40650  * - \ref SCIP_STAGE_SOLVING
40651  * - \ref SCIP_STAGE_SOLVED
40652  */
40654  SCIP* scip /**< SCIP data structure */
40655  )
40656 {
40657  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNImplications", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40658 
40659  return scip->stat->nimplications;
40660 }
40661 
40662 /** stores conflict graph of binary variables' implications into a file, which can be used as input for the DOT tool
40663  *
40664  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40665  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40666  *
40667  * @pre This method can be called if SCIP is in one of the following stages:
40668  * - \ref SCIP_STAGE_TRANSFORMED
40669  * - \ref SCIP_STAGE_INITPRESOLVE
40670  * - \ref SCIP_STAGE_PRESOLVING
40671  * - \ref SCIP_STAGE_EXITPRESOLVE
40672  * - \ref SCIP_STAGE_PRESOLVED
40673  * - \ref SCIP_STAGE_INITSOLVE
40674  * - \ref SCIP_STAGE_SOLVING
40675  * - \ref SCIP_STAGE_SOLVED
40676  * - \ref SCIP_STAGE_EXITSOLVE
40677  *
40678  * @deprecated because binary implications are now stored as cliques, please use SCIPwriteCliqueGraph() instead
40679  *
40680  */
40682  SCIP* scip, /**< SCIP data structure */
40683  const char* filename /**< file name, or NULL for stdout */
40684  )
40685 { /*lint --e{715}*/
40686  SCIPwarningMessage(scip, "SCIPwriteImplicationConflictGraph() is deprecated and does not do anything anymore. All binary to binary implications are now stored in the clique data structure, which can be written to a GML formatted file via SCIPwriteCliqueGraph().\n");
40687 
40688  return SCIP_OKAY;
40689 }
40690 
40691 
40692 
40693 
40694 /*
40695  * timing methods
40696  */
40697 
40698 /** gets current time of day in seconds (standard time zone)
40699  *
40700  * @return the current time of day in seconds (standard time zone).
40701  */
40703  SCIP* scip /**< SCIP data structure */
40704  )
40705 {
40706  assert(scip != NULL);
40707 
40708  return SCIPclockGetTimeOfDay();
40709 }
40710 
40711 /** creates a clock using the default clock type
40712  *
40713  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40714  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40715  */
40717  SCIP* scip, /**< SCIP data structure */
40718  SCIP_CLOCK** clck /**< pointer to clock timer */
40719  )
40720 {
40721  assert(scip != NULL);
40722 
40724 
40725  return SCIP_OKAY;
40726 }
40727 
40728 /** creates a clock counting the CPU user seconds
40729  *
40730  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40731  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40732  */
40734  SCIP* scip, /**< SCIP data structure */
40735  SCIP_CLOCK** clck /**< pointer to clock timer */
40736  )
40737 {
40738  assert(scip != NULL);
40739 
40741 
40742  return SCIP_OKAY;
40743 }
40744 
40745 /** creates a clock counting the wall clock seconds
40746  *
40747  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40748  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40749  */
40751  SCIP* scip, /**< SCIP data structure */
40752  SCIP_CLOCK** clck /**< pointer to clock timer */
40753  )
40754 {
40755  assert(scip != NULL);
40756 
40758 
40759  return SCIP_OKAY;
40760 }
40761 
40762 /** frees a clock
40763  *
40764  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40765  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40766  */
40768  SCIP* scip, /**< SCIP data structure */
40769  SCIP_CLOCK** clck /**< pointer to clock timer */
40770  )
40771 {
40772  assert(scip != NULL);
40773 
40774  SCIPclockFree(clck);
40775 
40776  return SCIP_OKAY;
40777 }
40778 
40779 /** resets the time measurement of a clock to zero and completely stops the clock
40780  *
40781  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40782  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40783  */
40785  SCIP* scip, /**< SCIP data structure */
40786  SCIP_CLOCK* clck /**< clock timer */
40787  )
40788 {
40789  assert(scip != NULL);
40790 
40791  SCIPclockReset(clck);
40792 
40793  return SCIP_OKAY;
40794 }
40795 
40796 /** starts the time measurement of a clock
40797  *
40798  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40799  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40800  */
40802  SCIP* scip, /**< SCIP data structure */
40803  SCIP_CLOCK* clck /**< clock timer */
40804  )
40805 {
40806  assert(scip != NULL);
40807 
40808  SCIPclockStart(clck, scip->set);
40809 
40810  return SCIP_OKAY;
40811 }
40812 
40813 /** stops the time measurement of a clock
40814  *
40815  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40816  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40817  */
40819  SCIP* scip, /**< SCIP data structure */
40820  SCIP_CLOCK* clck /**< clock timer */
40821  )
40822 {
40823  assert(scip != NULL);
40824 
40825  SCIPclockStop(clck, scip->set);
40826 
40827  return SCIP_OKAY;
40828 }
40829 
40830 /** enables or disables all statistic clocks of SCIP concerning plugin statistics,
40831  * LP execution time, strong branching time, etc.
40832  *
40833  * Method reads the value of the parameter timing/statistictiming. In order to disable statistic timing,
40834  * set the parameter to FALSE.
40835  *
40836  * @note: The (pre-)solving time clocks which are relevant for the output during (pre-)solving
40837  * are not affected by this method
40838  *
40839  * @see: For completely disabling all timing of SCIP, consider setting the parameter timing/enabled to FALSE
40840  *
40841  * @pre This method can be called if SCIP is in one of the following stages:
40842  * - \ref SCIP_STAGE_INIT
40843  * - \ref SCIP_STAGE_PROBLEM
40844  * - \ref SCIP_STAGE_TRANSFORMING
40845  * - \ref SCIP_STAGE_TRANSFORMED
40846  * - \ref SCIP_STAGE_INITPRESOLVE
40847  * - \ref SCIP_STAGE_PRESOLVING
40848  * - \ref SCIP_STAGE_EXITPRESOLVE
40849  * - \ref SCIP_STAGE_PRESOLVED
40850  * - \ref SCIP_STAGE_INITSOLVE
40851  * - \ref SCIP_STAGE_SOLVING
40852  * - \ref SCIP_STAGE_SOLVED
40853  * - \ref SCIP_STAGE_EXITSOLVE
40854  * - \ref SCIP_STAGE_FREETRANS
40855  *
40856  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
40857  */
40859  SCIP* scip /**< SCIP data structure */
40860  )
40861 {
40862  SCIP_CALL( checkStage(scip, "SCIPenableOrDisableStatisticTiming", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
40863 
40865 
40866  if( scip->set->stage > SCIP_STAGE_INIT )
40867  {
40868  assert(scip->stat != NULL);
40870  }
40871  if( scip->set->stage >= SCIP_STAGE_TRANSFORMING )
40872  {
40873  assert(scip->conflict != NULL);
40875  }
40876 
40877  return SCIP_OKAY;
40878 }
40879 
40880 /** starts the current solving time
40881  *
40882  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40883  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40884  *
40885  * @pre This method can be called if SCIP is in one of the following stages:
40886  * - \ref SCIP_STAGE_PROBLEM
40887  * - \ref SCIP_STAGE_TRANSFORMING
40888  * - \ref SCIP_STAGE_TRANSFORMED
40889  * - \ref SCIP_STAGE_INITPRESOLVE
40890  * - \ref SCIP_STAGE_PRESOLVING
40891  * - \ref SCIP_STAGE_EXITPRESOLVE
40892  * - \ref SCIP_STAGE_PRESOLVED
40893  * - \ref SCIP_STAGE_INITSOLVE
40894  * - \ref SCIP_STAGE_SOLVING
40895  * - \ref SCIP_STAGE_SOLVED
40896  * - \ref SCIP_STAGE_EXITSOLVE
40897  * - \ref SCIP_STAGE_FREETRANS
40898  *
40899  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
40900  */
40902  SCIP* scip /**< SCIP data structure */
40903  )
40904 {
40905  SCIP_CALL( checkStage(scip, "SCIPstartSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
40906 
40907  SCIPclockStart(scip->stat->solvingtime, scip->set);
40908  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
40909 
40910  return SCIP_OKAY;
40911 }
40912 
40913 /** stops the current solving time in seconds
40914  *
40915  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40916  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40917  *
40918  * @pre This method can be called if SCIP is in one of the following stages:
40919  * - \ref SCIP_STAGE_PROBLEM
40920  * - \ref SCIP_STAGE_TRANSFORMING
40921  * - \ref SCIP_STAGE_TRANSFORMED
40922  * - \ref SCIP_STAGE_INITPRESOLVE
40923  * - \ref SCIP_STAGE_PRESOLVING
40924  * - \ref SCIP_STAGE_EXITPRESOLVE
40925  * - \ref SCIP_STAGE_PRESOLVED
40926  * - \ref SCIP_STAGE_INITSOLVE
40927  * - \ref SCIP_STAGE_SOLVING
40928  * - \ref SCIP_STAGE_SOLVED
40929  * - \ref SCIP_STAGE_EXITSOLVE
40930  * - \ref SCIP_STAGE_FREETRANS
40931  *
40932  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
40933  */
40935  SCIP* scip /**< SCIP data structure */
40936  )
40937 {
40938  SCIP_CALL( checkStage(scip, "SCIPstopSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
40939 
40940  SCIPclockStop(scip->stat->solvingtime, scip->set);
40941  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
40942 
40943  return SCIP_OKAY;
40944 }
40945 
40946 /** gets the measured time of a clock in seconds
40947  *
40948  * @return the measured time of a clock in seconds.
40949  */
40951  SCIP* scip, /**< SCIP data structure */
40952  SCIP_CLOCK* clck /**< clock timer */
40953  )
40954 {
40955  assert(scip != NULL);
40956 
40957  return SCIPclockGetTime(clck);
40958 }
40959 
40960 /** sets the measured time of a clock to the given value in seconds
40961  *
40962  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40963  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40964  */
40966  SCIP* scip, /**< SCIP data structure */
40967  SCIP_CLOCK* clck, /**< clock timer */
40968  SCIP_Real sec /**< time in seconds to set the clock's timer to */
40969  )
40970 {
40971  assert(scip != NULL);
40972 
40973  SCIPclockSetTime(clck, sec);
40974 
40975  return SCIP_OKAY;
40976 }
40977 
40978 /** gets the current total SCIP time in seconds, possibly accumulated over several problems.
40979  *
40980  * @return the current total SCIP time in seconds, ie. the total time since the SCIP instance has been created
40981  */
40983  SCIP* scip /**< SCIP data structure */
40984  )
40985 {
40986  assert(scip != NULL);
40987 
40988  return SCIPclockGetTime(scip->totaltime);
40989 }
40990 
40991 /** gets the current solving time in seconds
40992  *
40993  * @return the current solving time in seconds.
40994  *
40995  * @pre This method can be called if SCIP is in one of the following stages:
40996  * - \ref SCIP_STAGE_PROBLEM
40997  * - \ref SCIP_STAGE_TRANSFORMING
40998  * - \ref SCIP_STAGE_TRANSFORMED
40999  * - \ref SCIP_STAGE_INITPRESOLVE
41000  * - \ref SCIP_STAGE_PRESOLVING
41001  * - \ref SCIP_STAGE_EXITPRESOLVE
41002  * - \ref SCIP_STAGE_PRESOLVED
41003  * - \ref SCIP_STAGE_INITSOLVE
41004  * - \ref SCIP_STAGE_SOLVING
41005  * - \ref SCIP_STAGE_SOLVED
41006  *
41007  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41008  */
41010  SCIP* scip /**< SCIP data structure */
41011  )
41012 {
41013  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41014 
41015  return SCIPclockGetTime(scip->stat->solvingtime);
41016 }
41017 
41018 /** gets the current reading time in seconds
41019  *
41020  * @return the current reading time in seconds.
41021  *
41022  * @pre This method can be called if SCIP is in one of the following stages:
41023  * - \ref SCIP_STAGE_PROBLEM
41024  * - \ref SCIP_STAGE_TRANSFORMING
41025  * - \ref SCIP_STAGE_TRANSFORMED
41026  * - \ref SCIP_STAGE_INITPRESOLVE
41027  * - \ref SCIP_STAGE_PRESOLVING
41028  * - \ref SCIP_STAGE_EXITPRESOLVE
41029  * - \ref SCIP_STAGE_PRESOLVED
41030  * - \ref SCIP_STAGE_INITSOLVE
41031  * - \ref SCIP_STAGE_SOLVING
41032  * - \ref SCIP_STAGE_SOLVED
41033  *
41034  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41035  */
41037  SCIP* scip /**< SCIP data structure */
41038  )
41039 {
41040  SCIP_Real readingtime;
41041  int r;
41042 
41043  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetReadingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41044 
41045  readingtime = 0.0;
41046 
41047  /* sum up the reading time of all readers */
41048  for( r = 0; r < scip->set->nreaders; ++r )
41049  {
41050  assert(scip->set->readers[r] != NULL);
41051  assert(!SCIPisNegative(scip, SCIPreaderGetReadingTime(scip->set->readers[r])));
41052  readingtime += SCIPreaderGetReadingTime(scip->set->readers[r]);
41053  }
41054 
41055  return readingtime;
41056 }
41057 
41058 /** gets the current presolving time in seconds
41059  *
41060  * @return the current presolving time in seconds.
41061  *
41062  * @pre This method can be called if SCIP is in one of the following stages:
41063  * - \ref SCIP_STAGE_INITPRESOLVE
41064  * - \ref SCIP_STAGE_PRESOLVING
41065  * - \ref SCIP_STAGE_EXITPRESOLVE
41066  * - \ref SCIP_STAGE_PRESOLVED
41067  * - \ref SCIP_STAGE_INITSOLVE
41068  * - \ref SCIP_STAGE_SOLVING
41069  * - \ref SCIP_STAGE_SOLVED
41070  *
41071  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41072  */
41074  SCIP* scip /**< SCIP data structure */
41075  )
41076 {
41077  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPresolvingTime", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41078 
41079  return SCIPclockGetTime(scip->stat->presolvingtime);
41080 }
41081 
41082 /** gets the time need to solve the first LP in the root node
41083  *
41084  * @return the solving time for the first LP in the root node in seconds.
41085  *
41086  * @pre This method can be called if SCIP is in one of the following stages:
41087  * - \ref SCIP_STAGE_TRANSFORMING
41088  * - \ref SCIP_STAGE_TRANSFORMED
41089  * - \ref SCIP_STAGE_INITPRESOLVE
41090  * - \ref SCIP_STAGE_PRESOLVING
41091  * - \ref SCIP_STAGE_EXITPRESOLVE
41092  * - \ref SCIP_STAGE_PRESOLVED
41093  * - \ref SCIP_STAGE_INITSOLVE
41094  * - \ref SCIP_STAGE_SOLVING
41095  * - \ref SCIP_STAGE_SOLVED
41096  *
41097  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41098  */
41100  SCIP* scip /**< SCIP data structure */
41101  )
41102 {
41103  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPTime", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41104 
41105  return scip->stat->firstlptime;
41106 }
41107 
41108 
41109 
41110 /*
41111  * numeric values and comparisons
41112  */
41113 
41114 /** returns value treated as zero
41115  *
41116  * @return value treated as zero
41117  */
41119  SCIP* scip /**< SCIP data structure */
41120  )
41121 {
41122  assert(scip != NULL);
41123  assert(scip->set != NULL);
41124 
41125  return SCIPsetEpsilon(scip->set);
41126 }
41127 
41128 /** returns value treated as zero for sums of floating point values
41129  *
41130  * @return value treated as zero for sums of floating point values
41131  */
41133  SCIP* scip /**< SCIP data structure */
41134  )
41135 {
41136  assert(scip != NULL);
41137  assert(scip->set != NULL);
41138 
41139  return SCIPsetSumepsilon(scip->set);
41140 }
41141 
41142 /** returns feasibility tolerance for constraints
41143  *
41144  * @return feasibility tolerance for constraints
41145  */
41147  SCIP* scip /**< SCIP data structure */
41148  )
41149 {
41150  assert(scip != NULL);
41151  assert(scip->set != NULL);
41152 
41153  return SCIPsetFeastol(scip->set);
41154 }
41155 
41156 /** returns primal feasibility tolerance of LP solver
41157  *
41158  * @return primal feasibility tolerance of LP solver
41159  */
41161  SCIP* scip /**< SCIP data structure */
41162  )
41163 {
41164  assert(scip != NULL);
41165  assert(scip->set != NULL);
41166 
41167  return SCIPsetLpfeastol(scip->set);
41168 }
41169 
41170 /** returns feasibility tolerance for reduced costs
41171  *
41172  * @return feasibility tolerance for reduced costs
41173  */
41175  SCIP* scip /**< SCIP data structure */
41176  )
41177 {
41178  assert(scip != NULL);
41179  assert(scip->set != NULL);
41180 
41181  return SCIPsetDualfeastol(scip->set);
41182 }
41183 
41184 /** returns convergence tolerance used in barrier algorithm
41185  *
41186  * @return convergence tolerance used in barrier algorithm
41187  */
41189  SCIP* scip /**< SCIP data structure */
41190  )
41191 {
41192  assert(scip != NULL);
41193  assert(scip->set != NULL);
41194 
41195  return SCIPsetBarrierconvtol(scip->set);
41196 }
41197 
41198 /** return the cutoff bound delta
41199  *
41200  * @return cutoff bound data
41201  */
41203  SCIP* scip /**< SCIP data structure */
41204  )
41205 {
41206  assert(scip != NULL);
41207  assert(scip->set != NULL);
41208 
41209  return SCIPsetCutoffbounddelta(scip->set);
41210 }
41211 
41212 /** sets the feasibility tolerance for constraints
41213  *
41214  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41215  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41216  */
41218  SCIP* scip, /**< SCIP data structure */
41219  SCIP_Real feastol /**< new feasibility tolerance for constraints */
41220  )
41221 {
41222  assert(scip != NULL);
41223 
41224  /* change the settings */
41225  SCIP_CALL( SCIPsetSetFeastol(scip->set, feastol) );
41226 
41227  return SCIP_OKAY;
41228 }
41229 
41230 /** sets the primal feasibility tolerance of LP solver
41231  *
41232  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41233  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41234  */
41236  SCIP* scip, /**< SCIP data structure */
41237  SCIP_Real lpfeastol, /**< new primal feasibility tolerance of LP solver */
41238  SCIP_Bool printnewvalue /**< should "numerics/lpfeastol = ..." be printed? */
41239  )
41240 {
41241  assert(scip != NULL);
41242 
41243  /* mark the LP unsolved, if the primal feasibility tolerance was tightened */
41244  if( scip->lp != NULL && lpfeastol < SCIPsetLpfeastol(scip->set) )
41245  {
41246  scip->lp->solved = FALSE;
41248  }
41249 
41250  /* change the settings */
41251  SCIP_CALL( SCIPsetSetLpfeastol(scip->set, lpfeastol, printnewvalue) );
41252 
41253  return SCIP_OKAY;
41254 }
41255 
41256 /** sets the feasibility tolerance for reduced costs
41257  *
41258  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41259  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41260  */
41262  SCIP* scip, /**< SCIP data structure */
41263  SCIP_Real dualfeastol /**< new feasibility tolerance for reduced costs */
41264  )
41265 {
41266  assert(scip != NULL);
41267 
41268  /* mark the LP unsolved, if the dual feasibility tolerance was tightened */
41269  if( scip->lp != NULL && dualfeastol < SCIPsetDualfeastol(scip->set) )
41270  {
41271  scip->lp->solved = FALSE;
41273  }
41274 
41275  /* change the settings */
41276  SCIP_CALL( SCIPsetSetDualfeastol(scip->set, dualfeastol) );
41277 
41278  return SCIP_OKAY;
41279 }
41280 
41281 /** sets the convergence tolerance used in barrier algorithm
41282  *
41283  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41284  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41285  */
41287  SCIP* scip, /**< SCIP data structure */
41288  SCIP_Real barrierconvtol /**< new convergence tolerance used in barrier algorithm */
41289  )
41290 {
41291  assert(scip != NULL);
41292 
41293  /* mark the LP unsolved, if the convergence tolerance was tightened, and the LP was solved with the barrier algorithm */
41294  if( scip->lp != NULL && barrierconvtol < SCIPsetBarrierconvtol(scip->set)
41296  scip->lp->solved = FALSE;
41297 
41298  /* change the settings */
41299  SCIP_CALL( SCIPsetSetBarrierconvtol(scip->set, barrierconvtol) );
41300 
41301  return SCIP_OKAY;
41302 }
41303 
41304 /** marks that some limit parameter was changed */
41306  SCIP* scip /**< SCIP data structure */
41307  )
41308 {
41309  assert(scip != NULL);
41310 
41311  /* change the settings */
41312  SCIPsetSetLimitChanged(scip->set);
41313 }
41314 
41315 /** outputs a real number, or "+infinity", or "-infinity" to a file */
41317  SCIP* scip, /**< SCIP data structure */
41318  FILE* file, /**< output file (or NULL for standard output) */
41319  SCIP_Real val, /**< value to print */
41320  int width, /**< width of the field */
41321  int precision /**< number of significant digits printed */
41322  )
41323 {
41324  char s[SCIP_MAXSTRLEN];
41325  char strformat[SCIP_MAXSTRLEN];
41326 
41327  assert(scip != NULL);
41328 
41329  if( SCIPsetIsInfinity(scip->set, val) )
41330  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "+infinity");
41331  else if( SCIPsetIsInfinity(scip->set, -val) )
41332  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "-infinity");
41333  else
41334  {
41335  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%.%dg", precision);
41336  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, (const char*)strformat, val);
41337  }
41338  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%%ds", width);
41339  SCIPmessageFPrintInfo(scip->messagehdlr, file, (const char*)strformat, s);
41340 }
41341 
41342 
41343 
41344 
41345 /*
41346  * memory management
41347  */
41348 
41349 /** returns block memory to use at the current time
41350  *
41351  * @return the block memory to use at the current time.
41352  */
41354  SCIP* scip /**< SCIP data structure */
41355  )
41356 {
41357  assert(scip != NULL);
41358  assert(scip->set != NULL);
41359  assert(scip->mem != NULL);
41360 
41361  return scip->mem->probmem;
41362 }
41363 
41364 /** returns buffer memory for short living temporary objects
41365  *
41366  * @return the buffer memory for short living temporary objects
41367  */
41369  SCIP* scip /**< SCIP data structure */
41370  )
41371 {
41372  assert(scip != NULL);
41373  assert(scip->mem != NULL);
41374 
41375  return scip->mem->buffer;
41376 }
41377 
41378 /** returns clean buffer memory for short living temporary objects initialized to all zero
41379  *
41380  * @return the buffer memory for short living temporary objects initialized to all zero
41381  */
41383  SCIP* scip /**< SCIP data structure */
41384  )
41385 {
41386  assert(scip != NULL);
41387  assert(scip->mem != NULL);
41388 
41389  return scip->mem->cleanbuffer;
41390 }
41391 
41392 /** returns the total number of bytes used in block and buffer memory
41393  *
41394  * @return the total number of bytes used in block and buffer memory.
41395  */
41397  SCIP* scip /**< SCIP data structure */
41398  )
41399 {
41400  assert(scip != NULL);
41401 
41402  return SCIPmemGetUsed(scip->mem);
41403 }
41404 
41405 /** returns the estimated number of bytes used by external software, e.g., the LP solver
41406  *
41407  * @return the estimated number of bytes used by external software, e.g., the LP solver.
41408  */
41410  SCIP* scip /**< SCIP data structure */
41411  )
41412 {
41413  assert(scip != NULL);
41414 
41415  return SCIPsetGetMemExternEstim(scip->set);
41416 }
41417 
41418 /** calculate memory size for dynamically allocated arrays
41419  *
41420  * @return the memory size for dynamically allocated arrays.
41421  */
41423  SCIP* scip, /**< SCIP data structure */
41424  int num /**< minimum number of entries to store */
41425  )
41426 {
41427  assert(scip != NULL);
41428 
41429  return SCIPsetCalcMemGrowSize(scip->set, num);
41430 }
41431 
41432 /** extends a dynamically allocated block memory array to be able to store at least the given number of elements;
41433  * use SCIPensureBlockMemoryArray() define to call this method!
41434  *
41435  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41436  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41437  */
41439  SCIP* scip, /**< SCIP data structure */
41440  void** arrayptr, /**< pointer to dynamically sized array */
41441  size_t elemsize, /**< size in bytes of each element in array */
41442  int* arraysize, /**< pointer to current array size */
41443  int minsize /**< required minimal array size */
41444  )
41445 {
41446  assert(scip != NULL);
41447  assert(arrayptr != NULL);
41448  assert(elemsize > 0);
41449  assert(arraysize != NULL);
41450 
41451  if( minsize > *arraysize )
41452  {
41453  int newsize;
41454 
41455  newsize = SCIPsetCalcMemGrowSize(scip->set, minsize);
41456  SCIP_ALLOC( BMSreallocBlockMemorySize(SCIPblkmem(scip), arrayptr, *arraysize * elemsize, newsize * elemsize) );
41457  *arraysize = newsize;
41458  }
41459 
41460  return SCIP_OKAY;
41461 }
41462 
41463 /** prints output about used memory */
41465  SCIP* scip /**< SCIP data structure */
41466  )
41467 {
41468  assert(scip != NULL);
41469  assert(scip->mem != NULL);
41470  assert(scip->set != NULL);
41471 
41472  BMSdisplayMemory();
41473 
41474  SCIPmessagePrintInfo(scip->messagehdlr, "\nParameter Block Memory (%p):\n", scip->mem->setmem);
41476 
41477  SCIPmessagePrintInfo(scip->messagehdlr, "\nSolution Block Memory (%p):\n", scip->mem->probmem);
41479 
41480  SCIPmessagePrintInfo(scip->messagehdlr, "\nMemory Buffers:\n");
41482 
41483  SCIPmessagePrintInfo(scip->messagehdlr, "\nClean Memory Buffers:\n");
41485 }
41486 
41487 
41488 
41489 
41490 /*
41491  * simple functions implemented as defines
41492  */
41493 
41494 /* In debug mode, the following methods are implemented as function calls to ensure
41495  * type validity.
41496  * In optimized mode, the methods are implemented as defines to improve performance.
41497  * However, we want to have them in the library anyways, so we have to undef the defines.
41498  */
41499 
41500 #undef SCIPinfinity
41501 #undef SCIPisInfinity
41502 #undef SCIPisEQ
41503 #undef SCIPisLT
41504 #undef SCIPisLE
41505 #undef SCIPisGT
41506 #undef SCIPisGE
41507 #undef SCIPisZero
41508 #undef SCIPisPositive
41509 #undef SCIPisNegative
41510 #undef SCIPisIntegral
41511 #undef SCIPisScalingIntegral
41512 #undef SCIPisFracIntegral
41513 #undef SCIPfloor
41514 #undef SCIPceil
41515 #undef SCIPround
41516 #undef SCIPfrac
41517 #undef SCIPisSumEQ
41518 #undef SCIPisSumLT
41519 #undef SCIPisSumLE
41520 #undef SCIPisSumGT
41521 #undef SCIPisSumGE
41522 #undef SCIPisSumZero
41523 #undef SCIPisSumPositive
41524 #undef SCIPisSumNegative
41525 #undef SCIPisFeasEQ
41526 #undef SCIPisFeasLT
41527 #undef SCIPisFeasLE
41528 #undef SCIPisFeasGT
41529 #undef SCIPisFeasGE
41530 #undef SCIPisFeasZero
41531 #undef SCIPisFeasPositive
41532 #undef SCIPisFeasNegative
41533 #undef SCIPisFeasIntegral
41534 #undef SCIPisFeasFracIntegral
41535 #undef SCIPfeasFloor
41536 #undef SCIPfeasCeil
41537 #undef SCIPfeasRound
41538 #undef SCIPfeasFrac
41539 #undef SCIPisDualfeasEQ
41540 #undef SCIPisDualfeasLT
41541 #undef SCIPisDualfeasLE
41542 #undef SCIPisDualfeasGT
41543 #undef SCIPisDualfeasGE
41544 #undef SCIPisDualfeasZero
41545 #undef SCIPisDualfeasPositive
41546 #undef SCIPisDualfeasNegative
41547 #undef SCIPisDualfeasIntegral
41548 #undef SCIPisDualfeasFracIntegral
41549 #undef SCIPdualfeasFloor
41550 #undef SCIPdualfeasCeil
41551 #undef SCIPdualfeasRound
41552 #undef SCIPdualfeasFrac
41553 #undef SCIPisLbBetter
41554 #undef SCIPisUbBetter
41555 #undef SCIPisRelEQ
41556 #undef SCIPisRelLT
41557 #undef SCIPisRelLE
41558 #undef SCIPisRelGT
41559 #undef SCIPisRelGE
41560 #undef SCIPisSumRelEQ
41561 #undef SCIPisSumRelLT
41562 #undef SCIPisSumRelLE
41563 #undef SCIPisSumRelGT
41564 #undef SCIPisSumRelGE
41565 #undef SCIPconvertRealToInt
41566 #undef SCIPconvertRealToLongint
41567 #undef SCIPisUpdateUnreliable
41568 #undef SCIPisHugeValue
41569 #undef SCIPgetHugeValue
41570 
41571 /** checks, if values are in range of epsilon */
41573  SCIP* scip, /**< SCIP data structure */
41574  SCIP_Real val1, /**< first value to be compared */
41575  SCIP_Real val2 /**< second value to be compared */
41576  )
41577 {
41578  assert(scip != NULL);
41579  assert(scip->set != NULL);
41580 
41581  return SCIPsetIsEQ(scip->set, val1, val2);
41582 }
41583 
41584 /** checks, if val1 is (more than epsilon) lower than val2 */
41586  SCIP* scip, /**< SCIP data structure */
41587  SCIP_Real val1, /**< first value to be compared */
41588  SCIP_Real val2 /**< second value to be compared */
41589  )
41590 {
41591  assert(scip != NULL);
41592  assert(scip->set != NULL);
41593 
41594  return SCIPsetIsLT(scip->set, val1, val2);
41595 }
41596 
41597 /** checks, if val1 is not (more than epsilon) greater than val2 */
41599  SCIP* scip, /**< SCIP data structure */
41600  SCIP_Real val1, /**< first value to be compared */
41601  SCIP_Real val2 /**< second value to be compared */
41602  )
41603 {
41604  assert(scip != NULL);
41605  assert(scip->set != NULL);
41606 
41607  return SCIPsetIsLE(scip->set, val1, val2);
41608 }
41609 
41610 /** checks, if val1 is (more than epsilon) greater than val2 */
41612  SCIP* scip, /**< SCIP data structure */
41613  SCIP_Real val1, /**< first value to be compared */
41614  SCIP_Real val2 /**< second value to be compared */
41615  )
41616 {
41617  assert(scip != NULL);
41618  assert(scip->set != NULL);
41619 
41620  return SCIPsetIsGT(scip->set, val1, val2);
41621 }
41622 
41623 /** checks, if val1 is not (more than epsilon) lower than val2 */
41625  SCIP* scip, /**< SCIP data structure */
41626  SCIP_Real val1, /**< first value to be compared */
41627  SCIP_Real val2 /**< second value to be compared */
41628  )
41629 {
41630  assert(scip != NULL);
41631  assert(scip->set != NULL);
41632 
41633  return SCIPsetIsGE(scip->set, val1, val2);
41634 }
41635 
41636 /** returns value treated as infinity */
41638  SCIP* scip /**< SCIP data structure */
41639  )
41640 {
41641  assert(scip != NULL);
41642  assert(scip->set != NULL);
41643 
41644  return SCIPsetInfinity(scip->set);
41645 }
41646 
41647 /** checks, if value is (positive) infinite */
41649  SCIP* scip, /**< SCIP data structure */
41650  SCIP_Real val /**< value to be compared against infinity */
41651  )
41652 {
41653  assert(scip != NULL);
41654  assert(scip->set != NULL);
41655 
41656  return SCIPsetIsInfinity(scip->set, val);
41657 }
41658 
41659 /** checks, if value is huge and should be handled separately (e.g., in activity computation) */
41661  SCIP* scip, /**< SCIP data structure */
41662  SCIP_Real val /**< value to be checked whether it is huge */
41663  )
41664 {
41665  assert(scip != NULL);
41666  assert(scip->set != NULL);
41667 
41668  return SCIPsetIsHugeValue(scip->set, val);
41669 }
41670 
41671 /** returns the minimum value that is regarded as huge and should be handled separately (e.g., in activity
41672  * computation)
41673  */
41675  SCIP* scip /**< SCIP data structure */
41676  )
41677 {
41678  assert(scip != NULL);
41679  assert(scip->set != NULL);
41680 
41681  return SCIPsetGetHugeValue(scip->set);
41682 }
41683 
41684 /** checks, if value is in range epsilon of 0.0 */
41686  SCIP* scip, /**< SCIP data structure */
41687  SCIP_Real val /**< value to process */
41688  )
41689 {
41690  assert(scip != NULL);
41691  assert(scip->set != NULL);
41692 
41693  return SCIPsetIsZero(scip->set, val);
41694 }
41695 
41696 /** checks, if value is greater than epsilon */
41698  SCIP* scip, /**< SCIP data structure */
41699  SCIP_Real val /**< value to process */
41700  )
41701 {
41702  assert(scip != NULL);
41703  assert(scip->set != NULL);
41704 
41705  return SCIPsetIsPositive(scip->set, val);
41706 }
41707 
41708 /** checks, if value is lower than -epsilon */
41710  SCIP* scip, /**< SCIP data structure */
41711  SCIP_Real val /**< value to process */
41712  )
41713 {
41714  assert(scip != NULL);
41715  assert(scip->set != NULL);
41716 
41717  return SCIPsetIsNegative(scip->set, val);
41718 }
41719 
41720 /** checks, if value is integral within epsilon */
41722  SCIP* scip, /**< SCIP data structure */
41723  SCIP_Real val /**< value to process */
41724  )
41725 {
41726  assert(scip != NULL);
41727  assert(scip->set != NULL);
41728 
41729  return SCIPsetIsIntegral(scip->set, val);
41730 }
41731 
41732 /** checks whether the product val * scalar is integral in epsilon scaled by scalar */
41734  SCIP* scip, /**< SCIP data structure */
41735  SCIP_Real val, /**< unscaled value to check for scaled integrality */
41736  SCIP_Real scalar /**< value to scale val with for checking for integrality */
41737  )
41738 {
41739  assert(scip != NULL);
41740  assert(scip->set != NULL);
41741 
41742  return SCIPsetIsScalingIntegral(scip->set, val, scalar);
41743 }
41744 
41745 /** checks, if given fractional part is smaller than epsilon */
41747  SCIP* scip, /**< SCIP data structure */
41748  SCIP_Real val /**< value to process */
41749  )
41750 {
41751  assert(scip != NULL);
41752  assert(scip->set != NULL);
41753 
41754  return SCIPsetIsFracIntegral(scip->set, val);
41755 }
41756 
41757 /** rounds value + epsilon down to the next integer */
41759  SCIP* scip, /**< SCIP data structure */
41760  SCIP_Real val /**< value to process */
41761  )
41762 {
41763  assert(scip != NULL);
41764  assert(scip->set != NULL);
41765 
41766  return SCIPsetFloor(scip->set, val);
41767 }
41768 
41769 /** rounds value - epsilon up to the next integer */
41771  SCIP* scip, /**< SCIP data structure */
41772  SCIP_Real val /**< value to process */
41773  )
41774 {
41775  assert(scip != NULL);
41776  assert(scip->set != NULL);
41777 
41778  return SCIPsetCeil(scip->set, val);
41779 }
41780 
41781 /** rounds value to the nearest integer with epsilon tolerance */
41783  SCIP* scip, /**< SCIP data structure */
41784  SCIP_Real val /**< value to process */
41785  )
41786 {
41787  assert(scip != NULL);
41788  assert(scip->set != NULL);
41789 
41790  return SCIPsetRound(scip->set, val);
41791 }
41792 
41793 /** returns fractional part of value, i.e. x - floor(x) in epsilon tolerance */
41795  SCIP* scip, /**< SCIP data structure */
41796  SCIP_Real val /**< value to return fractional part for */
41797  )
41798 {
41799  assert(scip != NULL);
41800  assert(scip->set != NULL);
41801 
41802  return SCIPsetFrac(scip->set, val);
41803 }
41804 
41805 /** checks, if values are in range of sumepsilon */
41807  SCIP* scip, /**< SCIP data structure */
41808  SCIP_Real val1, /**< first value to be compared */
41809  SCIP_Real val2 /**< second value to be compared */
41810  )
41811 {
41812  assert(scip != NULL);
41813  assert(scip->set != NULL);
41814 
41815  return SCIPsetIsSumEQ(scip->set, val1, val2);
41816 }
41817 
41818 /** checks, if val1 is (more than sumepsilon) lower than val2 */
41820  SCIP* scip, /**< SCIP data structure */
41821  SCIP_Real val1, /**< first value to be compared */
41822  SCIP_Real val2 /**< second value to be compared */
41823  )
41824 {
41825  assert(scip != NULL);
41826  assert(scip->set != NULL);
41827 
41828  return SCIPsetIsSumLT(scip->set, val1, val2);
41829 }
41830 
41831 /** checks, if val1 is not (more than sumepsilon) greater than val2 */
41833  SCIP* scip, /**< SCIP data structure */
41834  SCIP_Real val1, /**< first value to be compared */
41835  SCIP_Real val2 /**< second value to be compared */
41836  )
41837 {
41838  assert(scip != NULL);
41839  assert(scip->set != NULL);
41840 
41841  return SCIPsetIsSumLE(scip->set, val1, val2);
41842 }
41843 
41844 /** checks, if val1 is (more than sumepsilon) greater than val2 */
41846  SCIP* scip, /**< SCIP data structure */
41847  SCIP_Real val1, /**< first value to be compared */
41848  SCIP_Real val2 /**< second value to be compared */
41849  )
41850 {
41851  assert(scip != NULL);
41852  assert(scip->set != NULL);
41853 
41854  return SCIPsetIsSumGT(scip->set, val1, val2);
41855 }
41856 
41857 /** checks, if val1 is not (more than sumepsilon) lower than val2 */
41859  SCIP* scip, /**< SCIP data structure */
41860  SCIP_Real val1, /**< first value to be compared */
41861  SCIP_Real val2 /**< second value to be compared */
41862  )
41863 {
41864  assert(scip != NULL);
41865  assert(scip->set != NULL);
41866 
41867  return SCIPsetIsSumGE(scip->set, val1, val2);
41868 }
41869 
41870 /** checks, if value is in range sumepsilon of 0.0 */
41872  SCIP* scip, /**< SCIP data structure */
41873  SCIP_Real val /**< value to process */
41874  )
41875 {
41876  assert(scip != NULL);
41877  assert(scip->set != NULL);
41878 
41879  return SCIPsetIsSumZero(scip->set, val);
41880 }
41881 
41882 /** checks, if value is greater than sumepsilon */
41884  SCIP* scip, /**< SCIP data structure */
41885  SCIP_Real val /**< value to process */
41886  )
41887 {
41888  assert(scip != NULL);
41889  assert(scip->set != NULL);
41890 
41891  return SCIPsetIsSumPositive(scip->set, val);
41892 }
41893 
41894 /** checks, if value is lower than -sumepsilon */
41896  SCIP* scip, /**< SCIP data structure */
41897  SCIP_Real val /**< value to process */
41898  )
41899 {
41900  assert(scip != NULL);
41901  assert(scip->set != NULL);
41902 
41903  return SCIPsetIsSumNegative(scip->set, val);
41904 }
41905 
41906 /** checks, if relative difference of values is in range of feasibility tolerance */
41908  SCIP* scip, /**< SCIP data structure */
41909  SCIP_Real val1, /**< first value to be compared */
41910  SCIP_Real val2 /**< second value to be compared */
41911  )
41912 {
41913  assert(scip != NULL);
41914  assert(scip->set != NULL);
41915 
41916  return SCIPsetIsFeasEQ(scip->set, val1, val2);
41917 }
41918 
41919 /** checks, if relative difference val1 and val2 is lower than feasibility tolerance */
41921  SCIP* scip, /**< SCIP data structure */
41922  SCIP_Real val1, /**< first value to be compared */
41923  SCIP_Real val2 /**< second value to be compared */
41924  )
41925 {
41926  assert(scip != NULL);
41927  assert(scip->set != NULL);
41928 
41929  return SCIPsetIsFeasLT(scip->set, val1, val2);
41930 }
41931 
41932 /** checks, if relative difference of val1 and val2 is not greater than feasibility tolerance */
41934  SCIP* scip, /**< SCIP data structure */
41935  SCIP_Real val1, /**< first value to be compared */
41936  SCIP_Real val2 /**< second value to be compared */
41937  )
41938 {
41939  assert(scip != NULL);
41940  assert(scip->set != NULL);
41941 
41942  return SCIPsetIsFeasLE(scip->set, val1, val2);
41943 }
41944 
41945 /** checks, if relative difference of val1 and val2 is greater than feastol */
41947  SCIP* scip, /**< SCIP data structure */
41948  SCIP_Real val1, /**< first value to be compared */
41949  SCIP_Real val2 /**< second value to be compared */
41950  )
41951 {
41952  assert(scip != NULL);
41953  assert(scip->set != NULL);
41954 
41955  return SCIPsetIsFeasGT(scip->set, val1, val2);
41956 }
41957 
41958 /** checks, if relative difference of val1 and val2 is not lower than -feastol */
41960  SCIP* scip, /**< SCIP data structure */
41961  SCIP_Real val1, /**< first value to be compared */
41962  SCIP_Real val2 /**< second value to be compared */
41963  )
41964 {
41965  assert(scip != NULL);
41966  assert(scip->set != NULL);
41967 
41968  return SCIPsetIsFeasGE(scip->set, val1, val2);
41969 }
41970 
41971 /** checks, if value is in range feasibility tolerance of 0.0 */
41973  SCIP* scip, /**< SCIP data structure */
41974  SCIP_Real val /**< value to process */
41975  )
41976 {
41977  assert(scip != NULL);
41978  assert(scip->set != NULL);
41979 
41980  return SCIPsetIsFeasZero(scip->set, val);
41981 }
41982 
41983 /** checks, if value is greater than feasibility tolerance */
41985  SCIP* scip, /**< SCIP data structure */
41986  SCIP_Real val /**< value to process */
41987  )
41988 {
41989  assert(scip != NULL);
41990  assert(scip->set != NULL);
41991 
41992  return SCIPsetIsFeasPositive(scip->set, val);
41993 }
41994 
41995 /** checks, if value is lower than -feasibility tolerance */
41997  SCIP* scip, /**< SCIP data structure */
41998  SCIP_Real val /**< value to process */
41999  )
42000 {
42001  assert(scip != NULL);
42002  assert(scip->set != NULL);
42003 
42004  return SCIPsetIsFeasNegative(scip->set, val);
42005 }
42006 
42007 /** checks, if value is integral within the LP feasibility bounds */
42009  SCIP* scip, /**< SCIP data structure */
42010  SCIP_Real val /**< value to process */
42011  )
42012 {
42013  assert(scip != NULL);
42014  assert(scip->set != NULL);
42015 
42016  return SCIPsetIsFeasIntegral(scip->set, val);
42017 }
42018 
42019 /** checks, if given fractional part is smaller than feastol */
42021  SCIP* scip, /**< SCIP data structure */
42022  SCIP_Real val /**< value to process */
42023  )
42024 {
42025  assert(scip != NULL);
42026  assert(scip->set != NULL);
42027 
42028  return SCIPsetIsFeasFracIntegral(scip->set, val);
42029 }
42030 
42031 /** rounds value + feasibility tolerance down to the next integer */
42033  SCIP* scip, /**< SCIP data structure */
42034  SCIP_Real val /**< value to process */
42035  )
42036 {
42037  assert(scip != NULL);
42038  assert(scip->set != NULL);
42039 
42040  return SCIPsetFeasFloor(scip->set, val);
42041 }
42042 
42043 /** rounds value - feasibility tolerance up to the next integer */
42045  SCIP* scip, /**< SCIP data structure */
42046  SCIP_Real val /**< value to process */
42047  )
42048 {
42049  assert(scip != NULL);
42050  assert(scip->set != NULL);
42051 
42052  return SCIPsetFeasCeil(scip->set, val);
42053 }
42054 
42055 /** rounds value to the nearest integer in feasibility tolerance */
42057  SCIP* scip, /**< SCIP data structure */
42058  SCIP_Real val /**< value to process */
42059  )
42060 {
42061  assert(scip != NULL);
42062  assert(scip->set != NULL);
42063 
42064  return SCIPsetFeasRound(scip->set, val);
42065 }
42066 
42067 /** returns fractional part of value, i.e. x - floor(x) in feasibility tolerance */
42069  SCIP* scip, /**< SCIP data structure */
42070  SCIP_Real val /**< value to process */
42071  )
42072 {
42073  assert(scip != NULL);
42074  assert(scip->set != NULL);
42075 
42076  return SCIPsetFeasFrac(scip->set, val);
42077 }
42078 
42079 /** checks, if relative difference of values is in range of dual feasibility tolerance */
42081  SCIP* scip, /**< SCIP data structure */
42082  SCIP_Real val1, /**< first value to be compared */
42083  SCIP_Real val2 /**< second value to be compared */
42084  )
42085 {
42086  assert(scip != NULL);
42087  assert(scip->set != NULL);
42088 
42089  return SCIPsetIsDualfeasEQ(scip->set, val1, val2);
42090 }
42091 
42092 /** checks, if relative difference val1 and val2 is lower than dual feasibility tolerance */
42094  SCIP* scip, /**< SCIP data structure */
42095  SCIP_Real val1, /**< first value to be compared */
42096  SCIP_Real val2 /**< second value to be compared */
42097  )
42098 {
42099  assert(scip != NULL);
42100  assert(scip->set != NULL);
42101 
42102  return SCIPsetIsDualfeasLT(scip->set, val1, val2);
42103 }
42104 
42105 /** checks, if relative difference of val1 and val2 is not greater than dual feasibility tolerance */
42107  SCIP* scip, /**< SCIP data structure */
42108  SCIP_Real val1, /**< first value to be compared */
42109  SCIP_Real val2 /**< second value to be compared */
42110  )
42111 {
42112  assert(scip != NULL);
42113  assert(scip->set != NULL);
42114 
42115  return SCIPsetIsDualfeasLE(scip->set, val1, val2);
42116 }
42117 
42118 /** checks, if relative difference of val1 and val2 is greater than dual feasibility tolerance */
42120  SCIP* scip, /**< SCIP data structure */
42121  SCIP_Real val1, /**< first value to be compared */
42122  SCIP_Real val2 /**< second value to be compared */
42123  )
42124 {
42125  assert(scip != NULL);
42126  assert(scip->set != NULL);
42127 
42128  return SCIPsetIsDualfeasGT(scip->set, val1, val2);
42129 }
42130 
42131 /** checks, if relative difference of val1 and val2 is not lower than -dual feasibility tolerance */
42133  SCIP* scip, /**< SCIP data structure */
42134  SCIP_Real val1, /**< first value to be compared */
42135  SCIP_Real val2 /**< second value to be compared */
42136  )
42137 {
42138  assert(scip != NULL);
42139  assert(scip->set != NULL);
42140 
42141  return SCIPsetIsDualfeasGE(scip->set, val1, val2);
42142 }
42143 
42144 /** checks, if value is in range dual feasibility tolerance of 0.0 */
42146  SCIP* scip, /**< SCIP data structure */
42147  SCIP_Real val /**< value to process */
42148  )
42149 {
42150  assert(scip != NULL);
42151  assert(scip->set != NULL);
42152 
42153  return SCIPsetIsDualfeasZero(scip->set, val);
42154 }
42155 
42156 /** checks, if value is greater than dual feasibility tolerance */
42158  SCIP* scip, /**< SCIP data structure */
42159  SCIP_Real val /**< value to process */
42160  )
42161 {
42162  assert(scip != NULL);
42163  assert(scip->set != NULL);
42164 
42165  return SCIPsetIsDualfeasPositive(scip->set, val);
42166 }
42167 
42168 /** checks, if value is lower than -dual feasibility tolerance */
42170  SCIP* scip, /**< SCIP data structure */
42171  SCIP_Real val /**< value to process */
42172  )
42173 {
42174  assert(scip != NULL);
42175  assert(scip->set != NULL);
42176 
42177  return SCIPsetIsDualfeasNegative(scip->set, val);
42178 }
42179 
42180 /** checks, if value is integral within the LP dual feasibility tolerance */
42182  SCIP* scip, /**< SCIP data structure */
42183  SCIP_Real val /**< value to process */
42184  )
42185 {
42186  assert(scip != NULL);
42187  assert(scip->set != NULL);
42188 
42189  return SCIPsetIsDualfeasIntegral(scip->set, val);
42190 }
42191 
42192 /** checks, if given fractional part is smaller than dual feasibility tolerance */
42194  SCIP* scip, /**< SCIP data structure */
42195  SCIP_Real val /**< value to process */
42196  )
42197 {
42198  assert(scip != NULL);
42199  assert(scip->set != NULL);
42200 
42201  return SCIPsetIsDualfeasFracIntegral(scip->set, val);
42202 }
42203 
42204 /** rounds value + dual feasibility tolerance down to the next integer */
42206  SCIP* scip, /**< SCIP data structure */
42207  SCIP_Real val /**< value to process */
42208  )
42209 {
42210  assert(scip != NULL);
42211  assert(scip->set != NULL);
42212 
42213  return SCIPsetDualfeasFloor(scip->set, val);
42214 }
42215 
42216 /** rounds value - dual feasibility tolerance up to the next integer */
42218  SCIP* scip, /**< SCIP data structure */
42219  SCIP_Real val /**< value to process */
42220  )
42221 {
42222  assert(scip != NULL);
42223  assert(scip->set != NULL);
42224 
42225  return SCIPsetDualfeasCeil(scip->set, val);
42226 }
42227 
42228 /** rounds value to the nearest integer in dual feasibility tolerance */
42230  SCIP* scip, /**< SCIP data structure */
42231  SCIP_Real val /**< value to process */
42232  )
42233 {
42234  assert(scip != NULL);
42235  assert(scip->set != NULL);
42236 
42237  return SCIPsetDualfeasRound(scip->set, val);
42238 }
42239 
42240 /** returns fractional part of value, i.e. x - floor(x) in dual feasibility tolerance */
42242  SCIP* scip, /**< SCIP data structure */
42243  SCIP_Real val /**< value to process */
42244  )
42245 {
42246  assert(scip != NULL);
42247  assert(scip->set != NULL);
42248 
42249  return SCIPsetDualfeasFrac(scip->set, val);
42250 }
42251 
42252 /** checks, if the given new lower bound is at least min(oldub - oldlb, |oldlb|) times the bound
42253  * strengthening epsilon better than the old one
42254  */
42256  SCIP* scip, /**< SCIP data structure */
42257  SCIP_Real newlb, /**< new lower bound */
42258  SCIP_Real oldlb, /**< old lower bound */
42259  SCIP_Real oldub /**< old upper bound */
42260  )
42261 {
42262  assert(scip != NULL);
42263 
42264  return SCIPsetIsLbBetter(scip->set, newlb, oldlb, oldub);
42265 }
42266 
42267 /** checks, if the given new upper bound is at least min(oldub - oldlb, |oldub|) times the bound
42268  * strengthening epsilon better than the old one
42269  */
42271  SCIP* scip, /**< SCIP data structure */
42272  SCIP_Real newub, /**< new upper bound */
42273  SCIP_Real oldlb, /**< old lower bound */
42274  SCIP_Real oldub /**< old upper bound */
42275  )
42276 {
42277  assert(scip != NULL);
42278 
42279  return SCIPsetIsUbBetter(scip->set, newub, oldlb, oldub);
42280 }
42281 
42282 /** checks, if relative difference of values is in range of epsilon */
42284  SCIP* scip, /**< SCIP data structure */
42285  SCIP_Real val1, /**< first value to be compared */
42286  SCIP_Real val2 /**< second value to be compared */
42287  )
42288 {
42289  assert(scip != NULL);
42290  assert(scip->set != NULL);
42291 
42292  return SCIPsetIsRelEQ(scip->set, val1, val2);
42293 }
42294 
42295 /** checks, if relative difference of val1 and val2 is lower than epsilon */
42297  SCIP* scip, /**< SCIP data structure */
42298  SCIP_Real val1, /**< first value to be compared */
42299  SCIP_Real val2 /**< second value to be compared */
42300  )
42301 {
42302  assert(scip != NULL);
42303  assert(scip->set != NULL);
42304 
42305  return SCIPsetIsRelLT(scip->set, val1, val2);
42306 }
42307 
42308 /** checks, if relative difference of val1 and val2 is not greater than epsilon */
42310  SCIP* scip, /**< SCIP data structure */
42311  SCIP_Real val1, /**< first value to be compared */
42312  SCIP_Real val2 /**< second value to be compared */
42313  )
42314 {
42315  assert(scip != NULL);
42316  assert(scip->set != NULL);
42317 
42318  return SCIPsetIsRelLE(scip->set, val1, val2);
42319 }
42320 
42321 /** checks, if relative difference of val1 and val2 is greater than epsilon */
42323  SCIP* scip, /**< SCIP data structure */
42324  SCIP_Real val1, /**< first value to be compared */
42325  SCIP_Real val2 /**< second value to be compared */
42326  )
42327 {
42328  assert(scip != NULL);
42329  assert(scip->set != NULL);
42330 
42331  return SCIPsetIsRelGT(scip->set, val1, val2);
42332 }
42333 
42334 /** checks, if relative difference of val1 and val2 is not lower than -epsilon */
42336  SCIP* scip, /**< SCIP data structure */
42337  SCIP_Real val1, /**< first value to be compared */
42338  SCIP_Real val2 /**< second value to be compared */
42339  )
42340 {
42341  assert(scip != NULL);
42342  assert(scip->set != NULL);
42343 
42344  return SCIPsetIsRelGE(scip->set, val1, val2);
42345 }
42346 
42347 /** checks, if relative difference of values is in range of sumepsilon */
42349  SCIP* scip, /**< SCIP data structure */
42350  SCIP_Real val1, /**< first value to be compared */
42351  SCIP_Real val2 /**< second value to be compared */
42352  )
42353 {
42354  assert(scip != NULL);
42355  assert(scip->set != NULL);
42356 
42357  return SCIPsetIsSumRelEQ(scip->set, val1, val2);
42358 }
42359 
42360 /** checks, if relative difference of val1 and val2 is lower than sumepsilon */
42362  SCIP* scip, /**< SCIP data structure */
42363  SCIP_Real val1, /**< first value to be compared */
42364  SCIP_Real val2 /**< second value to be compared */
42365  )
42366 {
42367  assert(scip != NULL);
42368  assert(scip->set != NULL);
42369 
42370  return SCIPsetIsSumRelLT(scip->set, val1, val2);
42371 }
42372 
42373 /** checks, if relative difference of val1 and val2 is not greater than sumepsilon */
42375  SCIP* scip, /**< SCIP data structure */
42376  SCIP_Real val1, /**< first value to be compared */
42377  SCIP_Real val2 /**< second value to be compared */
42378  )
42379 {
42380  assert(scip != NULL);
42381  assert(scip->set != NULL);
42382 
42383  return SCIPsetIsSumRelLE(scip->set, val1, val2);
42384 }
42385 
42386 /** checks, if relative difference of val1 and val2 is greater than sumepsilon */
42388  SCIP* scip, /**< SCIP data structure */
42389  SCIP_Real val1, /**< first value to be compared */
42390  SCIP_Real val2 /**< second value to be compared */
42391  )
42392 {
42393  assert(scip != NULL);
42394  assert(scip->set != NULL);
42395 
42396  return SCIPsetIsSumRelGT(scip->set, val1, val2);
42397 }
42398 
42399 /** checks, if relative difference of val1 and val2 is not lower than -sumepsilon */
42401  SCIP* scip, /**< SCIP data structure */
42402  SCIP_Real val1, /**< first value to be compared */
42403  SCIP_Real val2 /**< second value to be compared */
42404  )
42405 {
42406  assert(scip != NULL);
42407  assert(scip->set != NULL);
42408 
42409  return SCIPsetIsSumRelGE(scip->set, val1, val2);
42410 }
42411 
42412 /** converts the given real number representing an integer to an int; in optimized mode the function gets inlined for
42413  * performance; in debug mode we check some additional conditions
42414  */
42416  SCIP* scip, /**< SCIP data structure */
42417  SCIP_Real real /**< double bound to convert */
42418  )
42419 {
42420  assert(SCIPisFeasIntegral(scip, real));
42421  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(int)(real < 0 ? real - 0.5 : real + 0.5)));
42422  assert(real < INT_MAX);
42423  assert(real > INT_MIN);
42424 
42425  return (int)(real < 0 ? (real - 0.5) : (real + 0.5));
42426 }
42427 
42428 /** converts the given real number representing an integer to a long integer; in optimized mode the function gets inlined for
42429  * performance; in debug mode we check some additional conditions
42430  */
42432  SCIP* scip, /**< SCIP data structure */
42433  SCIP_Real real /**< double bound to convert */
42434  )
42435 {
42436  assert(SCIPisFeasIntegral(scip, real));
42437  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(SCIP_Longint)(real < 0 ? real - 0.5 : real + 0.5)));
42438  assert(real < SCIP_LONGINT_MAX);
42439  assert(real > SCIP_LONGINT_MIN);
42440 
42441  return (SCIP_Longint)(real < 0 ? (real - 0.5) : (real + 0.5));
42442 }
42443 
42444 /** Checks, if an iteratively updated value is reliable or should be recomputed from scratch.
42445  * This is useful, if the value, e.g., the activity of a linear constraint or the pseudo objective value, gets a high
42446  * absolute value during the optimization process which is later reduced significantly. In this case, the last digits
42447  * were canceled out when increasing the value and are random after decreasing it.
42448  * We do not consider the cancellations which can occur during increasing the absolute value because they just cannot
42449  * be expressed using fixed precision floating point arithmetic, anymore.
42450  * In order to get more reliable values, the idea is to always store the last reliable value, where increasing the
42451  * absolute of the value is viewed as preserving reliability. Then, after each update, the new absolute value can be
42452  * compared against the last reliable one with this method, checking whether it was decreased by a factor of at least
42453  * "lp/recompfac" and should be recomputed.
42454  */
42456  SCIP* scip, /**< SCIP data structure */
42457  SCIP_Real newvalue, /**< new value after update */
42458  SCIP_Real oldvalue /**< old value, i.e., last reliable value */
42459  )
42460 {
42461  assert(scip != NULL);
42462 
42463  SCIP_CALL_ABORT( checkStage(scip, "SCIPisUpdateUnreliable", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42464 
42465  return SCIPsetIsUpdateUnreliable(scip->set, newvalue, oldvalue);
42466 }
42467 
42468 /** creates a dynamic array of real values
42469  *
42470  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42471  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42472  */
42474  SCIP* scip, /**< SCIP data structure */
42475  SCIP_REALARRAY** realarray /**< pointer to store the real array */
42476  )
42477 {
42478  assert(scip != NULL);
42479 
42480  SCIP_CALL( SCIPrealarrayCreate(realarray, SCIPblkmem(scip)) );
42481 
42482  return SCIP_OKAY;
42483 }
42484 
42485 /** frees a dynamic array of real values
42486  *
42487  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42488  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42489  */
42491  SCIP* scip, /**< SCIP data structure */
42492  SCIP_REALARRAY** realarray /**< pointer to the real array */
42493  )
42494 {
42495  assert(scip != NULL);
42496 
42497  SCIP_CALL( SCIPrealarrayFree(realarray) );
42498 
42499  return SCIP_OKAY;
42500 }
42501 
42502 /** extends dynamic array to be able to store indices from minidx to maxidx
42503  *
42504  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42505  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42506  */
42508  SCIP* scip, /**< SCIP data structure */
42509  SCIP_REALARRAY* realarray, /**< dynamic real array */
42510  int minidx, /**< smallest index to allocate storage for */
42511  int maxidx /**< largest index to allocate storage for */
42512  )
42513 {
42514  assert(scip != NULL);
42515 
42516  SCIP_CALL( SCIPrealarrayExtend(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
42517 
42518  return SCIP_OKAY;
42519 }
42520 
42521 /** clears a dynamic real array
42522  *
42523  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42524  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42525  */
42527  SCIP* scip, /**< SCIP data structure */
42528  SCIP_REALARRAY* realarray /**< dynamic real array */
42529  )
42530 {
42531  assert(scip != NULL);
42532 
42533  SCIP_CALL( SCIPrealarrayClear(realarray) );
42534 
42535  return SCIP_OKAY;
42536 }
42537 
42538 /** gets value of entry in dynamic array
42539  *
42540  * @return value of entry in dynamic array
42541  */
42543  SCIP* scip, /**< SCIP data structure */
42544  SCIP_REALARRAY* realarray, /**< dynamic real array */
42545  int idx /**< array index to get value for */
42546  )
42547 {
42548  assert(scip != NULL);
42549 
42550  return SCIPrealarrayGetVal(realarray, idx);
42551 }
42552 
42553 /** sets value of entry in dynamic array
42554  *
42555  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42556  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42557  */
42559  SCIP* scip, /**< SCIP data structure */
42560  SCIP_REALARRAY* realarray, /**< dynamic real array */
42561  int idx, /**< array index to set value for */
42562  SCIP_Real val /**< value to set array index to */
42563  )
42564 {
42565  assert(scip != NULL);
42566 
42567  SCIP_CALL( SCIPrealarraySetVal(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
42568 
42569  return SCIP_OKAY;
42570 }
42571 
42572 /** increases value of entry in dynamic array
42573  *
42574  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42575  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42576  */
42578  SCIP* scip, /**< SCIP data structure */
42579  SCIP_REALARRAY* realarray, /**< dynamic real array */
42580  int idx, /**< array index to increase value for */
42581  SCIP_Real incval /**< value to increase array index */
42582  )
42583 {
42584  assert(scip != NULL);
42585 
42586  SCIP_CALL( SCIPrealarrayIncVal(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, incval) );
42587 
42588  return SCIP_OKAY;
42589 }
42590 
42591 /** returns the minimal index of all stored non-zero elements
42592  *
42593  * @return the minimal index of all stored non-zero elements
42594  */
42596  SCIP* scip, /**< SCIP data structure */
42597  SCIP_REALARRAY* realarray /**< dynamic real array */
42598  )
42599 {
42600  assert(scip != NULL);
42601 
42602  return SCIPrealarrayGetMinIdx(realarray);
42603 }
42604 
42605 /** returns the maximal index of all stored non-zero elements
42606  *
42607  * @return the maximal index of all stored non-zero elements
42608  */
42610  SCIP* scip, /**< SCIP data structure */
42611  SCIP_REALARRAY* realarray /**< dynamic real array */
42612  )
42613 {
42614  assert(scip != NULL);
42615 
42616  return SCIPrealarrayGetMaxIdx(realarray);
42617 }
42618 
42619 /** creates a dynamic array of int values
42620  *
42621  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42622  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42623  */
42625  SCIP* scip, /**< SCIP data structure */
42626  SCIP_INTARRAY** intarray /**< pointer to store the int array */
42627  )
42628 {
42629  assert(scip != NULL);
42630 
42631  SCIP_CALL( SCIPintarrayCreate(intarray, SCIPblkmem(scip)) );
42632 
42633  return SCIP_OKAY;
42634 }
42635 
42636 /** frees a dynamic array of int values
42637  *
42638  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42639  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42640  */
42642  SCIP* scip, /**< SCIP data structure */
42643  SCIP_INTARRAY** intarray /**< pointer to the int array */
42644  )
42645 {
42646  assert(scip != NULL);
42647 
42648  SCIP_CALL( SCIPintarrayFree(intarray) );
42649 
42650  return SCIP_OKAY;
42651 }
42652 
42653 /** extends dynamic array to be able to store indices from minidx to maxidx
42654  *
42655  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42656  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42657  */
42659  SCIP* scip, /**< SCIP data structure */
42660  SCIP_INTARRAY* intarray, /**< dynamic int array */
42661  int minidx, /**< smallest index to allocate storage for */
42662  int maxidx /**< largest index to allocate storage for */
42663  )
42664 {
42665  assert(scip != NULL);
42666 
42667  SCIP_CALL( SCIPintarrayExtend(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
42668 
42669  return SCIP_OKAY;
42670 }
42671 
42672 /** clears a dynamic int array
42673  *
42674  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42675  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42676  */
42678  SCIP* scip, /**< SCIP data structure */
42679  SCIP_INTARRAY* intarray /**< dynamic int array */
42680  )
42681 {
42682  assert(scip != NULL);
42683 
42684  SCIP_CALL( SCIPintarrayClear(intarray) );
42685 
42686  return SCIP_OKAY;
42687 }
42688 
42689 /** gets value of entry in dynamic array
42690  *
42691  * @return value of entry in dynamic array
42692  */
42694  SCIP* scip, /**< SCIP data structure */
42695  SCIP_INTARRAY* intarray, /**< dynamic int array */
42696  int idx /**< array index to get value for */
42697  )
42698 {
42699  assert(scip != NULL);
42700 
42701  return SCIPintarrayGetVal(intarray, idx);
42702 }
42703 
42704 /** sets value of entry in dynamic array
42705  *
42706  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42707  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42708  */
42710  SCIP* scip, /**< SCIP data structure */
42711  SCIP_INTARRAY* intarray, /**< dynamic int array */
42712  int idx, /**< array index to set value for */
42713  int val /**< value to set array index to */
42714  )
42715 {
42716  assert(scip != NULL);
42717 
42718  SCIP_CALL( SCIPintarraySetVal(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
42719 
42720  return SCIP_OKAY;
42721 }
42722 
42723 /** increases value of entry in dynamic array
42724  *
42725  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42726  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42727  */
42729  SCIP* scip, /**< SCIP data structure */
42730  SCIP_INTARRAY* intarray, /**< dynamic int array */
42731  int idx, /**< array index to increase value for */
42732  int incval /**< value to increase array index */
42733  )
42734 {
42735  assert(scip != NULL);
42736 
42737  SCIP_CALL( SCIPintarrayIncVal(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, incval) );
42738 
42739  return SCIP_OKAY;
42740 }
42741 
42742 /** returns the minimal index of all stored non-zero elements
42743  *
42744  * @return the minimal index of all stored non-zero elements
42745  */
42747  SCIP* scip, /**< SCIP data structure */
42748  SCIP_INTARRAY* intarray /**< dynamic int array */
42749  )
42750 {
42751  assert(scip != NULL);
42752 
42753  return SCIPintarrayGetMinIdx(intarray);
42754 }
42755 
42756 /** returns the maximal index of all stored non-zero elements
42757  *
42758  * @return the maximal index of all stored non-zero elements
42759  */
42761  SCIP* scip, /**< SCIP data structure */
42762  SCIP_INTARRAY* intarray /**< dynamic int array */
42763  )
42764 {
42765  assert(scip != NULL);
42766 
42767  return SCIPintarrayGetMaxIdx(intarray);
42768 }
42769 
42770 /** creates a dynamic array of bool values
42771  *
42772  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42773  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42774  */
42776  SCIP* scip, /**< SCIP data structure */
42777  SCIP_BOOLARRAY** boolarray /**< pointer to store the bool array */
42778  )
42779 {
42780  assert(scip != NULL);
42781 
42782  SCIP_CALL( SCIPboolarrayCreate(boolarray, SCIPblkmem(scip)) );
42783 
42784  return SCIP_OKAY;
42785 }
42786 
42787 /** frees a dynamic array of bool values
42788  *
42789  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42790  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42791  */
42793  SCIP* scip, /**< SCIP data structure */
42794  SCIP_BOOLARRAY** boolarray /**< pointer to the bool array */
42795  )
42796 {
42797  assert(scip != NULL);
42798 
42799  SCIP_CALL( SCIPboolarrayFree(boolarray) );
42800 
42801  return SCIP_OKAY;
42802 }
42803 
42804 /** extends dynamic array to be able to store indices from minidx to maxidx
42805  *
42806  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42807  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42808  */
42810  SCIP* scip, /**< SCIP data structure */
42811  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
42812  int minidx, /**< smallest index to allocate storage for */
42813  int maxidx /**< largest index to allocate storage for */
42814  )
42815 {
42816  assert(scip != NULL);
42817 
42818  SCIP_CALL( SCIPboolarrayExtend(boolarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
42819 
42820  return SCIP_OKAY;
42821 }
42822 
42823 /** clears a dynamic bool array
42824  *
42825  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42826  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42827  */
42829  SCIP* scip, /**< SCIP data structure */
42830  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
42831  )
42832 {
42833  assert(scip != NULL);
42834 
42835  SCIP_CALL( SCIPboolarrayClear(boolarray) );
42836 
42837  return SCIP_OKAY;
42838 }
42839 
42840 /** gets value of entry in dynamic array
42841  *
42842  * @return value of entry in dynamic array at position idx
42843  */
42845  SCIP* scip, /**< SCIP data structure */
42846  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
42847  int idx /**< array index to get value for */
42848  )
42849 {
42850  assert(scip != NULL);
42851 
42852  return SCIPboolarrayGetVal(boolarray, idx);
42853 }
42854 
42855 /** sets value of entry in dynamic array
42856  *
42857  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42858  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42859  */
42861  SCIP* scip, /**< SCIP data structure */
42862  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
42863  int idx, /**< array index to set value for */
42864  SCIP_Bool val /**< value to set array index to */
42865  )
42866 {
42867  assert(scip != NULL);
42868 
42869  SCIP_CALL( SCIPboolarraySetVal(boolarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
42870 
42871  return SCIP_OKAY;
42872 }
42873 
42874 /** returns the minimal index of all stored non-zero elements
42875  *
42876  * @return the minimal index of all stored non-zero elements
42877  */
42879  SCIP* scip, /**< SCIP data structure */
42880  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
42881  )
42882 {
42883  assert(scip != NULL);
42884 
42885  return SCIPboolarrayGetMinIdx(boolarray);
42886 }
42887 
42888 /** returns the maximal index of all stored non-zero elements
42889  *
42890  * @return the maximal index of all stored non-zero elements
42891  */
42893  SCIP* scip, /**< SCIP data structure */
42894  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
42895  )
42896 {
42897  assert(scip != NULL);
42898 
42899  return SCIPboolarrayGetMaxIdx(boolarray);
42900 }
42901 
42902 /** creates a dynamic array of pointers
42903  *
42904  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42905  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42906  */
42908  SCIP* scip, /**< SCIP data structure */
42909  SCIP_PTRARRAY** ptrarray /**< pointer to store the int array */
42910  )
42911 {
42912  assert(scip != NULL);
42913 
42914  SCIP_CALL( SCIPptrarrayCreate(ptrarray, SCIPblkmem(scip)) );
42915 
42916  return SCIP_OKAY;
42917 }
42918 
42919 /** frees a dynamic array of pointers
42920  *
42921  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42922  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42923  */
42925  SCIP* scip, /**< SCIP data structure */
42926  SCIP_PTRARRAY** ptrarray /**< pointer to the int array */
42927  )
42928 {
42929  assert(scip != NULL);
42930 
42931  SCIP_CALL( SCIPptrarrayFree(ptrarray) );
42932 
42933  return SCIP_OKAY;
42934 }
42935 
42936 /** extends dynamic array to be able to store indices from minidx to maxidx
42937  *
42938  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42939  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42940  */
42942  SCIP* scip, /**< SCIP data structure */
42943  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
42944  int minidx, /**< smallest index to allocate storage for */
42945  int maxidx /**< largest index to allocate storage for */
42946  )
42947 {
42948  assert(scip != NULL);
42949 
42950  SCIP_CALL( SCIPptrarrayExtend(ptrarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
42951 
42952  return SCIP_OKAY;
42953 }
42954 
42955 /** clears a dynamic pointer array
42956  *
42957  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42958  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42959  */
42961  SCIP* scip, /**< SCIP data structure */
42962  SCIP_PTRARRAY* ptrarray /**< dynamic int array */
42963  )
42964 {
42965  assert(scip != NULL);
42966 
42967  SCIP_CALL( SCIPptrarrayClear(ptrarray) );
42968 
42969  return SCIP_OKAY;
42970 }
42971 
42972 /** gets value of entry in dynamic array */
42974  SCIP* scip, /**< SCIP data structure */
42975  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
42976  int idx /**< array index to get value for */
42977  )
42978 {
42979  assert(scip != NULL);
42980 
42981  return SCIPptrarrayGetVal(ptrarray, idx);
42982 }
42983 
42984 /** sets value of entry in dynamic array
42985  *
42986  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42987  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42988  */
42990  SCIP* scip, /**< SCIP data structure */
42991  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
42992  int idx, /**< array index to set value for */
42993  void* val /**< value to set array index to */
42994  )
42995 {
42996  assert(scip != NULL);
42997 
42998  SCIP_CALL( SCIPptrarraySetVal(ptrarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
42999 
43000  return SCIP_OKAY;
43001 }
43002 
43003 /** returns the minimal index of all stored non-zero elements
43004  *
43005  * @return the minimal index of all stored non-zero elements
43006  */
43008  SCIP* scip, /**< SCIP data structure */
43009  SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
43010  )
43011 {
43012  assert(scip != NULL);
43013 
43014  return SCIPptrarrayGetMinIdx(ptrarray);
43015 }
43016 
43017 /** returns the maximal index of all stored non-zero elements
43018  *
43019  * @return the maximal index of all stored non-zero elements
43020  */
43022  SCIP* scip, /**< SCIP data structure */
43023  SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
43024  )
43025 {
43026  assert(scip != NULL);
43027 
43028  return SCIPptrarrayGetMaxIdx(ptrarray);
43029 }
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
Definition: scip.c:7361
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:51
SCIP_VAR ** SCIPvarGetImplVars(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17352
SCIP_Real SCIPhistoryGetAvgConflictlength(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:555
SCIP_Real cutoffbound
Definition: struct_primal.h:45
void SCIPconflictEnableOrDisableClocks(SCIP_CONFLICT *conflict, SCIP_Bool enable)
Definition: conflict.c:6981
SCIP_Real SCIPdivesetGetAvgDepth(SCIP_DIVESET *diveset)
Definition: heur.c:405
SCIP_RETCODE SCIPgetNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip.c:29891
void SCIPsepaSetFree(SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
Definition: sepa.c:578
SCIP_RETCODE SCIPsetInitprePlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4528
SCIP_RETCODE SCIPunlinkSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:34812
SCIP_RETCODE SCIPgetNLPStringPar(SCIP *scip, SCIP_NLPPARAM type, const char **sval)
Definition: scip.c:29053
SCIP_RETCODE SCIPsetIncludePresol(SCIP_SET *set, SCIP_PRESOL *presol)
Definition: set.c:3475
SCIP_RETCODE SCIPnlpSetRealPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: nlp.c:6025
int SCIPgetNLPBranchCands(SCIP *scip)
Definition: scip.c:33158
SCIP_Longint SCIPconshdlrGetNChildren(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4581
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
Definition: scip.c:22777
SCIP_Longint nlexduallps
Definition: struct_stat.h:148
void SCIPpermuteArray(void **array, int begin, int end, unsigned int *randseed)
Definition: misc.c:7884
SCIP_Real SCIPsetFeasRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5769
SCIP_RETCODE SCIPtreeClear(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:4666
internal methods for separators
SCIP_RETCODE SCIPsetProbData(SCIP *scip, SCIP_PROBDATA *probdata)
Definition: scip.c:9888
SCIP_Bool SCIPsetIsUpdateUnreliable(SCIP_SET *set, SCIP_Real newvalue, SCIP_Real oldvalue)
Definition: set.c:6287
SCIP_RETCODE SCIPsetExitsolPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat, SCIP_Bool restart)
Definition: set.c:4676
SCIP_Longint nprimallps
Definition: struct_stat.h:144
SCIP_Longint SCIPconflictGetNStrongbranchSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:6697
SCIP_RETCODE SCIPsetPropExitpre(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITPRE((*propexitpre)))
Definition: scip.c:7057
SCIP_RETCODE SCIPsetPricerInitsol(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICERINITSOL((*pricerinitsol)))
Definition: scip.c:4940
SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: scip.c:7025
SCIP_RETCODE SCIPconsSetChecked(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool check)
Definition: cons.c:6214
SCIP_VAR * SCIPvarGetTransVar(SCIP_VAR *var)
Definition: var.c:16760
int SCIPrealarrayGetMaxIdx(SCIP_REALARRAY *realarray)
Definition: misc.c:2721
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41572
SCIP_STAT * stat
Definition: struct_scip.h:64
SCIP_RETCODE SCIPsetPropInit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
Definition: scip.c:6977
#define SCIP_DECL_RELAXFREE(x)
Definition: type_relax.h:55
SCIP_RETCODE SCIPconstructCurrentLP(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_PRICESTORE *pricestore, SCIP_SEPASTORE *sepastore, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool newinitconss, SCIP_Bool *cutoff)
Definition: solve.c:1145
SCIP_Real SCIPgetLocalOrigEstimate(SCIP *scip)
Definition: scip.c:12133
SCIP_RETCODE SCIPcreateConsBasicLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs)
int SCIPgetNOrigImplVars(SCIP *scip)
Definition: scip.c:11219
SCIP_RETCODE SCIPaddVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real addobj)
Definition: scip.c:19635
int SCIPconshdlrGetNAddHoles(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4651
void SCIPsetSortPropsName(SCIP_SET *set)
Definition: set.c:3772
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:102
void SCIPcomprSetInitsol(SCIP_COMPR *compr, SCIP_DECL_COMPRINITSOL((*comprinitsol)))
Definition: compr.c:373
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
void SCIPnodeselSetFree(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELFREE((*nodeselfree)))
Definition: nodesel.c:1094
SCIP_RETCODE SCIPeventfilterCreate(SCIP_EVENTFILTER **eventfilter, BMS_BLKMEM *blkmem)
Definition: event.c:1650
int ndisps
Definition: struct_set.h:113
SCIP_RETCODE SCIPsetSetEmphasis(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
Definition: set.c:3024
SCIP_Longint ndualresolvelpiterations
Definition: struct_stat.h:54
SCIP_RETCODE SCIPcreateRow(SCIP *scip, SCIP_ROW **row, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip.c:27570
SCIP_Real SCIPpresolGetTime(SCIP_PRESOL *presol)
Definition: presol.c:661
SCIP_Real SCIPvarGetMultaggrConstant(SCIP_VAR *var)
Definition: var.c:16861
SCIP_RETCODE SCIPgetLPBInvRow(SCIP *scip, int r, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:26894
SCIP_RETCODE SCIPincludeProp(SCIP *scip, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming, SCIP_DECL_PROPCOPY((*propcopy)), SCIP_DECL_PROPFREE((*propfree)), SCIP_DECL_PROPINIT((*propinit)), SCIP_DECL_PROPEXIT((*propexit)), SCIP_DECL_PROPINITPRE((*propinitpre)), SCIP_DECL_PROPEXITPRE((*propexitpre)), SCIP_DECL_PROPINITSOL((*propinitsol)), SCIP_DECL_PROPEXITSOL((*propexitsol)), SCIP_DECL_PROPPRESOL((*proppresol)), SCIP_DECL_PROPEXEC((*propexec)), SCIP_DECL_PROPRESPROP((*propresprop)), SCIP_PROPDATA *propdata)
Definition: scip.c:6855
SCIP_RETCODE SCIPsolveProbingLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:32788
SCIP_Real SCIPrelaxGetTime(SCIP_RELAX *relax)
Definition: relax.c:517
SCIP_RETCODE SCIPsetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int ival)
Definition: scip.c:28969
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Definition: scip.c:33125
SCIP_RETCODE SCIPtreeAddDiveBoundChange(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Bool preferred)
Definition: tree.c:6023
SCIP_Bool SCIPisFeasFracIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:42020
SCIP_RETCODE SCIPaddVarsToRowSameCoef(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real val)
Definition: scip.c:27932
SCIP_VAR * SCIPvarGetNegationVar(SCIP_VAR *var)
Definition: var.c:16883
int SCIPconshdlrGetNChgBds(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4641
void SCIPcolMarkNotRemovableLocal(SCIP_COL *col, SCIP_STAT *stat)
Definition: lp.c:4544
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
Definition: scip.c:15853
void SCIPeventhdlrSetInit(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINIT((*eventinit)))
Definition: event.c:331
int SCIPbranchcandGetNPrioExternBins(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:477
SCIP_RETCODE SCIPaddDiveBoundChange(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Bool preferred)
Definition: scip.c:33039
void SCIPconflicthdlrSetInit(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTINIT((*conflictinit)))
Definition: conflict.c:662
SCIP_Real SCIProwGetSolFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6272
SCIP_RETCODE SCIPgetVarsStrongbranchesInt(SCIP *scip, SCIP_VAR **vars, int nvars, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict, SCIP_Bool *lperror)
Definition: scip.c:19141
SCIP_Real SCIPgetAvgLowerbound(SCIP *scip)
Definition: scip.c:38350
SCIP_RETCODE SCIPsetComprInitsol(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRINITSOL((*comprinitsol)))
Definition: scip.c:7595
static SCIP_RETCODE compressReoptTree(SCIP *scip)
Definition: scip.c:14270
SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:40767
SCIP_RETCODE SCIPevalExprtreeSol(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_SOL *sol, SCIP_Real *val)
Definition: scip.c:30274
SCIP_Real sbup
Definition: struct_lp.h:142
SCIP_NODE ** SCIPnodepqNodes(const SCIP_NODEPQ *nodepq)
Definition: nodesel.c:540
static SCIP_RETCODE freeTransform(SCIP *scip)
Definition: scip.c:14006
void SCIPeventhdlrSetCopy(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTCOPY((*eventcopy)))
Definition: event.c:309
SCIP_SOL * primalray
Definition: struct_primal.h:50
SCIP_RETCODE SCIPcaptureNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:29449
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:41685
void SCIPlpInvalidateRootObjval(SCIP_LP *lp)
Definition: lp.c:15148
SCIP_RETCODE SCIPprimalTrySol(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: primal.c:1254
SCIP_Longint SCIPconflictGetNLocalChgBds(SCIP_CONFLICT *conflict)
Definition: conflict.c:2422
void SCIPcolGetStrongbranchLast(SCIP_COL *col, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Real *solval, SCIP_Real *lpobjval)
Definition: lp.c:4500
SCIP_RETCODE SCIPreoptApplyGlbConss(SCIP *scip, SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem)
Definition: reopt.c:6173
SCIP_RETCODE SCIPprintDisplayLine(SCIP *scip, FILE *file, SCIP_VERBLEVEL verblevel, SCIP_Bool endline)
Definition: scip.c:40623
SCIP_RETCODE SCIPsolCreateRelaxSol(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_RELAXATION *relaxation, SCIP_HEUR *heur)
Definition: sol.c:602
SCIP_Real SCIPvarGetAvgConflictlengthCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:14608
SCIP_Real SCIPgetRowMinActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28080
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
Definition: scip.c:40329
void SCIPheurSetInitsol(SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
Definition: heur.c:1125
SCIP_RETCODE SCIPnlrowGetPseudoFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *pseudofeasibility)
Definition: nlp.c:3043
SCIP_RETCODE SCIPsetIncludeEventhdlr(SCIP_SET *set, SCIP_EVENTHDLR *eventhdlr)
Definition: set.c:3936
SCIP_Bool SCIPsolveIsStopped(SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool checknodelimits)
Definition: solve.c:69
SCIP_RETCODE SCIPconsUnmarkPropagate(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6671
SCIP_RETCODE SCIPsolUnlink(SCIP_SOL *sol, SCIP_SET *set, SCIP_PROB *prob)
Definition: sol.c:951
SCIP_RETCODE SCIPincludeDisp(SCIP *scip, const char *name, const char *desc, const char *header, SCIP_DISPSTATUS dispstatus, SCIP_DECL_DISPCOPY((*dispcopy)), SCIP_DECL_DISPFREE((*dispfree)), SCIP_DECL_DISPINIT((*dispinit)), SCIP_DECL_DISPEXIT((*dispexit)), SCIP_DECL_DISPINITSOL((*dispinitsol)), SCIP_DECL_DISPEXITSOL((*dispexitsol)), SCIP_DECL_DISPOUTPUT((*dispoutput)), SCIP_DISPDATA *dispdata, int width, int priority, int position, SCIP_Bool stripline)
Definition: scip.c:8518
#define SCIP_DECL_NODESELCOMP(x)
Definition: type_nodesel.h:126
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition: scip.c:28308
SCIP_Longint nsbdivinglps
Definition: struct_stat.h:158
SCIP_RETCODE SCIPgetReoptChildIDs(SCIP *scip, SCIP_NODE *node, unsigned int *ids, int idssize, int *nids)
Definition: scip.c:14953
SCIP_RETCODE SCIPbranchruleCreate(SCIP_BRANCHRULE **branchrule, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_DECL_BRANCHCOPY((*branchcopy)), SCIP_DECL_BRANCHFREE((*branchfree)), SCIP_DECL_BRANCHINIT((*branchinit)), SCIP_DECL_BRANCHEXIT((*branchexit)), SCIP_DECL_BRANCHINITSOL((*branchinitsol)), SCIP_DECL_BRANCHEXITSOL((*branchexitsol)), SCIP_DECL_BRANCHEXECLP((*branchexeclp)), SCIP_DECL_BRANCHEXECEXT((*branchexecext)), SCIP_DECL_BRANCHEXECPS((*branchexecps)), SCIP_BRANCHRULEDATA *branchruledata)
Definition: branch.c:1212
int npresoladdconss
Definition: struct_stat.h:199
SCIP_Real SCIPreoptGetSimToPrevious(SCIP_REOPT *reopt)
Definition: reopt.c:4471
int SCIPgetNVars(SCIP *scip)
Definition: scip.c:10698
SCIP_Bool SCIPconsIsLockedPos(SCIP_CONS *cons)
Definition: cons.c:7919
void SCIPmessageVFPrintVerbInfo(SCIP_MESSAGEHDLR *messagehdlr, SCIP_VERBLEVEL verblevel, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr, va_list ap)
Definition: message.c:707
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5180
SCIP_RETCODE SCIPsolRound(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_Bool *success)
Definition: sol.c:1605
SCIP_Bool SCIPsetIsSumGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5483
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition: scip.c:5878
SCIP_RETCODE SCIPreoptAddDualBndchg(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newval, SCIP_Real oldval)
Definition: reopt.c:5073
SCIP_Real SCIPgetAvgCutoffScore(SCIP *scip)
Definition: scip.c:39159
SCIP_NODE * SCIPgetPrioSibling(SCIP *scip)
Definition: scip.c:36986
SCIP_RETCODE SCIPconflictAnalyzeStrongbranch(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_COL *col, SCIP_Bool *downconflict, SCIP_Bool *upconflict)
Definition: conflict.c:6446
SCIP_RETCODE SCIPresetParams(SCIP *scip)
Definition: scip.c:4335
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
Definition: scip.c:5588
SCIP_RETCODE SCIPincludeReader(SCIP *scip, const char *name, const char *desc, const char *extension, SCIP_DECL_READERCOPY((*readercopy)), SCIP_DECL_READERFREE((*readerfree)), SCIP_DECL_READERREAD((*readerread)), SCIP_DECL_READERWRITE((*readerwrite)), SCIP_READERDATA *readerdata)
Definition: scip.c:4521
SCIP_RETCODE SCIPclearIntarray(SCIP *scip, SCIP_INTARRAY *intarray)
Definition: scip.c:42677
SCIP_Longint SCIPbranchruleGetNDomredsFound(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2059
SCIP_RETCODE SCIPlinkRelaxSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:34706
struct SCIP_PresolData SCIP_PRESOLDATA
Definition: type_presol.h:37
#define SCIP_DECL_HEURINITSOL(x)
Definition: type_heur.h:95
SCIP_Real firstlpdualbound
Definition: struct_stat.h:94
SCIP_RETCODE SCIPsetRelaxSolVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:17727
SCIP_NODE * SCIPgetBestChild(SCIP *scip)
Definition: scip.c:37002
SCIP_Real SCIPversion(void)
Definition: scip.c:540
SCIP_Bool SCIPmessagehdlrIsQuiet(SCIP_MESSAGEHDLR *messagehdlr)
Definition: message.c:894
int npresolroundsfast
Definition: struct_stat.h:190
int SCIPgetBoolarrayMaxIdx(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:42892
SCIP_RETCODE SCIPpricerDeactivate(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:325
unsigned int SCIPnodeGetReoptID(SCIP_NODE *node)
Definition: tree.c:7087
SCIP_RETCODE SCIPsetConshdlrActive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
Definition: scip.c:5657
SCIP_RETCODE SCIPactivatePricer(SCIP *scip, SCIP_PRICER *pricer)
Definition: scip.c:5053
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:25588
SCIP_Longint SCIPcomprGetNCalls(SCIP_COMPR *compr)
Definition: compr.c:463
#define SCIP_DECL_DISPINITSOL(x)
Definition: type_disp.h:97
void SCIPupdateDivesetLPStats(SCIP *scip, SCIP_DIVESET *diveset, SCIP_Longint niterstoadd)
Definition: scip.c:32925
void SCIPvarGetClosestVlb(SCIP_VAR *var, SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *closestvlb, int *closestvlbidx)
Definition: var.c:13376
SCIP_RETCODE SCIPchgCharParam(SCIP *scip, SCIP_PARAM *param, char value)
Definition: scip.c:4128
internal methods for managing events
SCIP_Longint SCIPconflictGetNPropConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:4313
void SCIPpricerSetInit(SCIP_PRICER *pricer, SCIP_DECL_PRICERINIT((*pricerinit)))
Definition: pricer.c:506
SCIP_Bool SCIPisDualfeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42106
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:85
int SCIPreoptGetNLeaves(SCIP_REOPT *reopt, SCIP_NODE *node)
Definition: reopt.c:4766
SCIP_READER ** readers
Definition: struct_set.h:63
SCIP_Bool SCIPlpDivingRowsChanged(SCIP_LP *lp)
Definition: lp.c:19445
#define SCIP_DECL_EVENTDELETE(x)
Definition: type_event.h:211
SCIP_RETCODE SCIPnlrowPrint(SCIP_NLROW *nlrow, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: nlp.c:2279
void SCIPpropSetCopy(SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
Definition: prop.c:756
default message handler
SCIP_VAR * SCIPprobFindVar(SCIP_PROB *prob, const char *name)
Definition: prob.c:1997
SCIP_Longint nnodelpiterations
Definition: struct_stat.h:56
SCIP_Longint SCIPdivesetGetNProbingNodes(SCIP_DIVESET *diveset)
Definition: heur.c:455
SCIP_RETCODE SCIPsetSepaInit(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAINIT((*sepainit)))
Definition: scip.c:6734
SCIP_RETCODE SCIPnlrowChgRhs(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real rhs)
Definition: nlp.c:2802
SCIP_RETCODE SCIPvarIncInferenceSum(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Real weight)
Definition: var.c:14735
void SCIPinterruptCapture(SCIP_INTERRUPT *interrupt)
Definition: interrupt.c:99
SCIP_RETCODE SCIPsetSepaExit(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXIT((*sepaexit)))
Definition: scip.c:6750
SCIP_RETCODE SCIPsolLinkPseudoSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
Definition: sol.c:862
SCIP_RETCODE SCIPnodeCreateChild(SCIP_NODE **node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_Real nodeselprio, SCIP_Real estimate)
Definition: tree.c:953
SCIP_RETCODE SCIPaddRowCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_ROW *row)
Definition: scip.c:31215
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
Definition: sol.c:2252
static void printTreeStatistics(SCIP *scip, FILE *file)
Definition: scip.c:40032
SCIP_Real SCIPcomputeVarUbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21386
#define SCIP_DECL_EVENTEXIT(x)
Definition: type_event.h:180
SCIP_VAR ** SCIPcliqueGetVars(SCIP_CLIQUE *clique)
Definition: implics.c:3111
SCIP_RETCODE SCIPgetExternBranchCands(SCIP *scip, SCIP_VAR ***externcands, SCIP_Real **externcandssol, SCIP_Real **externcandsscore, int *nexterncands, int *nprioexterncands, int *nprioexternbins, int *nprioexternints, int *nprioexternimpls)
Definition: scip.c:33241
SCIP_Bool SCIPsetIsLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5238
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:16443
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
Definition: lpi_clp.cpp:2486
void SCIPstatEnableVarHistory(SCIP_STAT *stat)
Definition: stat.c:148
SCIP_Longint nlpsolsfound
Definition: struct_stat.h:77
SCIP_RETCODE SCIPtreeBranchVar(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
Definition: tree.c:5185
trivialnegation primal heuristic
SCIP_RETCODE SCIPsetClockTime(SCIP *scip, SCIP_CLOCK *clck, SCIP_Real sec)
Definition: scip.c:40965
SCIP_Bool SCIPsetIsFeasZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5688
SCIP_Longint SCIPsepaGetNCutsApplied(SCIP_SEPA *sepa)
Definition: sepa.c:790
internal methods for storing primal CIP solutions
void SCIPpricerSetExitsol(SCIP_PRICER *pricer, SCIP_DECL_PRICEREXITSOL((*pricerexitsol)))
Definition: pricer.c:539
SCIP_RETCODE SCIPconflictAddBound(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx)
Definition: conflict.c:2982
SCIP_RETCODE SCIPvarIncVSIDS(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Real weight)
Definition: var.c:14255
SCIP_RETCODE SCIPchgVarBranchDirection(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR branchdirection)
Definition: scip.c:22592
SCIP_Real * SCIPnlpGetVarsLbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:5858
SCIP_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition: scip.c:28285
int nnodesels
Definition: struct_set.h:109
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
Definition: scip.c:26278
SCIP_RETCODE SCIPvarAddVub(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_CLIQUETABLE *cliquetable, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *vubvar, SCIP_Real vubcoef, SCIP_Real vubconstant, SCIP_Bool transitive, SCIP_Bool *infeasible, int *nbdchgs)
Definition: var.c:9858
SCIP_Longint nsbdowndomchgs
Definition: struct_stat.h:90
SCIP_RETCODE SCIPaddDelayedPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31341
SCIP_RETCODE SCIPexprtreeEvalInt(SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *varvals, SCIP_INTERVAL *val)
Definition: expr.c:8579
void SCIPvarUpdateBestRootSol(SCIP_VAR *var, SCIP_SET *set, SCIP_Real rootsol, SCIP_Real rootredcost, SCIP_Real rootlpobjval)
Definition: var.c:12537
SCIP_Bool misc_estimexternmem
Definition: struct_set.h:325
void SCIPbranchruleSetCopy(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHCOPY((*branchcopy)))
Definition: branch.c:1776
SCIP_RETCODE SCIPsetBranchruleExit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXIT((*branchexit)))
Definition: scip.c:8338
SCIP_STATUS status
Definition: struct_stat.h:139
SCIP_Bool compr_enable
Definition: struct_set.h:448
SCIP_Longint nlpiterations
Definition: struct_stat.h:46
SCIP_RETCODE SCIPchgVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:19748
SCIP_RETCODE SCIPconsIncAge(SCIP_CONS *cons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob)
Definition: cons.c:6767
int sepa_cutagelimit
Definition: struct_set.h:437
SCIP_Bool SCIPlpDiving(SCIP_LP *lp)
Definition: lp.c:19403
SCIP_RETCODE SCIPeventhdlrCreate(SCIP_EVENTHDLR **eventhdlr, const char *name, const char *desc, SCIP_DECL_EVENTCOPY((*eventcopy)), SCIP_DECL_EVENTFREE((*eventfree)), SCIP_DECL_EVENTINIT((*eventinit)), SCIP_DECL_EVENTEXIT((*eventexit)), SCIP_DECL_EVENTINITSOL((*eventinitsol)), SCIP_DECL_EVENTEXITSOL((*eventexitsol)), SCIP_DECL_EVENTDELETE((*eventdelete)), SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: event.c:64
SCIP_RETCODE SCIPvarAddObj(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue, SCIP_Real addobj)
Definition: var.c:5837
SCIP_STATUS SCIPgetStatus(SCIP *scip)
Definition: scip.c:908
SCIP_HEUR ** SCIPgetHeurs(SCIP *scip)
Definition: scip.c:7406
BMS_BUFMEM * cleanbuffer
Definition: struct_mem.h:41
SCIP_Real * origobjvals
Definition: struct_tree.h:51
SCIP_RETCODE SCIPdeactiveCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:26198
methods to interpret (evaluate) an expression tree "fast"
void SCIPclearDiveBoundChanges(SCIP *scip)
Definition: scip.c:33092
SCIP_RETCODE SCIPgetNlRowNLPFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip.c:29919
void SCIPlpSetIsRelax(SCIP_LP *lp, SCIP_Bool relax)
Definition: lp.c:19360
struct SCIP_DispData SCIP_DISPDATA
Definition: type_disp.h:53
SCIP_Real SCIPrelaxationGetSolObj(SCIP_RELAXATION *relaxation)
Definition: relax.c:652
SCIP_VAR ** SCIPgetNLPVars(SCIP *scip)
Definition: scip.c:28474
SCIP_RETCODE SCIPdivesetGetScore(SCIP_DIVESET *diveset, SCIP_SET *set, SCIP_DIVETYPE divetype, SCIP_VAR *divecand, SCIP_Real divecandsol, SCIP_Real divecandfrac, SCIP_Real *candscore, SCIP_Bool *roundup)
Definition: heur.c:599
SCIP_RETCODE SCIPsetNodeselExitsol(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)))
Definition: scip.c:8108
SCIP_RETCODE SCIPcopyOrigProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name)
Definition: scip.c:1720
SCIP_RETCODE SCIPaddSolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool *stored)
Definition: scip.c:36107
SCIP_CONFLICTHDLR ** conflicthdlrs
Definition: struct_set.h:69
internal methods for branch and bound tree
SCIP_RETCODE SCIPprimalTrySolFree(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: primal.c:1322
SCIP_RETCODE SCIPaggregateVars(SCIP *scip, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *redundant, SCIP_Bool *aggregated)
Definition: scip.c:22886
SCIP_RETCODE SCIPrecalcRowLPActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28115
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
Definition: scip.c:17373
void SCIPeventhdlrSetExitsol(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXITSOL((*eventexitsol)))
Definition: event.c:364
SCIP_RETCODE SCIPsetParam(SCIP *scip, const char *name, void *value)
Definition: scip.c:3893
SCIP_RETCODE SCIPsetIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx, int val)
Definition: scip.c:42709
SCIP_Bool SCIPsetIsSumZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5501
SCIP_Real SCIPtreeCalcChildEstimate(SCIP_TREE *tree, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_Real targetvalue)
Definition: tree.c:5126
const char * SCIPdivesetGetName(SCIP_DIVESET *diveset)
Definition: heur.c:331
SCIP_CONFLICT * conflict
Definition: struct_scip.h:80
SCIP_RETCODE SCIPgetLPI(SCIP *scip, SCIP_LPI **lpi)
Definition: scip.c:27239
SCIP_RETCODE SCIPconsDelete(SCIP_CONS *cons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob)
Definition: cons.c:6004
SCIP_RETCODE SCIPbranchVar(SCIP *scip, SCIP_VAR *var, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
Definition: scip.c:33734
SCIP_CONS ** SCIPgetOrigConss(SCIP *scip)
Definition: scip.c:11855
SCIP_RETCODE SCIPsetProbName(SCIP *scip, const char *name)
Definition: scip.c:9969
SCIP_NLPI * SCIPsetFindNlpi(SCIP_SET *set, const char *name)
Definition: set.c:4261
SCIP_Real SCIPvarGetAvgCutoffsCurrentRun(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15508
SCIP_RETCODE SCIPcalcMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *weights, SCIP_Real maxweight, int *weightinds, int nweightinds, int rowlensum, int *sidetypes, SCIP_Real scale, SCIP_Real *mksetcoefs, SCIP_Bool *mksetcoefsvalid, SCIP_Real *mircoef, SCIP_Real *mirrhs, SCIP_Real *cutactivity, SCIP_Bool *success, SCIP_Bool *cutislocal, int *cutrank)
Definition: scip.c:27058
#define SCIPreallocBufferArray(scip, ptr, num)
Definition: scip.h:20589
int SCIPnlrowGetNQuadElems(SCIP_NLROW *nlrow)
Definition: nlp.c:3312
SCIP_RETCODE SCIPtreeBranchVarHole(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *var, SCIP_Real left, SCIP_Real right, SCIP_NODE **downchild, SCIP_NODE **upchild)
Definition: tree.c:5516
SCIP_RETCODE SCIPsetPricerFree(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICERFREE((*pricerfree)))
Definition: scip.c:4868
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
Definition: scip.c:41648
int SCIPconvertRealToInt(SCIP *scip, SCIP_Real real)
Definition: scip.c:42415
void SCIPdisableVarHistory(SCIP *scip)
Definition: scip.c:23164
SCIP_Real SCIPsetFeastol(SCIP_SET *set)
Definition: set.c:5084
SCIP_Longint ndeactivatednodes
Definition: struct_stat.h:71
#define SCIP_DECL_CONSLOCK(x)
Definition: type_cons.h:591
SCIP_Real SCIProwGetMinval(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6439
SCIP_RETCODE SCIPwriteLP(SCIP *scip, const char *filename)
Definition: scip.c:27155
#define SCIP_DECL_COMPREXEC(x)
Definition: type_compr.h:111
void SCIPtreeSetFocusNodeLP(SCIP_TREE *tree, SCIP_Bool solvelp)
Definition: tree.c:7909
void SCIPcomprSetCopy(SCIP_COMPR *compr, SCIP_DECL_COMPRCOPY((*comprcopy)))
Definition: compr.c:329
SCIP_Bool SCIPsetIsDualfeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5791
void SCIPprobSetData(SCIP_PROB *prob, SCIP_PROBDATA *probdata)
Definition: prob.c:668
SCIP_Bool SCIPisSumGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41858
SCIP_Longint SCIPconshdlrGetNSepaCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4451
SCIP_Longint SCIPconflictGetNPropSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:4303
int SCIPgetNDelayedPoolCuts(SCIP *scip)
Definition: scip.c:31395
void SCIPconshdlrSetPrint(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
Definition: cons.c:4198
SCIP_RETCODE SCIPrestartSolve(SCIP *scip)
Definition: scip.c:15468
SCIP_Real SCIPgetVarMultaggrUbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21493
const char * SCIPreaderGetName(SCIP_READER *reader)
Definition: reader.c:510
SCIP_PRICER * SCIPsetFindPricer(SCIP_SET *set, const char *name)
Definition: set.c:3190
SCIP_NODE * SCIPgetBestboundNode(SCIP *scip)
Definition: scip.c:37066
void SCIPconflicthdlrSetExit(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTEXIT((*conflictexit)))
Definition: conflict.c:673
SCIP_PROBDATA * SCIPprobGetData(SCIP_PROB *prob)
Definition: prob.c:2164
void SCIPlpEndStrongbranchProbing(SCIP_LP *lp)
Definition: lp.c:18010
int SCIPgetNReaders(SCIP *scip)
Definition: scip.c:4713
SCIP_SOLORIGIN SCIPsolGetOrigin(SCIP_SOL *sol)
Definition: sol.c:2169
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:40818
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1147
int SCIPgetNLeaves(SCIP *scip)
Definition: scip.c:36954
SCIP_Bool misc_allowdualreds
Definition: struct_set.h:332
SCIP_Real SCIPgetVarImplRedcost(SCIP *scip, SCIP_VAR *var, SCIP_Bool varfixing)
Definition: scip.c:17540
SCIP_RETCODE SCIPrecalcRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28223
SCIP_RETCODE SCIPdispAutoActivate(SCIP_SET *set)
Definition: disp.c:448
SCIP_RETCODE SCIPdialogRelease(SCIP *scip, SCIP_DIALOG **dialog)
Definition: dialog.c:897
int SCIPgetNNodesels(SCIP *scip)
Definition: scip.c:8148
void SCIPstatResetPresolving(SCIP_STAT *stat)
Definition: stat.c:308
#define SCIP_DECL_DIALOGCOPY(x)
Definition: type_dialog.h:53
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
Definition: heur.c:1273
SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
Definition: tree.c:7006
SCIP_RETCODE SCIPlpComputeRelIntPoint(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_LP *lp, SCIP_PROB *prob, SCIP_Bool relaxrows, SCIP_Bool inclobjcutoff, SCIP_Real timelimit, int iterlimit, SCIP_Real *point, SCIP_Bool *success)
Definition: lp.c:19490
SCIP_Bool misc_finitesolstore
Definition: struct_set.h:330
void SCIPnodeselSetInit(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINIT((*nodeselinit)))
Definition: nodesel.c:1105
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: scip.c:7297
SCIP_RETCODE SCIPcreateNLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:34072
BMS_BUFMEM * buffer
Definition: struct_mem.h:40
SCIP_RETCODE SCIPbacktrackProbing(SCIP *scip, int probingdepth)
Definition: scip.c:32250
static SCIP_RETCODE initPresolve(SCIP *scip)
Definition: scip.c:12852
SCIP_Real SCIPgetObjNorm(SCIP *scip)
Definition: scip.c:10351
int npricerounds
Definition: struct_stat.h:180
SCIP_RETCODE SCIPdelConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons)
Definition: scip.c:12030
int SCIPpricestoreGetNVars(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:603
SCIP_RETCODE SCIPgetVarClosestVlb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvlb, int *closestvlbidx)
Definition: scip.c:21511
SCIP_RETCODE SCIPlpFlush(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue)
Definition: lp.c:8258
SCIP_RETCODE SCIPlpGetBInvCol(SCIP_LP *lp, int c, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9384
SCIP_RETCODE SCIPnlrowAddQuadElement(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_QUADELEM elem)
Definition: nlp.c:2597
void SCIPnlrowCapture(SCIP_NLROW *nlrow)
Definition: nlp.c:2334
SCIP_RETCODE SCIPinitVarValueBranchStats(SCIP *scip, SCIP_VAR *var, SCIP_Real value, SCIP_Real downvsids, SCIP_Real upvsids, SCIP_Real downconflen, SCIP_Real upconflen, SCIP_Real downinfer, SCIP_Real upinfer, SCIP_Real downcutoff, SCIP_Real upcutoff)
Definition: scip.c:24012
SCIP_NODE * SCIPtreeGetLowerboundNode(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:6867
SCIP_RETCODE SCIPsetNodeselMemsavePriority(SCIP *scip, SCIP_NODESEL *nodesel, int priority)
Definition: scip.c:8174
void SCIPconsSetDynamic(SCIP_CONS *cons, SCIP_Bool dynamic)
Definition: cons.c:6321
SCIP_RETCODE SCIPincludeEventhdlr(SCIP *scip, const char *name, const char *desc, SCIP_DECL_EVENTCOPY((*eventcopy)), SCIP_DECL_EVENTFREE((*eventfree)), SCIP_DECL_EVENTINIT((*eventinit)), SCIP_DECL_EVENTEXIT((*eventexit)), SCIP_DECL_EVENTINITSOL((*eventinitsol)), SCIP_DECL_EVENTEXITSOL((*eventexitsol)), SCIP_DECL_EVENTDELETE((*eventdelete)), SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: scip.c:7736
SCIP_Real SCIPgetVarAvgInferencesCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23851
void SCIPconsSetStickingAtNode(SCIP_CONS *cons, SCIP_Bool stickingatnode)
Definition: cons.c:6343
int SCIPgetSolRunnum(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:35252
SCIP_Real SCIPgetFirstLPTime(SCIP *scip)
Definition: scip.c:41099
int SCIPgetNPricers(SCIP *scip)
Definition: scip.c:5006
SCIP_Real SCIPsetFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5367
SCIP_Real SCIPgetRowMinCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28045
SCIP_Real SCIPgetOrigObjoffset(SCIP *scip)
Definition: scip.c:10091
SCIP_RETCODE SCIPchgNlRowQuadElement(SCIP *scip, SCIP_NLROW *nlrow, SCIP_QUADELEM quadelement)
Definition: scip.c:29771
SCIP_RETCODE SCIPcaptureRow(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:27716
SCIP_Bool SCIPsetIsFeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5578
SCIP_Longint SCIPheurGetNSolsFound(SCIP_HEUR *heur)
Definition: heur.c:1283
SCIP_RETCODE SCIPsetConsDynamic(SCIP *scip, SCIP_CONS *cons, SCIP_Bool dynamic)
Definition: scip.c:25225
SCIP_RETCODE SCIPsetSetRealParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Real value)
Definition: set.c:2872
#define SCIPsetDuplicateBufferArray(set, ptr, source, num)
Definition: set.h:1790
SCIP_RETCODE SCIPintarrayIncVal(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int incval)
Definition: misc.c:3063
void SCIPconflicthdlrSetInitsol(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)))
Definition: conflict.c:684
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:10378
int SCIPgetRealarrayMinIdx(SCIP *scip, SCIP_REALARRAY *realarray)
Definition: scip.c:42595
#define SCIP_DECL_VARTRANS(x)
Definition: type_var.h:127
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:11540
SCIP_Longint SCIPconflictGetNBoundexceedingLPConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:6389
int SCIPpricestoreGetNProbvarsFound(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:645
SCIP_Longint SCIPmemGetUsed(SCIP_MEM *mem)
Definition: mem.c:79
SCIP_RETCODE SCIPsetRelaxCopy(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXCOPY((*relaxcopy)))
Definition: scip.c:6457
SCIP_RETCODE SCIPvarChgLbGlobal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Real newbound)
Definition: var.c:6680
SCIP_Longint SCIPpropGetNDomredsFound(SCIP_PROP *prop)
Definition: prop.c:1072
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
Definition: var.c:16623
SCIP_REOPTNODE * SCIPreoptGetReoptnode(SCIP_REOPT *reopt, unsigned int id)
Definition: reopt.c:4524
static SCIP_RETCODE presolveRound(SCIP *scip, SCIP_PRESOLTIMING *timing, SCIP_Bool *unbounded, SCIP_Bool *infeasible, SCIP_Bool lastround, int *presolstart, int presolend, int *propstart, int propend, int *consstart, int consend)
Definition: scip.c:13051
int SCIPreoptGetNImprovingSols(SCIP_REOPT *reopt)
Definition: reopt.c:4287
SCIP_Bool SCIPvarDoNotMultaggr(SCIP_VAR *var)
Definition: var.c:5455
SCIP_Real SCIProwGetPseudoActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6186
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
Definition: lpi_clp.cpp:2771
#define SCIP_DECL_PROBINITSOL(x)
Definition: type_prob.h:97
SCIP_RETCODE SCIPgetNlRowFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip.c:30069
SCIP_RETCODE SCIPcreateRealarray(SCIP *scip, SCIP_REALARRAY **realarray)
Definition: scip.c:42473
SCIP_RETCODE SCIPvarCreateTransformed(SCIP_VAR **var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
Definition: var.c:2039
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip.c:1248
SCIP_Real SCIPvarGetSol(SCIP_VAR *var, SCIP_Bool getlpval)
Definition: var.c:12514
SCIP_Real SCIPgetVarAvgConflictlength(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23769
SCIP_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
Definition: scip.c:15737
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition: paramset.c:651
SCIP_Longint SCIPgetNRootLPIterations(SCIP *scip)
Definition: scip.c:37472
SCIP_NODESEL ** nodesels
Definition: struct_set.h:77
SCIP_RETCODE SCIPdispPrintLine(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, FILE *file, SCIP_Bool forcedisplay, SCIP_Bool endline)
Definition: disp.c:362
SCIP_Longint nlps
Definition: struct_stat.h:142
SCIP_Real SCIPvarGetPseudocostCountCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:13849
SCIP_Real SCIPgetVarPseudocostVariance(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun)
Definition: scip.c:23380
methods for implications, variable bounds, and cliques
const char * SCIPnlpiGetName(SCIP_NLPI *nlpi)
Definition: nlpi.c:740
SCIP_Bool SCIPisDualfeasZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:42145
SCIP_RETCODE SCIPconsSepasol(SCIP_CONS *cons, SCIP_SET *set, SCIP_SOL *sol, SCIP_RESULT *result)
Definition: cons.c:7183
SCIP_PRESOL ** SCIPgetPresols(SCIP *scip)
Definition: scip.c:6335
SCIP_Bool SCIPconsIsOriginal(SCIP_CONS *cons)
Definition: cons.c:7899
SCIP_RETCODE SCIPsetNLPStringPar(SCIP *scip, SCIP_NLPPARAM type, const char *sval)
Definition: scip.c:29081
SCIP_Longint SCIPconflictGetNAppliedGlobalConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:2402
SCIP_RETCODE SCIPsetProbTrans(SCIP *scip, SCIP_DECL_PROBTRANS((*probtrans)))
Definition: scip.c:9118
int SCIPgetSubscipDepth(SCIP *scip)
Definition: scip.c:3205
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41920
int presol_maxrounds
Definition: struct_set.h:359
SCIP_Longint nbarrierlpiterations
Definition: struct_stat.h:52
void SCIPreaderSetCopy(SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: reader.c:466
#define SCIP_DECL_CONSDELETE(x)
Definition: type_cons.h:187
SCIP_RETCODE SCIPsolLinkNLPSol(SCIP_SOL *sol, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_NLP *nlp)
Definition: sol.c:781
#define SCIP_DECL_BRANCHEXECPS(x)
Definition: type_branch.h:161
SCIP_RETCODE SCIPdivesetCreate(SCIP_DIVESET **diveset, SCIP_HEUR *heur, const char *name, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_Real minreldepth, SCIP_Real maxreldepth, SCIP_Real maxlpiterquot, SCIP_Real maxdiveubquot, SCIP_Real maxdiveavgquot, SCIP_Real maxdiveubquotnosol, SCIP_Real maxdiveavgquotnosol, SCIP_Real lpresolvedomchgquot, int lpsolvefreq, int maxlpiterofs, SCIP_Bool backtrack, SCIP_Bool onlylpbranchcands, SCIP_DIVETYPE divetypemask, SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)))
Definition: heur.c:176
SCIP_Real SCIPpricestoreGetProbPricingTime(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:625
SCIP_Real SCIPgetFirstLPDualboundRoot(SCIP *scip)
Definition: scip.c:38462
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
Definition: scip.c:4154
SCIP_Longint SCIPconflictGetNBoundexceedingLPIterations(SCIP_CONFLICT *conflict)
Definition: conflict.c:6429
SCIP_LPALGO lastlpalgo
Definition: struct_lp.h:327
SCIP_CLOCK * conflictlptime
Definition: struct_stat.h:125
SCIP_Longint SCIPgetNLPIterations(SCIP *scip)
Definition: scip.c:37454
int SCIPpropGetNDelConss(SCIP_PROP *prop)
Definition: prop.c:1162
SCIP_VAR ** SCIPgetVars(SCIP *scip)
Definition: scip.c:10653
int SCIPgetNExternBranchCands(SCIP *scip)
Definition: scip.c:33273
SCIP_Real SCIPgetRelaxFeastolFactor(SCIP *scip)
Definition: scip.c:31547
SCIP_Bool SCIPvarIsPscostRelerrorReliable(SCIP_VAR *var, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real threshold, SCIP_CONFIDENCELEVEL clevel)
Definition: var.c:13984
int nrunsbeforefirst
Definition: struct_stat.h:218
#define SCIP_MAXSTRLEN
Definition: def.h:201
SCIP_DISP * SCIPfindDisp(SCIP *scip, const char *name)
Definition: scip.c:8560
SCIP_Bool conf_usesb
Definition: struct_set.h:177
SCIP_Real SCIPgetRowFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28265
#define SCIP_DECL_PROBDELORIG(x)
Definition: type_prob.h:55
SCIP_Real rootlowerbound
Definition: struct_stat.h:95
SCIP_NLPI * SCIPfindNlpi(SCIP *scip, const char *name)
Definition: scip.c:8659
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
Definition: scip.c:5634
SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy)
Definition: scip.c:30877
#define SCIP_DECL_CONSINITPRE(x)
Definition: type_cons.h:114
SCIP_RETCODE SCIPseparateSolCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_SOL *sol, SCIP_RESULT *result)
Definition: scip.c:31311
SCIP_RETCODE SCIPeventChgType(SCIP_EVENT *event, SCIP_EVENTTYPE eventtype)
Definition: event.c:927
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip.c:25401
void SCIProwRecalcLPActivity(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:5936
SCIP_PRIMAL * origprimal
Definition: struct_scip.h:66
SCIP_Bool SCIPsetIsDualfeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5879
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
Definition: scip.c:5246
SCIP_REOPTNODE * SCIPgetReoptnode(SCIP *scip, unsigned int id)
Definition: scip.c:15038
int SCIPpresolGetNCalls(SCIP_PRESOL *presol)
Definition: presol.c:771
void SCIPgmlWriteArc(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
Definition: misc.c:437
#define SCIPsetAllocBufferArray(set, ptr, num)
Definition: set.h:1788
SCIP_RETCODE SCIPnlrowRelease(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:2346
SCIP_RETCODE SCIPsetPricerExit(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICEREXIT((*pricerexit)))
Definition: scip.c:4916
int validdepth
Definition: struct_cons.h:59
SCIP_Longint SCIPconflictGetNPseudoReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:6971
int SCIPgetFocusDepth(SCIP *scip)
Definition: scip.c:38166
SCIP_RETCODE SCIPtreeEndProbing(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_LP *lp, SCIP_PRIMAL *primal, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable)
Definition: tree.c:6527
void SCIPlpRecalculateObjSqrNorm(SCIP_SET *set, SCIP_LP *lp)
Definition: lp.c:19252
internal methods for clocks and timing issues
SCIP_RETCODE SCIPfreePtrarray(SCIP *scip, SCIP_PTRARRAY **ptrarray)
Definition: scip.c:42924
SCIP_Longint ntotalnodes
Definition: struct_stat.h:66
int SCIPbranchcandGetNPseudoCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:802
int SCIPgetNOrigContVars(SCIP *scip)
Definition: scip.c:11246
SCIP_Bool SCIPsetIsSumGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5465
SCIP_Bool SCIPhasNLPContinuousNonlinearity(SCIP *scip)
Definition: scip.c:28422
SCIP_RETCODE SCIPsetCreate(SCIP_SET **set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP *scip)
Definition: set.c:1022
int SCIPsolGetDepth(SCIP_SOL *sol)
Definition: sol.c:2242
SCIP_Longint SCIPconflictGetNGlobalChgBds(SCIP_CONFLICT *conflict)
Definition: conflict.c:2392
#define SCIP_VARTYPE_INTEGER_CHAR
Definition: def.h:99
SCIP_RETCODE SCIPvarChgLbOriginal(SCIP_VAR *var, SCIP_SET *set, SCIP_Real newbound)
Definition: var.c:6064
void SCIPenableVarHistory(SCIP *scip)
Definition: scip.c:23145
#define SCIP_DECL_CONSGETDIVEBDCHGS(x)
Definition: type_cons.h:837
SCIP_RETCODE SCIPprintLPSolutionQuality(SCIP *scip, FILE *file)
Definition: scip.c:27275
#define SCIP_DECL_CONSPRESOL(x)
Definition: type_cons.h:479
SCIP_RETCODE SCIPsetNodeselCopy(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELCOPY((*nodeselcopy)))
Definition: scip.c:8028
SCIP_RETCODE SCIPchgVarsBoundsDiveNLP(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: scip.c:29301
SCIP_RETCODE SCIPinferVarFixProp(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_PROP *inferprop, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:20772
int npresolaggrvars
Definition: struct_stat.h:194
SCIP_Real SCIPgetAvgCutoffScoreCurrentRun(SCIP *scip)
Definition: scip.c:39182
SCIP_RETCODE SCIPsetIncludeRelax(SCIP_SET *set, SCIP_RELAX *relax)
Definition: set.c:3548
void SCIPconshdlrSetDeactive(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
Definition: cons.c:4154
SCIP_Bool SCIPisSumZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:41871
SCIP_Real SCIPgetReadingTime(SCIP *scip)
Definition: scip.c:41036
int SCIPgetNPrioLPBranchCands(SCIP *scip)
Definition: scip.c:33196
SCIP_ROW ** SCIPsepastoreGetCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1347
SCIP_Bool SCIPsetIsPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5303
#define NULL
Definition: lpi_spx.cpp:130
int SCIPmajorVersion(void)
Definition: scip.c:551
SCIP_EVENTHDLR * SCIPsetFindEventhdlr(SCIP_SET *set, const char *name)
Definition: set.c:3959
int SCIPintarrayGetMinIdx(SCIP_INTARRAY *intarray)
Definition: misc.c:3075
static SCIP_DECL_PARAMCHGD(paramChgdNlpiPriority)
Definition: scip.c:8609
SCIP_RETCODE SCIPpropPresol(SCIP_PROP *prop, SCIP_SET *set, SCIP_PRESOLTIMING timing, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: prop.c:465
void SCIPconshdlrSetInitpre(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
Definition: cons.c:4048
SCIP_RETCODE SCIPrealarrayCreate(SCIP_REALARRAY **realarray, BMS_BLKMEM *blkmem)
Definition: misc.c:2359
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:17113
int SCIPpresolGetNChgSides(SCIP_PRESOL *presol)
Definition: presol.c:761
int SCIPtreeGetProbingDepth(SCIP_TREE *tree)
Definition: tree.c:7995
SCIP_Longint nrootfirstlpiterations
Definition: struct_stat.h:48
int nprops
Definition: struct_set.h:101
void SCIPheurSetExitsol(SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
Definition: heur.c:1136
int SCIPgetNEnabledConss(SCIP *scip)
Definition: scip.c:38313
SCIP_RETCODE SCIPconsParse(SCIP_CONS **cons, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *str, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool *success)
Definition: cons.c:5663
SCIP_RETCODE SCIPnodeDelCons(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_CONS *cons)
Definition: tree.c:1564
static SCIP_RETCODE analyzeStrongbranch(SCIP *scip, SCIP_VAR *var, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict)
Definition: scip.c:18111
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:73
SCIP_RETCODE SCIPcomprCreate(SCIP_COMPR **compr, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int minnnodes, SCIP_DECL_COMPRCOPY((*comprcopy)), SCIP_DECL_COMPRFREE((*comprfree)), SCIP_DECL_COMPRINIT((*comprinit)), SCIP_DECL_COMPREXIT((*comprexit)), SCIP_DECL_COMPRINITSOL((*comprinitsol)), SCIP_DECL_COMPREXITSOL((*comprexitsol)), SCIP_DECL_COMPREXEC((*comprexec)), SCIP_COMPRDATA *comprdata)
Definition: compr.c:93
SCIP_RETCODE SCIPgetVarStrongbranchInt(SCIP *scip, SCIP_VAR *var, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict, SCIP_Bool *lperror)
Definition: scip.c:18943
SCIP_Longint SCIPconflictGetNPseudoConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:6951
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4258
int SCIPgetNConshdlrs(SCIP *scip)
Definition: scip.c:5902
SCIP_RETCODE SCIPlpCalcMIR(SCIP_LP *lp, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *weights, SCIP_Real maxweight, int *weightinds, int nweightinds, int rowlensum, int *sidetypes, SCIP_Real scale, SCIP_Real *mksetcoefs, SCIP_Bool *mksetcoefsvalid, SCIP_Real *mircoef, SCIP_Real *mirrhs, SCIP_Real *cutactivity, SCIP_Bool *success, SCIP_Bool *cutislocal, int *cutrank)
Definition: lp.c:11043
void SCIPbranchruleSetFree(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHFREE((*branchfree)))
Definition: branch.c:1787
#define SCIP_DECL_CONSCHECK(x)
Definition: type_cons.h:391
SCIP_Bool SCIPboolarrayGetVal(SCIP_BOOLARRAY *boolarray, int idx)
Definition: misc.c:3342
SCIP_Bool presol_donotaggr
Definition: struct_set.h:370
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip.c:1125
SCIP_RETCODE SCIPchgRowLhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newlhs)
Definition: scip.c:31843
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:42032
#define SCIP_DECL_NODESELINITSOL(x)
Definition: type_nodesel.h:83
SCIP_RETCODE SCIPnodeAddBoundinfer(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Real newbound, SCIP_BOUNDTYPE boundtype, SCIP_CONS *infercons, SCIP_PROP *inferprop, int inferinfo, SCIP_Bool probingchange)
Definition: tree.c:1725
void SCIPconflicthdlrSetCopy(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTCOPY((*conflictcopy)))
Definition: conflict.c:640
int SCIPdivesetGetMinDepth(SCIP_DIVESET *diveset)
Definition: heur.c:385
SCIP_Longint ndivinglps
Definition: struct_stat.h:156
SCIP_RETCODE SCIPeventfilterDel(SCIP_EVENTFILTER *eventfilter, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: event.c:1808
SCIP_RETCODE SCIPcreateNlRow(SCIP *scip, SCIP_NLROW **nlrow, 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 *expression, SCIP_Real lhs, SCIP_Real rhs)
Definition: scip.c:29365
SCIP_RETCODE SCIPfreeRealarray(SCIP *scip, SCIP_REALARRAY **realarray)
Definition: scip.c:42490
SCIP_RETCODE SCIPvarChgLbLazy(SCIP_VAR *var, SCIP_SET *set, SCIP_Real lazylb)
Definition: var.c:6964
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:40801
#define SCIP_DECL_CONSTRANS(x)
Definition: type_cons.h:197
SCIP_RETCODE SCIPprobChgVarType(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_BRANCHCAND *branchcand, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_VARTYPE vartype)
Definition: prob.c:1093
SCIP_Longint SCIPconflictGetNInfeasibleLPSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:6299
char ** SCIPgetExternalCodeDescriptions(SCIP *scip)
Definition: scip.c:8742
SCIP_RETCODE SCIPreoptGetLeaves(SCIP_REOPT *reopt, SCIP_NODE *node, unsigned int *leaves, int leavessize, int *nleaves)
Definition: reopt.c:5211
SCIP_RETCODE SCIPvarAddLocks(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, int addnlocksdown, int addnlocksup)
Definition: var.c:3034
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
Definition: cons.c:7849
int SCIPgetNEventhdlrs(SCIP *scip)
Definition: scip.c:7932
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
Definition: lp.c:18915
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
Definition: lp.c:18861
SCIP_Real SCIPvarGetPseudoSol(SCIP_VAR *var)
Definition: var.c:17509
void SCIPsetSortComprsName(SCIP_SET *set)
Definition: set.c:3921
void SCIProwCapture(SCIP_ROW *row)
Definition: lp.c:5105
int SCIPgetNProps(SCIP *scip)
Definition: scip.c:7149
void SCIPdialogMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip.c:1264
SCIP_Bool SCIPsetIsSumRelGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6233
void SCIPconshdlrSetInitsol(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITSOL((*consinitsol)))
Definition: cons.c:4026
SCIP_RETCODE SCIPsetBranchruleInitsol(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINITSOL((*branchinitsol)))
Definition: scip.c:8354
SCIP_EVENTQUEUE * eventqueue
Definition: struct_scip.h:73
internal methods for NLPI solver interfaces
SCIP_RETCODE SCIPsetIncludeConshdlr(SCIP_SET *set, SCIP_CONSHDLR *conshdlr)
Definition: set.c:3240
int SCIPconshdlrGetSepaPriority(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4721
SCIP_Bool SCIPisDualfeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42132
SCIP_RETCODE SCIPnlrowEnsureQuadVarsSize(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:2514
void SCIPpresolSetPriority(SCIP_PRESOL *presol, SCIP_SET *set, int priority)
Definition: presol.c:593
SCIP_PROBINGNODE * probingnode
Definition: struct_tree.h:129
#define SCIP_DECL_COMPREXITSOL(x)
Definition: type_compr.h:95
SCIP_Longint SCIPconflictGetNPropCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:4293
SCIP_RETCODE SCIPsetBranchruleInit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINIT((*branchinit)))
Definition: scip.c:8322
SCIP_Real SCIPvarGetMultaggrLbGlobal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:8049
SCIP_Longint SCIPconshdlrGetNConssFound(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4561
SCIP_RETCODE SCIPapplyCutsProbing(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:32880
SCIP_Bool SCIPisFracIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:41746
SCIP_RETCODE SCIPtreeCreate(SCIP_TREE **tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_NODESEL *nodesel)
Definition: tree.c:4543
int nintvars
Definition: struct_prob.h:62
void SCIPrelaxationSetSolValid(SCIP_RELAXATION *relaxation, SCIP_Bool isvalid)
Definition: relax.c:620
SCIP_RETCODE SCIPsetPresolCopy(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
Definition: scip.c:6226
int npresolfixedvars
Definition: struct_stat.h:193
SCIP_CLOCK * totaltime
Definition: struct_scip.h:61
SCIP_RETCODE SCIPsetGetStringParam(SCIP_SET *set, const char *name, char **value)
Definition: set.c:2664
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
Definition: cons.c:7681
SCIP_Real SCIPcutoffbounddelta(SCIP *scip)
Definition: scip.c:41202
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
Definition: scip.c:5334
struct SCIP_BranchruleData SCIP_BRANCHRULEDATA
Definition: type_branch.h:43
SCIP_Real SCIPdualfeasFrac(SCIP *scip, SCIP_Real val)
Definition: scip.c:42241
SCIP_RETCODE SCIPbranchcandCreate(SCIP_BRANCHCAND **branchcand)
Definition: branch.c:132
SCIP_PRIMAL * primal
Definition: struct_scip.h:78
SCIP_RETCODE SCIPupdateCutoffbound(SCIP *scip, SCIP_Real cutoffbound)
Definition: scip.c:38589
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Definition: var.c:17067
int SCIPnodeGetDepth(SCIP_NODE *node)
Definition: tree.c:7026
int SCIPgetNChildren(SCIP *scip)
Definition: scip.c:36874
void SCIPstatDisableVarHistory(SCIP_STAT *stat)
Definition: stat.c:138
SCIP_Bool SCIPisCutEfficacious(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
Definition: scip.c:30859
#define SCIP_SUBVERSION
Definition: def.h:90
SCIP_CUTPOOL * delayedcutpool
Definition: struct_scip.h:88
#define SCIP_DECL_PRESOLINITPRE(x)
Definition: type_presol.h:84
SCIP_RETCODE SCIPcheckStringParam(SCIP *scip, SCIP_PARAM *param, const char *value)
Definition: scip.c:4235
int SCIPgetIntarrayMinIdx(SCIP *scip, SCIP_INTARRAY *intarray)
Definition: scip.c:42746
void SCIPprobAddObjoffset(SCIP_PROB *prob, SCIP_Real addval)
Definition: prob.c:1383
SCIP_RETCODE SCIPsolLinkLPSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
Definition: sol.c:723
SCIP_RETCODE SCIPvarChgUbOriginal(SCIP_VAR *var, SCIP_SET *set, SCIP_Real newbound)
Definition: var.c:6123
SCIP_Real SCIPgetAvgPseudocostCount(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:38849
SCIP_RETCODE SCIPcreateCPUClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:40733
void SCIPgmlWriteNode(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor)
Definition: misc.c:295
SCIP_Longint SCIPdivesetGetNBacktracks(SCIP_DIVESET *diveset)
Definition: heur.c:465
void SCIPsplitFilename(char *filename, char **path, char **name, char **extension, char **compression)
Definition: misc.c:8363
SCIP_Bool misc_permutevars
Definition: struct_set.h:318
SCIP_Longint SCIPbranchruleGetNLPCalls(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1997
SCIP_Real lastsolgap
Definition: struct_stat.h:100
SCIP_Real SCIPdivesetGetAvgSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:435
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:34843
SCIP_RETCODE SCIPsetConflicthdlrInit(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTINIT((*conflictinit)))
Definition: scip.c:6026
SCIP_RETCODE SCIPreoptAddSol(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem, SCIP_SOL *sol, SCIP_Bool bestsol, SCIP_Bool *added, SCIP_VAR **vars, int nvars, int run)
Definition: reopt.c:4155
void SCIPrelaxSetPriority(SCIP_RELAX *relax, SCIP_SET *set, int priority)
Definition: relax.c:471
SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
Definition: scip.c:12302
SCIP_RETCODE SCIPsetResetParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:3005
SCIP_Longint SCIPconflictGetNStrongbranchIterations(SCIP_CONFLICT *conflict)
Definition: conflict.c:6747
SCIP_RETCODE SCIPgetNegatedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **negvars)
Definition: scip.c:17196
int SCIPpricerGetNCalls(SCIP_PRICER *pricer)
Definition: pricer.c:594
SCIP_Real SCIPgetHugeValue(SCIP *scip)
Definition: scip.c:41674
SCIP_Longint nrootstrongbranchs
Definition: struct_stat.h:160
SCIP_RETCODE SCIPvarParseOriginal(SCIP_VAR **var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, const char *str, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARCOPY((*varcopy)), SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_VARDATA *vardata, char **endptr, SCIP_Bool *success)
Definition: var.c:2391
static void printSeparatorStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39676
SCIP_RETCODE SCIPtreeBacktrackProbing(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_LP *lp, SCIP_PRIMAL *primal, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, int probingdepth)
Definition: tree.c:6493
static SCIP_Real getPrimalbound(SCIP *scip)
Definition: scip.c:487
SCIP_RETCODE SCIPsolCreateUnknown(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_HEUR *heur)
Definition: sol.c:672
SCIP_RETCODE SCIPrespropCons(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, int inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd, SCIP_RESULT *result)
Definition: scip.c:26073
interface methods for specific LP solvers
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
Definition: type_event.h:129
SCIP_Bool SCIPsetIsScalingIntegral(SCIP_SET *set, SCIP_Real val, SCIP_Real scalar)
Definition: set.c:5336
SCIP_NODE * SCIPtreeGetBestNode(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:6795
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
Definition: set.c:5042
SCIP_Bool time_reading
Definition: struct_set.h:443
int SCIPintarrayGetVal(SCIP_INTARRAY *intarray, int idx)
Definition: misc.c:2974
SCIP_RETCODE SCIPsetRelaxPriority(SCIP *scip, SCIP_RELAX *relax, int priority)
Definition: scip.c:6591
#define SCIP_DECL_PRICEREXIT(x)
Definition: type_pricer.h:70
SCIP_RETCODE SCIPstartInteraction(SCIP *scip)
Definition: scip.c:8981
SCIP_Longint SCIPgetNBarrierLPIterations(SCIP *scip)
Definition: scip.c:37599
SCIP_Bool SCIPcolIsInLP(SCIP_COL *col)
Definition: lp.c:18748
SCIP_Bool history_allowmerge
Definition: struct_set.h:227
SCIP_RETCODE SCIPcopyConss(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool *valid)
Definition: scip.c:2497
SCIP_RETCODE SCIPprimalAddOrigSol(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_SOL *sol, SCIP_Bool *stored)
Definition: primal.c:1109
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
Definition: scip.c:24320
#define SCIPfreeMemoryArray(scip, ptr)
Definition: scip.h:20544
int SCIPpresolGetNChgCoefs(SCIP_PRESOL *presol)
Definition: presol.c:751
SCIP_RETCODE SCIPgetTransformedCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
Definition: scip.c:25450
SCIP_Real SCIPcomputeVarLbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21407
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, unsigned int timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
Definition: scip.c:7252
SCIP_Real SCIPgetClockTime(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:40950
SCIP_RETCODE SCIPsolLinkCurrentSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
Definition: sol.c:891
int nreoptruns
Definition: struct_stat.h:221
SCIP_Real SCIPlpGetGlobalPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:15227
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)
Definition: nlp.c:1995
SCIP_RETCODE SCIProwEnsureSize(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: lp.c:580
SCIP_NODE * SCIPtreeGetBestChild(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:6731
int SCIPbranchcandGetNPrioExternCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:467
SCIP_RETCODE SCIPsetIncludeDialog(SCIP_SET *set, SCIP_DIALOG *dialog)
Definition: set.c:4194
SCIP_Real SCIPcutGetLPActivityQuot(SCIP_CUT *cut)
Definition: cutpool.c:383
SCIP_RETCODE SCIPnlpGetStatistics(SCIP_NLP *nlp, SCIP_NLPSTATISTICS *statistics)
Definition: nlp.c:5948
SCIP_RETCODE SCIPsplitReoptRoot(SCIP *scip, int *ncreatedchilds, int *naddedconss)
Definition: scip.c:15642
int SCIPnodepqLen(const SCIP_NODEPQ *nodepq)
Definition: nodesel.c:550
SCIP_SOL ** sols
Definition: struct_primal.h:47
SCIP_PROBDATA * SCIPgetProbData(SCIP *scip)
Definition: scip.c:9838
void SCIPmessagehdlrCapture(SCIP_MESSAGEHDLR *messagehdlr)
Definition: message.c:323
int npresoldelconss
Definition: struct_stat.h:198
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
Definition: scip.c:17429
void SCIPgmlWriteClosing(FILE *file)
Definition: misc.c:497
SCIP_RETCODE SCIPparseCons(SCIP *scip, SCIP_CONS **cons, const char *str, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool *success)
Definition: scip.c:24856
SCIP_Real SCIPbranchGetScore(SCIP_SET *set, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: branch.c:2096
const char * SCIPpresolGetName(SCIP_PRESOL *presol)
Definition: presol.c:553
SCIP_Real SCIPgetLocalTransEstimate(SCIP *scip)
Definition: scip.c:12152
SCIP_RETCODE SCIPvarMarkDoNotMultaggr(SCIP_VAR *var)
Definition: var.c:5678
SCIP_RETCODE SCIPsetConflicthdlrCopy(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTCOPY((*conflictcopy)))
Definition: scip.c:5994
SCIP_RETCODE SCIPsetConflicthdlrInitsol(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)))
Definition: scip.c:6058
SCIP_Real SCIPvarGetLbLP(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:12191
SCIP_RETCODE SCIPpermuteProb(SCIP *scip, unsigned int randseed, SCIP_Bool permuteconss, SCIP_Bool permutebinvars, SCIP_Bool permuteintvars, SCIP_Bool permuteimplvars, SCIP_Bool permutecontvars)
Definition: scip.c:9660
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
Definition: scip.c:5818
#define SCIP_DECL_PROBDELTRANS(x)
Definition: type_prob.h:86
SCIP_Longint nstrongbranchs
Definition: struct_stat.h:159
SCIP_RETCODE SCIPvarCatchEvent(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: var.c:17537
void SCIPreaderSetFree(SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: reader.c:477
SCIP_RETCODE SCIPwriteVarsList(SCIP *scip, FILE *file, SCIP_VAR **vars, int nvars, SCIP_Bool type, char delimiter)
Definition: scip.c:15915
#define SCIP_EVENTTYPE_ROWCHANGED
Definition: type_event.h:122
SCIP_Real SCIPgetVarConflictlengthScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23738
SCIP_RETCODE SCIPwriteTransProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:9554
SCIP_RETCODE SCIPsetNlpiPriority(SCIP *scip, SCIP_NLPI *nlpi, int priority)
Definition: scip.c:8696
void SCIPcomprSetExitsol(SCIP_COMPR *compr, SCIP_DECL_COMPREXITSOL((*comprexitsol)))
Definition: compr.c:384
SCIP_RETCODE SCIPchgVarUbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:31772
int SCIPconshdlrGetNChgCoefs(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4691
int SCIPgetNLPCols(SCIP *scip)
Definition: scip.c:26728
SCIP_RETCODE SCIPreoptnodeDelete(SCIP_REOPTNODE **reoptnode, BMS_BLKMEM *blkmem)
Definition: reopt.c:6346
int SCIPgetNCutsFoundRound(SCIP *scip)
Definition: scip.c:38015
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
Definition: lpi_clp.cpp:2271
void SCIPaddSquareLinearization(SCIP *scip, SCIP_Real sqrcoef, SCIP_Real refpoint, SCIP_Bool isint, SCIP_Real *lincoef, SCIP_Real *linconstant, SCIP_Bool *success)
Definition: scip.c:30454
SCIP_RETCODE SCIPevalExprtreeLocalBounds(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val)
Definition: scip.c:30394
#define SCIP_DECL_BRANCHFREE(x)
Definition: type_branch.h:60
void SCIPgetReoptnodePath(SCIP *scip, SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, int mem, int *nvars, int *nafterdualvars)
Definition: scip.c:15139
int SCIPconshdlrGetNActiveConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4322
SCIP_BRANCHCAND * branchcand
Definition: struct_scip.h:74
int lastnpresolchgvartypes
Definition: struct_stat.h:205
int SCIPsepastoreGetNCutsApplied(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1387
SCIP_Real SCIPgetDualboundRoot(SCIP *scip)
Definition: scip.c:38414
SCIP_RETCODE SCIPsetComprPriority(SCIP *scip, SCIP_COMPR *compr, int priority)
Definition: scip.c:7664
SCIP_Bool time_statistictiming
Definition: struct_set.h:445
#define SCIP_DECL_CONSRESPROP(x)
Definition: type_cons.h:530
SCIP_Real SCIPconshdlrGetSepaTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4381
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:350
SCIP_RETCODE SCIPsetConshdlrEnable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
Definition: scip.c:5703
SCIP_RETCODE SCIPconsGetVars(SCIP_CONS *cons, SCIP_SET *set, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
Definition: cons.c:5936
SCIP_RETCODE SCIPunfixParam(SCIP *scip, const char *name)
Definition: scip.c:3875
SCIP_Longint nrootsblpiterations
Definition: struct_stat.h:62
SCIP_Longint SCIPconflictGetNInfeasibleLPReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:6329
void SCIPenableDebugSol(SCIP *scip)
Definition: scip.c:1143
SCIP_RETCODE SCIPrecalcNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:29947
SCIP_RETCODE SCIPgetVarsStrongbranchesFrac(SCIP *scip, SCIP_VAR **vars, int nvars, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict, SCIP_Bool *lperror)
Definition: scip.c:19030
#define SCIPallocMemoryArray(scip, ptr, num)
Definition: scip.h:20528
SCIP_RETCODE SCIPpropagateProbing(SCIP *scip, int maxproprounds, SCIP_Bool *cutoff, SCIP_Longint *ndomredsfound)
Definition: scip.c:32552
SCIP_Longint SCIPconflictGetNInfeasibleLPReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:6339
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
Definition: scip.c:7393
SCIP_RETCODE SCIPconsSetSeparated(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool separate)
Definition: cons.c:6144
void * SCIPptrarrayGetVal(SCIP_PTRARRAY *ptrarray, int idx)
Definition: misc.c:3695
SCIP_RETCODE SCIPcreateVarBasic(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype)
Definition: scip.c:15817
SCIP_Longint SCIPgetNDualLPs(SCIP *scip)
Definition: scip.c:37545
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
Definition: cons.c:7909
void SCIPsetSortHeurs(SCIP_SET *set)
Definition: set.c:3832
#define FALSE
Definition: def.h:56
SCIP_SEPA ** sepas
Definition: struct_set.h:72
SCIP_Real SCIPgetSolTransObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:35113
#define SCIP_DECL_PRESOLCOPY(x)
Definition: type_presol.h:46
SCIP_RETCODE SCIPsetPtrarrayVal(SCIP *scip, SCIP_PTRARRAY *ptrarray, int idx, void *val)
Definition: scip.c:42989
SCIP_RETCODE SCIPnlpSolveDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat)
Definition: nlp.c:6308
SCIP_RETCODE SCIPstartStrongbranch(SCIP *scip, SCIP_Bool enablepropagation)
Definition: scip.c:17963
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip.c:41009
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:2057
SCIP_RETCODE SCIPlpWrite(SCIP_LP *lp, const char *fname)
Definition: lp.c:18179
void SCIPpropSetExitsol(SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: prop.c:811
#define BMSdisplayBlockMemory(mem)
Definition: memory.h:429
SCIP_RETCODE SCIPnlpGetVarsNonlinearity(SCIP_NLP *nlp, int *nlcount)
Definition: nlp.c:5761
SCIP_RETCODE SCIPeventProcess(SCIP_EVENT *event, SCIP_SET *set, SCIP_PRIMAL *primal, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter)
Definition: event.c:1418
void SCIPstatEnableOrDisableStatClocks(SCIP_STAT *stat, SCIP_Bool enable)
Definition: stat.c:556
SCIP_Bool SCIPlpIsSolBasic(SCIP_LP *lp)
Definition: lp.c:19393
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
Definition: scip.c:4046
char sepa_cutselrestart
Definition: struct_set.h:425
SCIP_COMPR ** SCIPgetComprs(SCIP *scip)
Definition: scip.c:7640
#define SCIP_DECL_PRICERINIT(x)
Definition: type_pricer.h:62
int SCIPboolarrayGetMaxIdx(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:3441
SCIP_Bool SCIPisSumRelLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42361
SCIP_Bool SCIPsetIsFeasIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5721
SCIP_RETCODE SCIPwriteVarsPolynomial(SCIP *scip, FILE *file, SCIP_VAR ***monomialvars, SCIP_Real **monomialexps, SCIP_Real *monomialcoefs, int *monomialnvars, int nmonomials, SCIP_Bool type)
Definition: scip.c:16027
SCIP_NLPTERMSTAT SCIPgetNLPTermstat(SCIP *scip)
Definition: scip.c:28812
SCIP_RETCODE SCIPcreateBoolarray(SCIP *scip, SCIP_BOOLARRAY **boolarray)
Definition: scip.c:42775
SCIP_RETCODE SCIPconflictAnalyze(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, int validdepth, SCIP_Bool *success)
Definition: conflict.c:4214
SCIP_RETCODE SCIPincludeExternalCodeInformation(SCIP *scip, const char *name, const char *description)
Definition: scip.c:8711
SCIP_Real objoffset
Definition: struct_prob.h:40
static void printHeuristicStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39776
struct SCIP_VarData SCIP_VARDATA
Definition: type_var.h:96
SCIP_NODESEL * SCIPsetGetNodesel(SCIP_SET *set, SCIP_STAT *stat)
Definition: set.c:4030
SCIP_Bool solved
Definition: struct_lp.h:338
SCIP_RETCODE SCIPremoveVarFromGlobalStructures(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:22366
#define SCIP_DECL_RELAXINIT(x)
Definition: type_relax.h:63
SCIP_Bool SCIPconshdlrDoesPresolve(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4791
SCIP_RETCODE SCIPbranchExecPseudo(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_Real cutoffbound, SCIP_Bool allowaddcons, SCIP_RESULT *result)
Definition: branch.c:2608
#define SCIP_DECL_RELAXINITSOL(x)
Definition: type_relax.h:82
SCIP_RETCODE SCIPenableConsPropagation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:25727
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:280
SCIP_RETCODE SCIPreoptAddRun(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **transvars, int ntransvars, int size)
Definition: reopt.c:4234
SCIP_Longint SCIPbranchruleGetNCutsFound(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2037
SCIP_RETCODE SCIPvarTransform(SCIP_VAR *origvar, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_OBJSENSE objsense, SCIP_VAR **transvar)
Definition: var.c:3277
int limit_maxorigsol
Definition: struct_set.h:244
SCIP_PROP * SCIPsetFindProp(SCIP_SET *set, const char *name)
Definition: set.c:3720
SCIP_RETCODE SCIPprintStatus(SCIP *scip, FILE *file)
Definition: scip.c:931
SCIP_RETCODE SCIPreoptApplyCompression(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE **representatives, int nrepresentatives, SCIP_Bool *success)
Definition: reopt.c:5320
int SCIPgetNBinVars(SCIP *scip)
Definition: scip.c:10743
SCIP_RETCODE SCIPactiveCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:26170
SCIP_CONS * SCIPfindOrigCons(SCIP *scip, const char *name)
Definition: scip.c:11593
int SCIPbranchcandGetNPrioPseudoImpls(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:842
SCIP_Real primaldualintegral
Definition: struct_stat.h:108
int SCIPgetNPseudoBranchCands(SCIP *scip)
Definition: scip.c:33489
SCIP_Real SCIPdualfeastol(SCIP *scip)
Definition: scip.c:41174
SCIP_RETCODE SCIPrecomputeSolObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:35144
SCIP_RETCODE SCIPsolCopy(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_SOL *sourcesol)
Definition: sol.c:339
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: scip.c:7778
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:8174
SCIP_Bool SCIPsetIsZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5292
SCIP_STAGE stage
Definition: struct_set.h:58
int SCIPgetNRelaxs(SCIP *scip)
Definition: scip.c:6580
int SCIPpresolGetNDelConss(SCIP_PRESOL *presol)
Definition: presol.c:721
SCIP_RETCODE SCIPcreateUnknownSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:34186
#define TRUE
Definition: def.h:55
SCIP_RETCODE SCIPsetConflicthdlrFree(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTFREE((*conflictfree)))
Definition: scip.c:6010
SCIP_DOMCHG * SCIPnodeGetDomchg(SCIP_NODE *node)
Definition: tree.c:7111
SCIP_RETCODE SCIPnlrowEnsureQuadElementsSize(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:2573
SCIP_Real SCIPvarGetAvgConflictlength(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:14564
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
Definition: cons.c:7640
void SCIPprobSetExitsol(SCIP_PROB *prob, SCIP_DECL_PROBEXITSOL((*probexitsol)))
Definition: prob.c:372
SCIP_RETCODE SCIPaddExternBranchCand(SCIP *scip, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
Definition: scip.c:33396
int SCIPgetRealarrayMaxIdx(SCIP *scip, SCIP_REALARRAY *realarray)
Definition: scip.c:42609
SCIP_Real SCIPgetAvgConflictScore(SCIP *scip)
Definition: scip.c:38937
void SCIPprobMarkNConss(SCIP_PROB *prob)
Definition: prob.c:1357
#define SCIP_DECL_HEURCOPY(x)
Definition: type_heur.h:60
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_Longint SCIPconflictGetNPropConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:4323
SCIP_Bool SCIPcliqueIsEquation(SCIP_CLIQUE *clique)
Definition: implics.c:3153
#define SCIP_DECL_PROPEXITPRE(x)
Definition: type_prop.h:100
#define SCIP_DECL_HEUREXEC(x)
Definition: type_heur.h:126
SCIP_RETCODE SCIPsetRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx, SCIP_Real val)
Definition: scip.c:42558
SCIP_RETCODE SCIPnlpCreate(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, const char *name, int nvars_estimate)
Definition: nlp.c:5013
SCIP_RETCODE SCIPupdateVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
Definition: scip.c:23184
SCIP_Longint SCIPgetVarStrongbranchNode(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19300
SCIP_RETCODE SCIPsetEventhdlrInit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINIT((*eventinit)))
Definition: scip.c:7838
SCIP_RETCODE SCIPcliquetableCreate(SCIP_CLIQUETABLE **cliquetable, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: implics.c:1776
#define SCIP_DECL_CONSGETNVARS(x)
Definition: type_cons.h:798
SCIP_RETCODE SCIPsolveNLP(SCIP *scip)
Definition: scip.c:28767
SCIP_PRESOL * SCIPsetFindPresol(SCIP_SET *set, const char *name)
Definition: set.c:3498
SCIP_RETCODE SCIPchgVarName(SCIP *scip, SCIP_VAR *var, const char *name)
Definition: scip.c:16935
int nenabledconss
Definition: struct_stat.h:187
void SCIPconshdlrSetFree(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
Definition: cons.c:3993
SCIP_RETCODE SCIPgetReoptOldObjCoef(SCIP *scip, SCIP_VAR *var, int run, SCIP_Real *objcoef)
Definition: scip.c:14910
void SCIPcomprSetPriority(SCIP_COMPR *compr, SCIP_SET *set, int priority)
Definition: compr.c:439
#define SCIP_PRESOLTIMING_EXHAUSTIVE
Definition: type_timing.h:45
SCIP_NLPSOLSTAT SCIPgetNLPSolstat(SCIP *scip)
Definition: scip.c:28790
SCIP_RETCODE SCIPsetProbDelorig(SCIP *scip, SCIP_DECL_PROBDELORIG((*probdelorig)))
Definition: scip.c:9097
void SCIPcomprSetInit(SCIP_COMPR *compr, SCIP_DECL_COMPRINIT((*comprinit)))
Definition: compr.c:351
SCIP_RETCODE SCIPchgChildPrio(SCIP *scip, SCIP_NODE *child, SCIP_Real priority)
Definition: scip.c:12396
SCIP_Real SCIProwGetLPEfficacy(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:6487
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
Definition: scip.c:5795
SCIP_RETCODE SCIPsetPropCopy(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
Definition: scip.c:6945
#define SCIP_CALL(x)
Definition: def.h:266
int SCIPheurGetNDivesets(SCIP_HEUR *heur)
Definition: heur.c:1355
SCIP_Longint nnlps
Definition: struct_stat.h:162
SCIP_RETCODE SCIPgetNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudoactivity)
Definition: scip.c:29968
SCIP_RETCODE SCIPnlpChgVarsBoundsDive(SCIP_NLP *nlp, SCIP_SET *set, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: nlp.c:6256
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1877
SCIP_Real SCIPgetTimeOfDay(SCIP *scip)
Definition: scip.c:40702
SCIP_RETCODE SCIPsetPropPresolPriority(SCIP *scip, SCIP_PROP *prop, int presolpriority)
Definition: scip.c:7175
SCIP_Real SCIPlpGetRootColumnObjval(SCIP_LP *lp)
Definition: lp.c:19328
void SCIPconflicthdlrSetPriority(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_SET *set, int priority)
Definition: conflict.c:736
SCIP_Real SCIPprobInternObjval(SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_SET *set, SCIP_Real objval)
Definition: prob.c:1975
void SCIPlpStartStrongbranchProbing(SCIP_LP *lp)
Definition: lp.c:17997
enum SCIP_Varstatus SCIP_VARSTATUS
Definition: type_var.h:48
SCIP_RETCODE SCIPresetReoptnodeDualcons(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:15669
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip.c:36299
SCIP_Longint nbacktracks
Definition: struct_stat.h:72
int SCIPtreeGetCurrentDepth(SCIP_TREE *tree)
Definition: tree.c:7957
int SCIPgetRepropdepth(SCIP *scip)
Definition: scip.c:37171
SCIP_Real SCIPsolGetRayVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var)
Definition: sol.c:1369
SCIP_RETCODE SCIPvarCreateOriginal(SCIP_VAR **var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
Definition: var.c:1996
SCIP_VAR * SCIPboundchgGetVar(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16350
SCIP_Real SCIPpropGetRespropTime(SCIP_PROP *prop)
Definition: prop.c:1022
SCIP_RETCODE SCIPsetSetParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, void *value)
Definition: set.c:2692
void SCIPaddBilinMcCormick(SCIP *scip, SCIP_Real bilincoef, SCIP_Real lbx, SCIP_Real ubx, SCIP_Real refpointx, SCIP_Real lby, SCIP_Real uby, SCIP_Real refpointy, SCIP_Bool overestimate, SCIP_Real *lincoefx, SCIP_Real *lincoefy, SCIP_Real *linconstant, SCIP_Bool *success)
Definition: scip.c:30619
void SCIPsepaSetExit(SCIP_SEPA *sepa, SCIP_DECL_SEPAEXIT((*sepaexit)))
Definition: sepa.c:600
SCIP_Bool branch_checksbsol
Definition: struct_set.h:155
void SCIPrelaxSetCopy(SCIP_RELAX *relax, SCIP_DECL_RELAXCOPY((*relaxcopy)))
Definition: relax.c:375
const char * SCIPgetGitHash(void)
Definition: scipgithash.c:27
SCIP_RETCODE SCIPsetReoptCompression(SCIP *scip, SCIP_REOPTNODE **representation, int nrepresentatives, SCIP_Bool *success)
Definition: scip.c:15088
SCIP_RETCODE SCIPgetBinvarRepresentatives(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **repvars, SCIP_Bool *negated)
Definition: scip.c:17280
void SCIPpropSetFree(SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: prop.c:767
SCIP_Longint SCIPsepaGetNDomredsFound(SCIP_SEPA *sepa)
Definition: sepa.c:850
SCIP_RETCODE SCIPptrarrayExtend(SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:3509
SCIP_Bool branch_divingpscost
Definition: struct_set.h:152
SCIP_RETCODE SCIPvarAddImplic(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_CLIQUETABLE *cliquetable, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype, SCIP_Real implbound, SCIP_Bool transitive, SCIP_Bool *infeasible, int *nbdchgs)
Definition: var.c:10214
#define SCIP_DECL_VARCOPY(x)
Definition: type_var.h:170
enum SCIP_VerbLevel SCIP_VERBLEVEL
Definition: type_message.h:48
unsigned int sbdownvalid
Definition: struct_lp.h:176
int SCIPgetNConflictConssFoundNode(SCIP *scip)
Definition: scip.c:38090
void SCIPprintExternalCodes(SCIP *scip, FILE *file)
Definition: scip.c:8767
void SCIPpropSetInitpre(SCIP_PROP *prop, SCIP_DECL_PROPINITPRE((*propinitpre)))
Definition: prop.c:822
internal methods for branching rules and branching candidate storage
void SCIPheurSetPriority(SCIP_HEUR *heur, SCIP_SET *set, int priority)
Definition: heur.c:1218
SCIP_RETCODE SCIPpricestoreCreate(SCIP_PRICESTORE **pricestore)
Definition: pricestore.c:96
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:41972
SCIP_RETCODE SCIPcliquetableCleanup(SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, int *nchgbds, SCIP_Bool *infeasible)
Definition: implics.c:2780
SCIP_RETCODE SCIPreoptFree(SCIP_REOPT **reopt, SCIP_SET *set, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem)
Definition: reopt.c:4042
SCIP_RETCODE SCIPdelPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31082
void SCIPpricerSetFree(SCIP_PRICER *pricer, SCIP_DECL_PRICERFREE((*pricerfree)))
Definition: pricer.c:495
SCIP_CUT ** SCIPgetDelayedPoolCuts(SCIP *scip)
Definition: scip.c:31379
SCIP_RETCODE SCIPconvertCutsToConss(SCIP *scip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip.c:2823
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
Definition: scip.c:4109
SCIP_Bool SCIPsolsAreEqual(SCIP_SOL *sol1, SCIP_SOL *sol2, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob)
Definition: sol.c:1865
SCIP_RETCODE SCIPvarChgLbDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newbound)
Definition: var.c:7732
int SCIPdomchgGetNBoundchgs(SCIP_DOMCHG *domchg)
Definition: var.c:16390
void SCIPbranchcandClearExternCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:649
SCIP_Real SCIPsetCutoffbounddelta(SCIP_SET *set)
Definition: set.c:5155
int SCIPsetCalcMemGrowSize(SCIP_SET *set, int num)
Definition: set.c:4766
SCIP_RETCODE SCIPensureBlockMemoryArray_call(SCIP *scip, void **arrayptr, size_t elemsize, int *arraysize, int minsize)
Definition: scip.c:41438
int SCIPdivesetGetMaxSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:425
SCIP_Longint SCIPconshdlrGetNPropCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4481
SCIP_Real SCIPgetTransObjoffset(SCIP *scip)
Definition: scip.c:10139
SCIP_Longint SCIPbranchruleGetNConssFound(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2049
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip.c:19590
void SCIPmarkColNotRemovableLocal(SCIP *scip, SCIP_COL *col)
Definition: scip.c:27449
SCIP_Bool presol_donotmultaggr
Definition: struct_set.h:369
SCIP_RETCODE SCIPgetConsCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_CONS *sourcecons, SCIP_CONS **targetcons, SCIP_CONSHDLR *sourceconshdlr, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool global, SCIP_Bool *success)
Definition: scip.c:2365
SCIP_Bool SCIPsetIsSumLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5429
SCIP_Real SCIPgetAvgPseudocostCurrentRun(SCIP *scip, SCIP_Real solvaldelta)
Definition: scip.c:38831
SCIP_Bool misc_permuteconss
Definition: struct_set.h:317
SCIP_PARAM ** SCIPsetGetParams(SCIP_SET *set)
Definition: set.c:3105
SCIP_RETCODE SCIPaddVarBranchFactor(SCIP *scip, SCIP_VAR *var, SCIP_Real addfactor)
Definition: scip.c:22456
SCIP_Bool SCIPallowDualReds(SCIP *scip)
Definition: scip.c:23083
SCIP_RETCODE SCIPreoptnodeAddCons(SCIP_REOPTNODE *reoptnode, BMS_BLKMEM *blkmem, SCIP_VAR **consvars, SCIP_Real *consvals, int nvars, REOPT_CONSTYPE constype)
Definition: reopt.c:6387
static void printPricerStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39712
SCIP_Real SCIPsetRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5389
int SCIPconshdlrGetNAddConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4671
void SCIPreoptResetSolMarks(SCIP_REOPT *reopt)
Definition: reopt.c:4566
SCIP_Real SCIPgetRowMaxActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28097
#define infty2infty(infty1, infty2, val)
Definition: scip.c:30213
SCIP_Real SCIPgetVarPseudocostVal(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
Definition: scip.c:23218
SCIP_RETCODE SCIPprobInitSolve(SCIP_PROB *prob, SCIP_SET *set)
Definition: prob.c:1788
SCIP_RETCODE SCIPconsEnableSeparation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6523
SCIP_NODE * SCIPtreeGetFocusNode(SCIP_TREE *tree)
Definition: tree.c:7865
static void printRootStatistics(SCIP *scip, FILE *file)
Definition: scip.c:40217
SCIP_Real SCIPgetNLPObjval(SCIP *scip)
Definition: scip.c:28861
SCIP_ROW ** SCIPgetLPRows(SCIP *scip)
Definition: scip.c:26785
SCIP_RETCODE SCIPvarChgUbGlobal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Real newbound)
Definition: var.c:6823
SCIP_RETCODE SCIPaddQuadElementsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nquadelems, SCIP_QUADELEM *quadelems)
Definition: scip.c:29736
SCIP_NLPTERMSTAT SCIPnlpGetTermstat(SCIP_NLP *nlp)
Definition: nlp.c:5938
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
SCIP_Bool SCIPisCutApplicable(SCIP *scip, SCIP_ROW *cut)
Definition: scip.c:30949
#define SCIP_DECL_CONSEXITSOL(x)
Definition: type_cons.h:174
int SCIPgetNActivePricers(SCIP *scip)
Definition: scip.c:5017
SCIP_VAR ** SCIPgetFixedVars(SCIP *scip)
Definition: scip.c:10972
void SCIPconshdlrSetCopy(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
Definition: cons.c:3978
SCIP_RETCODE SCIPparseVarsLinearsum(SCIP *scip, const char *str, SCIP_VAR **vars, SCIP_Real *vals, int *nvars, int varssize, int *requiredsize, char **endptr, SCIP_Bool *success)
Definition: scip.c:16332
SCIP_Bool SCIPisDualfeasPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:42157
SCIP_VAR ** fixedvars
Definition: struct_prob.h:55
SCIP_RETCODE SCIPeventqueueFree(SCIP_EVENTQUEUE **eventqueue)
Definition: event.c:2017
SCIP_RETCODE SCIPlpEndDive(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_PROB *prob, SCIP_VAR **vars, int nvars)
Definition: lp.c:17761
SCIP_RETCODE SCIProwMakeIntegral(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_STAT *stat, SCIP_LP *lp, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Bool usecontvars, SCIP_Bool *success)
Definition: lp.c:5745
SCIP_Real mem_arraygrowfac
Definition: struct_set.h:302
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:42008
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
Definition: scip.c:38561
SCIP_RETCODE SCIPcreateDiveset(SCIP *scip, SCIP_DIVESET **diveset, SCIP_HEUR *heur, const char *name, SCIP_Real minreldepth, SCIP_Real maxreldepth, SCIP_Real maxlpiterquot, SCIP_Real maxdiveubquot, SCIP_Real maxdiveavgquot, SCIP_Real maxdiveubquotnosol, SCIP_Real maxdiveavgquotnosol, SCIP_Real lpresolvedomchgquot, int lpsolvefreq, int maxlpiterofs, SCIP_Bool backtrack, SCIP_Bool onlylpbranchcands, SCIP_Bool specificsos1score, SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)))
Definition: scip.c:7689
SCIP_Real SCIPbranchruleGetSetupTime(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1977
SCIP_RETCODE SCIPnodeCutoff(SCIP_NODE *node, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, BMS_BLKMEM *blkmem)
Definition: tree.c:1122
struct SCIP_DialogData SCIP_DIALOGDATA
Definition: type_dialog.h:42
SCIP_Bool SCIPsetIsDualfeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5835
SCIP_Longint nsolsfound
Definition: struct_primal.h:38
SCIP_RETCODE SCIPmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:25786
SCIP_Bool SCIPpressedCtrlC(SCIP *scip)
Definition: scip.c:1112
int nheurs
Definition: struct_set.h:103
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:27888
void SCIPnodeGetAncestorBranchingPath(SCIP_NODE *node, SCIP_VAR **branchvars, SCIP_Real *branchbounds, SCIP_BOUNDTYPE *boundtypes, int *nbranchvars, int branchvarssize, int *nodeswitches, int *nnodes, int nodeswitchsize)
Definition: tree.c:7658
SCIP_PROP * SCIPfindProp(SCIP *scip, const char *name)
Definition: scip.c:7123
SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41845
SCIP_RETCODE SCIPprobScaleObj(SCIP_PROB *transprob, SCIP_PROB *origprob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue)
Definition: prob.c:1537
#define SCIP_DECL_BRANCHEXECEXT(x)
Definition: type_branch.h:140
SCIP_RETCODE SCIPcreateCutpool(SCIP *scip, SCIP_CUTPOOL **cutpool, int agelimit)
Definition: scip.c:31163
SCIP_RETCODE SCIPsetIncludeNlpi(SCIP_SET *set, SCIP_NLPI *nlpi)
Definition: set.c:4238
int maxtotaldepth
Definition: struct_stat.h:184
SCIP_RETCODE SCIPconsSetPropagated(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool propagate)
Definition: cons.c:6262
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip.c:26439
SCIP_Real SCIPvarGetAvgInferences(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15263
SCIP_RETCODE SCIPsetRootDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip.c:8880
SCIP_Real SCIPreoptGetOldObjCoef(SCIP_REOPT *reopt, int run, int idx)
Definition: reopt.c:4538
SCIP_RETCODE SCIPlpSolveAndEval(SCIP_LP *lp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_PROB *prob, SCIP_Longint itlim, SCIP_Bool limitresolveiters, SCIP_Bool aging, SCIP_Bool keepsol, SCIP_Bool *lperror)
Definition: lp.c:14511
SCIP_RETCODE SCIPsetBranchruleCopy(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHCOPY((*branchcopy)))
Definition: scip.c:8290
SCIP_RETCODE SCIPdispCreate(SCIP_DISP **disp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, const char *header, SCIP_DISPSTATUS dispstatus, SCIP_DECL_DISPCOPY((*dispcopy)), SCIP_DECL_DISPFREE((*dispfree)), SCIP_DECL_DISPINIT((*dispinit)), SCIP_DECL_DISPEXIT((*dispexit)), SCIP_DECL_DISPINITSOL((*dispinitsol)), SCIP_DECL_DISPEXITSOL((*dispexitsol)), SCIP_DECL_DISPOUTPUT((*dispoutput)), SCIP_DISPDATA *dispdata, int width, int priority, int position, SCIP_Bool stripline)
Definition: disp.c:73
SCIP_RETCODE SCIPfreeTransform(SCIP *scip)
Definition: scip.c:15373
SCIP_RETCODE SCIPprobFree(SCIP_PROB **prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: prob.c:394
SCIP_RETCODE SCIPcliquetableFree(SCIP_CLIQUETABLE **cliquetable, BMS_BLKMEM *blkmem)
Definition: implics.c:1808
SCIP_CLOCK * barrierlptime
Definition: struct_stat.h:122
SCIP_Longint SCIPgetNDualResolveLPIterations(SCIP *scip)
Definition: scip.c:37713
SCIP_RETCODE SCIPaddLongintParam(SCIP *scip, const char *name, const char *desc, SCIP_Longint *valueptr, SCIP_Bool isadvanced, SCIP_Longint defaultvalue, SCIP_Longint minvalue, SCIP_Longint maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip.c:3601
SCIP_Bool SCIPcontainsExternBranchCand(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:33440
SCIP_Real SCIPhistoryGetVSIDS(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:513
SCIP_RETCODE SCIPnlrowChgExprtreeParams(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *paramvals)
Definition: nlp.c:2740
SCIP_ROW ** SCIPlpGetRows(SCIP_LP *lp)
Definition: lp.c:19188
SCIP_Bool diving
Definition: struct_lp.h:349
int SCIPgetPtrarrayMaxIdx(SCIP *scip, SCIP_PTRARRAY *ptrarray)
Definition: scip.c:43021
#define SCIPdebugMessage
Definition: pub_message.h:77
SCIP_RETCODE SCIPinterruptCreate(SCIP_INTERRUPT **interrupt)
Definition: interrupt.c:76
SCIP_RETCODE SCIPconflictFree(SCIP_CONFLICT **conflict, BMS_BLKMEM *blkmem)
Definition: conflict.c:2590
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition: scip.c:34983
SCIP_Real SCIPgetGap(SCIP *scip)
Definition: scip.c:38643
SCIP_Bool SCIPisSumRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42387
SCIP_Real SCIPlpGetPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:15256
#define SCIP_DECL_PRICEREXITSOL(x)
Definition: type_pricer.h:92
SCIP_RETCODE SCIPinferVarLbProp(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_PROP *inferprop, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:20841
SCIP_RETCODE SCIPgetVarStrongbranchFrac(SCIP *scip, SCIP_VAR *var, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict, SCIP_Bool *lperror)
Definition: scip.c:18191
SCIP_RETCODE SCIPchgIntParam(SCIP *scip, SCIP_PARAM *param, int value)
Definition: scip.c:3975
unsigned int SCIP_DIVETYPE
Definition: type_heur.h:48
SCIP_RETCODE SCIPvarsGetActiveVars(SCIP_SET *set, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize)
Definition: var.c:11270
SCIP_RETCODE SCIPconflicthdlrCreate(SCIP_CONFLICTHDLR **conflicthdlr, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_DECL_CONFLICTCOPY((*conflictcopy)), SCIP_DECL_CONFLICTFREE((*conflictfree)), SCIP_DECL_CONFLICTINIT((*conflictinit)), SCIP_DECL_CONFLICTEXIT((*conflictexit)), SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)), SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)), SCIP_DECL_CONFLICTEXEC((*conflictexec)), SCIP_CONFLICTHDLRDATA *conflicthdlrdata)
Definition: conflict.c:379
SCIP_Bool SCIPisSumRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42374
int SCIPdivesetGetNCalls(SCIP_DIVESET *diveset)
Definition: heur.c:365
SCIP_Bool SCIPhasPerformedPresolve(SCIP *scip)
Definition: scip.c:1096
int SCIPsubversion(void)
Definition: scip.c:584
SCIP_RETCODE SCIPsetBranchruleFree(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHFREE((*branchfree)))
Definition: scip.c:8306
#define BMSclearMemoryArray(ptr, num)
Definition: memory.h:85
SCIP_RETCODE SCIPcomputeLPRelIntPoint(SCIP *scip, SCIP_Bool relaxrows, SCIP_Bool inclobjcutoff, SCIP_Real timelimit, int iterlimit, SCIP_SOL **point)
Definition: scip.c:27348
SCIP_Real SCIPpropGetTime(SCIP_PROP *prop)
Definition: prop.c:1002
#define SCIP_DECL_SEPAEXECLP(x)
Definition: type_sepa.h:115
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
Definition: var.c:16905
static SCIP_RETCODE exitPresolve(SCIP *scip, SCIP_Bool solved, SCIP_Bool *infeasible)
Definition: scip.c:12901
int nimplvars
Definition: struct_prob.h:63
char ** SCIPgetExternalCodeNames(SCIP *scip)
Definition: scip.c:8728
void SCIPclearExternBranchCands(SCIP *scip)
Definition: scip.c:33420
static SCIP_Real getDualbound(SCIP *scip)
Definition: scip.c:496
#define SCIP_DECL_PROBCOPY(x)
Definition: type_prob.h:140
SCIP_Bool probingsolvedlp
Definition: struct_tree.h:221
int limit_maxsol
Definition: struct_set.h:243
SCIP_RETCODE SCIPcomprExec(SCIP_COMPR *compr, SCIP_SET *set, SCIP_REOPT *reopt, SCIP_RESULT *result)
Definition: compr.c:252
enum SCIP_NlpParam SCIP_NLPPARAM
Definition: type_nlpi.h:56
SCIP_RETCODE SCIProwCreate(SCIP_ROW **row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_ROWORIGINTYPE origintype, void *origin, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: lp.c:4894
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:24914
SCIP_RETCODE SCIPsetMessagehdlr(SCIP *scip, SCIP_MESSAGEHDLR *messagehdlr)
Definition: scip.c:1181
int SCIPconshdlrGetStartNActiveConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4601
internal methods for handling parameter settings
void SCIPpropSetInitsol(SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
Definition: prop.c:800
SCIP_PROB * transprob
Definition: struct_scip.h:82
SCIP_Bool SCIPrelaxationIsSolValid(SCIP_RELAXATION *relaxation)
Definition: relax.c:631
SCIP_RETCODE SCIPaddRowDive(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31804
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2116
int SCIPgetNActiveConss(SCIP *scip)
Definition: scip.c:38296
SCIP_SEPA ** SCIPgetSepas(SCIP *scip)
Definition: scip.c:6811
int npresolroundsext
Definition: struct_stat.h:192
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
Definition: lp.c:18881
SCIP_Bool conf_enable
Definition: struct_set.h:173
SCIP_RETCODE SCIPincludeBranchrule(SCIP *scip, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_DECL_BRANCHCOPY((*branchcopy)), SCIP_DECL_BRANCHFREE((*branchfree)), SCIP_DECL_BRANCHINIT((*branchinit)), SCIP_DECL_BRANCHEXIT((*branchexit)), SCIP_DECL_BRANCHINITSOL((*branchinitsol)), SCIP_DECL_BRANCHEXITSOL((*branchexitsol)), SCIP_DECL_BRANCHEXECLP((*branchexeclp)), SCIP_DECL_BRANCHEXECEXT((*branchexecext)), SCIP_DECL_BRANCHEXECPS((*branchexecps)), SCIP_BRANCHRULEDATA *branchruledata)
Definition: scip.c:8205
SCIP_Bool SCIPsetIsNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5314
SCIP_RETCODE SCIPcutoffNode(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:37116
SCIP_NODE ** siblings
Definition: struct_tree.h:181
SCIP_PRESOL ** presols
Definition: struct_set.h:70
void SCIPconflicthdlrSetExitsol(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)))
Definition: conflict.c:695
methods for creating output for visualization tools (VBC, BAK)
SCIP_CLOCK * copyclock
Definition: struct_stat.h:131
#define BMSgarbagecollectBlockMemory(mem)
Definition: memory.h:426
SCIP_RETCODE SCIPadjustImplicitSolVals(SCIP *scip, SCIP_SOL *sol, SCIP_Bool uselprows)
Definition: scip.c:35354
nodereopt branching rule
#define SCIP_LONGINT_MAX
Definition: def.h:113
#define SCIP_DECL_BRANCHEXITSOL(x)
Definition: type_branch.h:98
SCIP_RETCODE SCIPsetNodeselExit(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXIT((*nodeselexit)))
Definition: scip.c:8076
SCIP_Bool SCIPconshdlrNeedsCons(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4781
SCIP_Bool SCIPhasNLPSolution(SCIP *scip)
Definition: scip.c:28885
SCIP_Real SCIPcomprGetSetupTime(SCIP_COMPR *compr)
Definition: compr.c:493
SCIP_RETCODE SCIPsolClear(SCIP_SOL *sol, SCIP_STAT *stat, SCIP_TREE *tree)
Definition: sol.c:917
SCIP_RETCODE SCIPwriteParam(SCIP *scip, SCIP_PARAM *param, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: scip.c:4272
int SCIPgetNContVars(SCIP *scip)
Definition: scip.c:10878
int SCIPpresolGetNAddConss(SCIP_PRESOL *presol)
Definition: presol.c:731
SCIP_RETCODE SCIPincludeRelax(SCIP *scip, const char *name, const char *desc, int priority, int freq, SCIP_DECL_RELAXCOPY((*relaxcopy)), SCIP_DECL_RELAXFREE((*relaxfree)), SCIP_DECL_RELAXINIT((*relaxinit)), SCIP_DECL_RELAXEXIT((*relaxexit)), SCIP_DECL_RELAXINITSOL((*relaxinitsol)), SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), SCIP_DECL_RELAXEXEC((*relaxexec)), SCIP_RELAXDATA *relaxdata)
Definition: scip.c:6380
SCIP_Longint SCIPgetNNodeInitLPIterations(SCIP *scip)
Definition: scip.c:37785
int SCIPptrarrayGetMinIdx(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:3784
SCIP_RETCODE SCIPnlpGetIntPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, int *ival)
Definition: nlp.c:5975
SCIP_RETCODE SCIPincludeRelaxBasic(SCIP *scip, SCIP_RELAX **relaxptr, const char *name, const char *desc, int priority, int freq, SCIP_DECL_RELAXEXEC((*relaxexec)), SCIP_RELAXDATA *relaxdata)
Definition: scip.c:6423
SCIP_RETCODE SCIPaddConflictRelaxedBd(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd)
Definition: scip.c:24539
SCIP_RETCODE SCIPchgRowRhs(SCIP *scip, SCIP_ROW *row, SCIP_Real rhs)
Definition: scip.c:27783
static void printCompressionStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39857
SCIP_RELAX ** relaxs
Definition: struct_set.h:71
SCIP_RETCODE SCIPsetConsPropagated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool propagate)
Definition: scip.c:25147
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
Definition: cons.c:7839
SCIP_RETCODE SCIPvarUpdatePseudocost(SCIP_VAR *var, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
Definition: var.c:13630
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
Definition: cons.c:7779
SCIP_Real SCIPconflictGetGlobalApplTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:4273
SCIP_RETCODE SCIPaddVarBranchPriority(SCIP *scip, SCIP_VAR *var, int addpriority)
Definition: scip.c:22561
enum SCIP_LPSolStat SCIP_LPSOLSTAT
Definition: type_lp.h:42
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
Definition: scip.c:26237
SCIP_CUTPOOL * SCIPgetDelayedGlobalCutpool(SCIP *scip)
Definition: scip.c:31411
SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible)
Definition: scip.c:30967
SCIP_DIVESET ** SCIPheurGetDivesets(SCIP_HEUR *heur)
Definition: heur.c:1345
SCIP_VAR ** SCIPgetOrigVars(SCIP *scip)
Definition: scip.c:11111
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
Definition: scip.c:6718
void SCIPvarAdjustLb(SCIP_VAR *var, SCIP_SET *set, SCIP_Real *lb)
Definition: var.c:6014
SCIP_RETCODE SCIPaddReoptnodeBndchg(SCIP *scip, SCIP_REOPTNODE *reoptnode, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE boundtype)
Definition: scip.c:15060
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip.c:24949
#define SCIP_DECL_PROPEXEC(x)
Definition: type_prop.h:202
SCIP_RETCODE SCIPsetBranchruleExecPs(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECPS((*branchexecps)))
Definition: scip.c:8420
SCIP_RETCODE SCIPgetLeaves(SCIP *scip, SCIP_NODE ***leaves, int *nleaves)
Definition: scip.c:36931
int maxdepth
Definition: struct_stat.h:183
BMS_BUFMEM * SCIPbuffer(SCIP *scip)
Definition: scip.c:41368
SCIP_RETCODE SCIPcutpoolFree(SCIP_CUTPOOL **cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: cutpool.c:441
SCIP_RETCODE SCIPincludeNodeselBasic(SCIP *scip, SCIP_NODESEL **nodesel, const char *name, const char *desc, int stdpriority, int memsavepriority, SCIP_DECL_NODESELSELECT((*nodeselselect)), SCIP_DECL_NODESELCOMP((*nodeselcomp)), SCIP_NODESELDATA *nodeseldata)
Definition: scip.c:7992
SCIP_Real SCIPgetColFarkasCoef(SCIP *scip, SCIP_COL *col)
Definition: scip.c:27427
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
Definition: sepa.c:633
SCIP_RETCODE SCIPvarChgBranchDirection(SCIP_VAR *var, SCIP_BRANCHDIR branchdirection)
Definition: var.c:11083
SCIP_Real SCIPhistoryGetAvgCutoffs(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:668
#define SCIP_DECL_PRICERCOPY(x)
Definition: type_pricer.h:46
SCIP_CONS * SCIPconsGetTransformed(SCIP_CONS *cons)
Definition: cons.c:6369
void SCIPvisualExit(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: visual.c:176
SCIP_RETCODE SCIPcreateIntarray(SCIP *scip, SCIP_INTARRAY **intarray)
Definition: scip.c:42624
SCIP_Real SCIPgetVarConflictScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23676
static void printLPStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39887
SCIP_Real SCIPgetOrigObjscale(SCIP *scip)
Definition: scip.c:10116
SCIP_Bool branch_forceall
Definition: struct_set.h:153
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: scip.c:4625
#define SCIP_LONGINT_MIN
Definition: def.h:114
SCIP_HEUR * SCIPgetSolHeur(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:35306
int SCIPgetNSepas(SCIP *scip)
Definition: scip.c:6824
SCIP_Longint SCIPconflictGetNStrongbranchReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:6737
SCIP_RETCODE SCIPcopyProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, const char *name)
Definition: scip.c:1667
#define SCIP_DECL_DIVESETGETSCORE(x)
Definition: type_heur.h:146
void SCIPdisableDebugSol(SCIP *scip)
Definition: scip.c:1156
SCIP_Real SCIPconflictGetPseudoTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:6911
SCIP_CLOCK * nlpsoltime
Definition: struct_stat.h:130
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip.c:26482
SCIP_Real SCIPvarGetBranchFactor(SCIP_VAR *var)
Definition: var.c:17217
SCIP_RETCODE SCIPvarRemoveCliquesImplicsVbs(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_CLIQUETABLE *cliquetable, SCIP_SET *set, SCIP_Bool irrelevantvar, SCIP_Bool onlyredundant, SCIP_Bool removefromvar)
Definition: var.c:1536
int SCIPbranchcandGetNPrioExternInts(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:487
SCIP_RETCODE SCIPnlrowChgQuadElem(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_QUADELEM elem)
Definition: nlp.c:2646
void SCIPstatReset(SCIP_STAT *stat, SCIP_SET *set)
Definition: stat.c:170
int SCIPreoptGetLastRestarts(SCIP_REOPT *reopt)
Definition: reopt.c:3876
SCIP_Real SCIPgetVarMultaggrLbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21448
#define SCIP_DECL_NODESELEXITSOL(x)
Definition: type_nodesel.h:94
#define SCIP_DECL_CONFLICTEXIT(x)
Definition: type_conflict.h:76
SCIP_Longint SCIPconflictGetNInfeasibleLPConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:6319
#define SCIP_DECL_COMPRINIT(x)
Definition: type_compr.h:65
SCIP_Longint SCIPconflictGetNPropReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:4333
SCIP_Real SCIPgetRowMaxCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28063
SCIP_LPSOLSTAT SCIPlpGetSolstat(SCIP_LP *lp)
Definition: lp.c:15060
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip.h:20554
SCIP_VISUAL * visual
Definition: struct_stat.h:137
SCIP_RETCODE SCIPaddDialogHistoryLine(SCIP *scip, const char *inputline)
Definition: scip.c:8948
int SCIPpresolGetPriority(SCIP_PRESOL *presol)
Definition: presol.c:573
SCIP_Real SCIPsetCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5378
int lastnpresoladdconss
Definition: struct_stat.h:209
SCIP_RETCODE SCIPstartDive(SCIP *scip)
Definition: scip.c:31575
SCIP_Real SCIPgetAvgPseudocostCountCurrentRun(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:38870
#define SCIP_DECL_EVENTEXEC(x)
Definition: type_event.h:226
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
Definition: scip.c:42044
SCIP_Longint SCIPcolGetStrongbranchLPAge(SCIP_COL *col, SCIP_STAT *stat)
Definition: lp.c:4532
SCIP_Real SCIPsetGetHugeValue(SCIP_SET *set)
Definition: set.c:5054
SCIP_Real dualzeroittime
Definition: struct_stat.h:102
#define SCIP_DECL_CONSINITLP(x)
Definition: type_cons.h:210
internal methods for LP management
SCIP_Bool SCIPsetIsFeasFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5732
int SCIPbranchcandGetNPrioPseudoCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:812
void SCIPsetSortHeursName(SCIP_SET *set)
Definition: set.c:3847
SCIP_Bool SCIPallColsInLP(SCIP *scip)
Definition: scip.c:26829
int nbranchrules
Definition: struct_set.h:111
SCIP_RETCODE SCIPaddCurrentSol(SCIP *scip, SCIP_HEUR *heur, SCIP_Bool *stored)
Definition: scip.c:36177
int SCIPcutpoolGetMaxNCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:864
SCIP_PROB * origprob
Definition: struct_scip.h:65
#define SCIP_DECL_EVENTFREE(x)
Definition: type_event.h:164
SCIP_RETCODE SCIPcalcRowIntegralScalar(SCIP *scip, SCIP_ROW *row, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Bool usecontvars, SCIP_Real *intscalar, SCIP_Bool *success)
Definition: scip.c:27974
SCIP_Bool SCIPtreeIsFocusNodeLPConstructed(SCIP_TREE *tree)
Definition: tree.c:7920
SCIP_RETCODE SCIPsetBoolarrayVal(SCIP *scip, SCIP_BOOLARRAY *boolarray, int idx, SCIP_Bool val)
Definition: scip.c:42860
SCIP_Longint nexternalsolsfound
Definition: struct_stat.h:80
void SCIPstatEnforceLPUpdates(SCIP_STAT *stat)
Definition: stat.c:501
SCIP_Real SCIPconflictGetVarUb(SCIP_CONFLICT *conflict, SCIP_VAR *var)
Definition: conflict.c:3284
SCIP_RETCODE SCIPgetNLPFracVars(SCIP *scip, SCIP_VAR ***fracvars, SCIP_Real **fracvarssol, SCIP_Real **fracvarsfrac, int *nfracvars, int *npriofracvars)
Definition: scip.c:28910
#define SCIP_DECL_DISPCOPY(x)
Definition: type_disp.h:62
int SCIPgetIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx)
Definition: scip.c:42693
int SCIPreoptGetNTotalInfNodes(SCIP_REOPT *reopt)
Definition: reopt.c:3956
SCIP_Real SCIPconshdlrGetRespropTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4441
int SCIPgetNParams(SCIP *scip)
Definition: scip.c:4491
SCIP_Bool SCIPlpIsRootLPRelax(SCIP_LP *lp)
Definition: lp.c:19306
SCIP_Real SCIPhistoryGetPseudocost(SCIP_HISTORY *history, SCIP_Real solvaldelta)
Definition: history.c:423
SCIP_RETCODE SCIPnlrowChgLhs(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real lhs)
Definition: nlp.c:2782
SCIP_Real SCIPgetAvgInferencesCurrentRun(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:39055
SCIP_Bool objsqrnormunreliable
Definition: struct_lp.h:328
#define SCIP_PRESOLTIMING_FAST
Definition: type_timing.h:43
SCIP_RETCODE SCIPlpRecordOldRowSideDive(SCIP_LP *lp, SCIP_ROW *row, SCIP_SIDETYPE sidetype)
Definition: lp.c:17943
SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
Definition: scip.c:42255
SCIP_RETCODE SCIPgetLPBInvCol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:26929
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
Definition: scip.c:5359
static void printConstraintStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39444
SCIP_RETCODE SCIPsetSepaInitsol(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAINITSOL((*sepainitsol)))
Definition: scip.c:6766
int SCIPrealarrayGetMinIdx(SCIP_REALARRAY *realarray)
Definition: misc.c:2711
int SCIPpresolGetNAddHoles(SCIP_PRESOL *presol)
Definition: presol.c:711
SCIP_RETCODE SCIPnlrowGetNLPFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *feasibility)
Definition: nlp.c:2942
SCIP_RETCODE SCIPsetIncludeSepa(SCIP_SET *set, SCIP_SEPA *sepa)
Definition: set.c:3622
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
Definition: cons.c:7769
SCIP_Real SCIPgetLowerbound(SCIP *scip)
Definition: scip.c:38393
SCIP_Real SCIPconshdlrGetStrongBranchPropTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4421
SCIP_Longint SCIPconshdlrGetNEnfoPSCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4471
SCIP_RETCODE SCIPconsResetAge(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6787
SCIP_RETCODE SCIPsetPricerExitsol(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICEREXITSOL((*pricerexitsol)))
Definition: scip.c:4964
SCIP_RETCODE SCIPresetClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:40784
internal methods for branching and inference history
SCIP_RETCODE SCIPrecalcNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:30012
int SCIPpresolGetNChgBds(SCIP_PRESOL *presol)
Definition: presol.c:701
int SCIPgetNPricevars(SCIP *scip)
Definition: scip.c:37927
SCIP_Real SCIPgetLPRootObjval(SCIP *scip)
Definition: scip.c:26607
SCIP_RETCODE SCIPconsActive(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:7382
void SCIPpropSetPriority(SCIP_PROP *prop, SCIP_SET *set, int priority)
Definition: prop.c:927
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
Definition: scip.c:26672
SCIP_RETCODE SCIPcreatePseudoSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:34134
SCIP_RETCODE SCIPgetStringParam(SCIP *scip, const char *name, char **value)
Definition: scip.c:3835
int nrootintfixings
Definition: struct_stat.h:171
SCIP_RETCODE SCIPaddOrigObjoffset(SCIP *scip, SCIP_Real addval)
Definition: scip.c:10062
SCIP_RETCODE SCIPsetIncludeCompr(SCIP_SET *set, SCIP_COMPR *compr)
Definition: set.c:3862
SCIP_RETCODE SCIPinferVarUbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:20572
SCIP_Real SCIPvarGetAggrConstant(SCIP_VAR *var)
Definition: var.c:16814
SCIP_Real SCIPconflictGetStrongbranchTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:6677
SCIP_Real SCIPgetAvgInferenceScore(SCIP *scip)
Definition: scip.c:39073
SCIP_RETCODE SCIPsetSetStringParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, const char *value)
Definition: set.c:2948
SCIP_DIALOG * SCIPgetRootDialog(SCIP *scip)
Definition: scip.c:8896
SCIP_Longint SCIPconflictGetNAppliedLocalLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:2442
SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
Definition: scip.c:12363
SCIP_RETCODE SCIPgetNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip.c:30040
SCIP_Real SCIPpropGetSetupTime(SCIP_PROP *prop)
Definition: prop.c:980
internal methods for collecting primal CIP solutions and primal informations
SCIP_Real SCIPsolGetVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var)
Definition: sol.c:1245
void SCIPupdateDivesetStats(SCIP *scip, SCIP_DIVESET *diveset, int nprobingnodes, int nbacktracks, SCIP_Longint nsolsfound, SCIP_Longint nbestsolsfound, SCIP_Bool leavewassol)
Definition: scip.c:32938
#define SCIP_DECL_COMPRFREE(x)
Definition: type_compr.h:57
SCIP_Longint SCIPconflictGetNPseudoConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:6941
SCIP_Real SCIPcomputeVarLbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21365
SCIP_RETCODE SCIPcheckSolOrig(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *feasible, SCIP_Bool printreason, SCIP_Bool completely)
Definition: scip.c:36470
SCIP_Bool reopt_enable
Definition: struct_set.h:398
SCIP_Real SCIPconshdlrGetEnfoLPTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4391
int SCIPreoptGetNInfSubtrees(SCIP_REOPT *reopt)
Definition: reopt.c:3966
SCIP_RETCODE SCIPaddPricedVar(SCIP *scip, SCIP_VAR *var, SCIP_Real score)
Definition: scip.c:10443
SCIP_Bool SCIPpscostThresholdProbabilityTest(SCIP *scip, SCIP_VAR *var, SCIP_Real frac, SCIP_Real threshold, SCIP_BRANCHDIR dir, SCIP_CONFIDENCELEVEL clevel)
Definition: scip.c:23463
SCIP_CONSSETCHG * addconssetchg
Definition: struct_cons.h:47
enum SCIP_ParamSetting SCIP_PARAMSETTING
Definition: type_paramset.h:56
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:35066
SCIP_RETCODE SCIPcopyCuts(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip.c:2883
void SCIPpricerSetPriority(SCIP_PRICER *pricer, SCIP_SET *set, int priority)
Definition: pricer.c:580
void SCIPprobSetObjIntegral(SCIP_PROB *prob)
Definition: prob.c:1418
SCIP_Real SCIPdualfeasRound(SCIP *scip, SCIP_Real val)
Definition: scip.c:42229
SCIP_RETCODE SCIPboolarraySetVal(SCIP_BOOLARRAY *boolarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Bool val)
Definition: misc.c:3363
SCIP_CUT ** SCIPcutpoolGetCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:844
SCIP_Longint nsblpiterations
Definition: struct_stat.h:61
SCIP_EVENTHDLR * SCIPfindEventhdlr(SCIP *scip, const char *name)
Definition: scip.c:7908
#define SCIP_DECL_NODESELINIT(x)
Definition: type_nodesel.h:64
int SCIPlpGetNCols(SCIP_LP *lp)
Definition: lp.c:19178
SCIP_Real primalzeroittime
Definition: struct_stat.h:101
SCIP_RETCODE SCIPendDiveNLP(SCIP *scip)
Definition: scip.c:29214
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
Definition: scip.c:24720
SCIP_DISP ** SCIPgetDisps(SCIP *scip)
Definition: scip.c:8573
#define BMSdisplayMemory()
Definition: memory.h:109
SCIP_RETCODE SCIPchgBoolParam(SCIP *scip, SCIP_PARAM *param, SCIP_Bool value)
Definition: scip.c:3912
SCIP_Real SCIPvarGetUbLP(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:12261
SCIP_Bool SCIPexistsDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip.c:8831
SCIP_Bool SCIPdoNotMultaggr(SCIP *scip)
Definition: scip.c:23060
SCIP_NODE * SCIPgetBestLeaf(SCIP *scip)
Definition: scip.c:37034
int nrootboundchgs
Definition: struct_stat.h:169
SCIP_RETCODE SCIPsetSetFeastol(SCIP_SET *set, SCIP_Real feastol)
Definition: set.c:4812
SCIP_RETCODE SCIPsolveProbingLPWithPricing(SCIP *scip, SCIP_Bool pretendroot, SCIP_Bool displayinfo, int maxpricerounds, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:32812
SCIP_DIALOGHDLR * dialoghdlr
Definition: struct_scip.h:59
void SCIPdialogCapture(SCIP_DIALOG *dialog)
Definition: dialog.c:887
SCIP_RETCODE SCIPchgVarLbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:31740
SCIP_RETCODE SCIPaddNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:28658
#define SCIP_DECL_VARDELTRANS(x)
Definition: type_var.h:140
int SCIPgetNSols(SCIP *scip)
Definition: scip.c:35668
SCIP_RETCODE SCIPsetAddCharParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, char *valueptr, SCIP_Bool isadvanced, char defaultvalue, const char *allowedvalues, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: set.c:2527
#define SCIP_DECL_SEPACOPY(x)
Definition: type_sepa.h:47
int neventhdlrs
Definition: struct_set.h:107
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5274
SCIP_HISTORY * glbhistorycrun
Definition: struct_stat.h:135
internal methods for propagators
int SCIPreoptGetNNodes(SCIP_REOPT *reopt, SCIP_NODE *node)
Definition: reopt.c:4581
BMS_BUFMEM * SCIPcleanbuffer(SCIP *scip)
Definition: scip.c:41382
SCIP_Real SCIPpropGetPresolTime(SCIP_PROP *prop)
Definition: prop.c:1032
const char * SCIPpricerGetName(SCIP_PRICER *pricer)
Definition: pricer.c:550
SCIP_RETCODE SCIPseparateCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_RESULT *result)
Definition: scip.c:31281
SCIP_RETCODE SCIPparseVarsList(SCIP *scip, const char *str, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize, char **endptr, char delimiter, SCIP_Bool *success)
Definition: scip.c:16233
SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
Definition: scip.c:5383
SCIP_Longint SCIPgetNTotalNodes(SCIP *scip)
Definition: scip.c:37399
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip.c:3547
SCIP_RETCODE SCIPcreateEmptyRowUnspec(SCIP *scip, SCIP_ROW **row, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip.c:27658
SCIP_Real SCIPgetVarPseudocostCountCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23354
SCIP_RETCODE SCIPincIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx, int incval)
Definition: scip.c:42728
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
Definition: var.c:16562
SCIP_RETCODE SCIPprimalAddCurrentSol(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_HEUR *heur, SCIP_Bool *stored)
Definition: primal.c:1224
SCIP_RETCODE SCIPchgDualfeastol(SCIP *scip, SCIP_Real dualfeastol)
Definition: scip.c:41261
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2159
int SCIPtreeGetFocusDepth(SCIP_TREE *tree)
Definition: tree.c:7882
SCIP_Real SCIPcalculatePscostConfidenceBound(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun, SCIP_CONFIDENCELEVEL clevel)
Definition: scip.c:23402
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
Definition: scip.c:16156
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip.c:3573
SCIP_RETCODE SCIPcleanupCliques(SCIP *scip, SCIP_Bool *infeasible)
Definition: scip.c:22065
SCIP_Real SCIPvarGetVSIDSCurrentRun(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15130
SCIP_NLPI ** nlpis
Definition: struct_set.h:82
SCIP_Bool SCIPdoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23070
SCIP_Real dualbound
Definition: struct_prob.h:44
void SCIPclockSetTime(SCIP_CLOCK *clck, SCIP_Real sec)
Definition: clock.c:518
SCIP_BOUNDCHG * SCIPdomchgGetBoundchg(SCIP_DOMCHG *domchg, int pos)
Definition: var.c:16398
SCIP_RETCODE SCIPbranchExecLP(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_SEPASTORE *sepastore, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_Real cutoffbound, SCIP_Bool allowaddcons, SCIP_RESULT *result)
Definition: branch.c:2384
SCIP_RETCODE SCIPcalcStrongCG(SCIP *scip, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *weights, int *inds, int ninds, SCIP_Real scale, SCIP_Real *mircoef, SCIP_Real *mirrhs, SCIP_Real *cutactivity, SCIP_Bool *success, SCIP_Bool *cutislocal, int *cutrank)
Definition: scip.c:27114
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
Definition: scip.c:9077
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
Definition: var.c:16634
SCIP_PRICESTORE * pricestore
Definition: struct_scip.h:85
SCIP_RETCODE SCIPprintNodeRootPath(SCIP *scip, SCIP_NODE *node, FILE *file)
Definition: scip.c:37188
int SCIPgetNReoptLeaves(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:15025
#define SCIP_DECL_DIALOGDESC(x)
Definition: type_dialog.h:73
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: scip.c:4601
void SCIPdivesetUpdateLPStats(SCIP_DIVESET *diveset, SCIP_STAT *stat, SCIP_Longint niterstoadd)
Definition: heur.c:573
SCIP_Bool SCIPsetIsEfficacious(SCIP_SET *set, SCIP_Bool root, SCIP_Real efficacy)
Definition: set.c:6042
int SCIPgetNOrigVars(SCIP *scip)
Definition: scip.c:11138
SCIP_RETCODE SCIPchgLongintParam(SCIP *scip, SCIP_PARAM *param, SCIP_Longint value)
Definition: scip.c:4020
SCIP_RETCODE SCIPcreateRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip.c:27504
SCIP_RETCODE SCIPnlrowAddQuadVar(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_VAR *var)
Definition: nlp.c:2538
SCIP_Real * vals
Definition: struct_lp.h:217
SCIP_RETCODE SCIPprimalUpdateObjlimit(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp)
Definition: primal.c:326
SCIP_RETCODE SCIPpresolCreate(SCIP_PRESOL **presol, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int maxrounds, SCIP_PRESOLTIMING timing, SCIP_DECL_PRESOLCOPY((*presolcopy)), SCIP_DECL_PRESOLFREE((*presolfree)), SCIP_DECL_PRESOLINIT((*presolinit)), SCIP_DECL_PRESOLEXIT((*presolexit)), SCIP_DECL_PRESOLINITPRE((*presolinitpre)), SCIP_DECL_PRESOLEXITPRE((*presolexitpre)), SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
Definition: presol.c:92
SCIP_Real SCIPsolGetTime(SCIP_SOL *sol)
Definition: sol.c:2212
SCIP_Longint SCIPconshdlrGetNDomredsFound(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4571
SCIP_RETCODE SCIPparamCheckBool(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool value)
Definition: paramset.c:4134
SCIP_RETCODE SCIPsetConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_Bool local)
Definition: scip.c:25174
static SCIP_RETCODE initSolve(SCIP *scip, SCIP_Bool solved)
Definition: scip.c:13790
SCIP_Longint SCIPgetNBacktracks(SCIP *scip)
Definition: scip.c:38262
SCIP_RETCODE SCIPanalyzeConflict(SCIP *scip, int validdepth, SCIP_Bool *success)
Definition: scip.c:24689
SCIP_Longint SCIPgetVarStrongbranchLPAge(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19334
SCIP_RETCODE SCIPintarrayFree(SCIP_INTARRAY **intarray)
Definition: misc.c:2774
SCIP_Bool SCIPisUpdateUnreliable(SCIP *scip, SCIP_Real newvalue, SCIP_Real oldvalue)
Definition: scip.c:42455
enum SCIP_BranchDir SCIP_BRANCHDIR
Definition: type_history.h:39
#define SCIP_DECL_CONSINITSOL(x)
Definition: type_cons.h:159
SCIP_Real SCIPsetDualfeasFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5958
SCIP_RETCODE SCIPsetInitPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4341
int SCIPtreeGetNChildren(SCIP_TREE *tree)
Definition: tree.c:7782
SCIP_Real SCIPprobGetObjlim(SCIP_PROB *prob, SCIP_SET *set)
Definition: prob.c:2152
SCIP_RETCODE SCIPaddDialogInputLine(SCIP *scip, const char *inputline)
Definition: scip.c:8931
SCIP_RETCODE SCIPsetConshdlrDeactive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
Definition: scip.c:5680
SCIP_NODE * SCIPtreeGetBestLeaf(SCIP_TREE *tree)
Definition: tree.c:6785
SCIP_RETCODE SCIPsetFree(SCIP_SET **set, BMS_BLKMEM *blkmem)
Definition: set.c:2282
SCIP_RETCODE SCIPenableOrDisableStatisticTiming(SCIP *scip)
Definition: scip.c:40858
SCIP_RETCODE SCIPrealarrayIncVal(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real incval)
Definition: misc.c:2693
int SCIPbranchcandGetNExternCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:457
SCIP_RETCODE SCIPlpCalcStrongCG(SCIP_LP *lp, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *weights, int *rowinds, int nrowinds, SCIP_Real scale, SCIP_Real *strongcgcoef, SCIP_Real *strongcgrhs, SCIP_Real *cutactivity, SCIP_Bool *success, SCIP_Bool *cutislocal, int *cutrank)
Definition: lp.c:12136
SCIP_RETCODE SCIPsetBranchruleExecLp(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
Definition: scip.c:8388
SCIP_Real SCIPgetVarAvgInferenceScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23908
struct SCIP_NodeselData SCIP_NODESELDATA
Definition: type_nodesel.h:38
SCIP_VAR * SCIPvarGetAggrVar(SCIP_VAR *var)
Definition: var.c:16792
int SCIPgetNNLPNlRows(SCIP *scip)
Definition: scip.c:28636
SCIP_RETCODE SCIPsetObjIntegral(SCIP *scip)
Definition: scip.c:10272
void SCIPconflicthdlrSetFree(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTFREE((*conflictfree)))
Definition: conflict.c:651
SCIP_RETCODE SCIPnlpStartDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:6078
SCIP_Real SCIPlpGetRootObjval(SCIP_LP *lp)
Definition: lp.c:19316
SCIP_RETCODE SCIPconsDisableSeparation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6553
SCIP_RETCODE SCIPprobAddConsName(SCIP_PROB *prob, SCIP_CONS *cons)
Definition: prob.c:1197
SCIP_Longint nlexduallpiterations
Definition: struct_stat.h:51
SCIP_RETCODE SCIPsetConsStickingAtNode(SCIP *scip, SCIP_CONS *cons, SCIP_Bool stickingatnode)
Definition: scip.c:25275
SCIP_RETCODE SCIPvarChgLbLocal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_Real newbound)
Definition: var.c:7455
SCIP_RETCODE SCIPsetComprFree(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRFREE((*comprfree)))
Definition: scip.c:7547
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:36622
SCIP_RETCODE SCIPreoptApply(SCIP_REOPT *reopt, SCIP *scip, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, unsigned int randseed, SCIP_REOPTNODE *reoptnode, unsigned int id, SCIP_Real estimate, SCIP_NODE **childnodes, int *ncreatedchilds, int *naddedconss, int childnodessize, SCIP_Bool *success)
Definition: reopt.c:5738
union SCIP_Var::@12 data
int lppos
Definition: struct_lp.h:227
void SCIPprobSetInitsol(SCIP_PROB *prob, SCIP_DECL_PROBINITSOL((*probinitsol)))
Definition: prob.c:361
SCIP_Real SCIPpricerGetSetupTime(SCIP_PRICER *pricer)
Definition: pricer.c:614
void SCIProwForceSort(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:5923
SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5220
void SCIPsetFocusnodeLP(SCIP *scip, SCIP_Bool solvelp)
Definition: scip.c:37284
SCIP_RETCODE SCIPsetReadParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *filename)
Definition: set.c:2963
SCIP_Real SCIPgetAvgPseudocostScoreCurrentRun(SCIP *scip)
Definition: scip.c:38914
SCIP_Real SCIPvarGetObjLP(SCIP_VAR *var)
Definition: var.c:12145
SCIP_CONFLICTHDLR ** SCIPgetConflicthdlrs(SCIP *scip)
Definition: scip.c:6103
SCIP_RETCODE SCIPcopyOrig(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool enablepricing, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip.c:3419
SCIP_RETCODE SCIPbranchcandAddExternCand(SCIP_BRANCHCAND *branchcand, SCIP_SET *set, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
Definition: branch.c:519
SCIP_RETCODE SCIPreoptSplitRoot(SCIP_REOPT *reopt, SCIP_TREE *tree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int randseed, int *ncreatedchilds, int *naddedconss)
Definition: reopt.c:5420
char ** extcodedescs
Definition: struct_set.h:85
SCIP_Real SCIPtreeCalcNodeselPriority(SCIP_TREE *tree, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_BRANCHDIR branchdir, SCIP_Real targetvalue)
Definition: tree.c:4976
SCIP_Real SCIPgetAvgConflictlengthScore(SCIP *scip)
Definition: scip.c:38987
SCIP_Bool SCIPisLPConstructed(SCIP *scip)
Definition: scip.c:26372
#define SCIP_DECL_PRESOLEXEC(x)
Definition: type_presol.h:153
int SCIPcliquetableGetNCliques(SCIP_CLIQUETABLE *cliquetable)
Definition: implics.c:3223
SCIP_CLOCK * strongpropclock
Definition: struct_stat.h:132
SCIP_RETCODE SCIPvarChgType(SCIP_VAR *var, SCIP_VARTYPE vartype)
Definition: var.c:5713
SCIP_RETCODE SCIPprintVar(SCIP *scip, SCIP_VAR *var, FILE *file)
Definition: scip.c:24289
void SCIPprobSetCopy(SCIP_PROB *prob, SCIP_DECL_PROBCOPY((*probcopy)))
Definition: prob.c:383
int npresolchgcoefs
Definition: struct_stat.h:201
SCIP_Bool SCIPsepastoreIsCutApplicable(SCIP_SET *set, SCIP_ROW *cut)
Definition: sepastore.c:1338
SCIP_RETCODE SCIPupdateLocalDualbound(SCIP *scip, SCIP_Real newbound)
Definition: scip.c:12252
SCIP_Bool SCIPnlpHasContinuousNonlinearity(SCIP_NLP *nlp)
Definition: nlp.c:5820
SCIP_RETCODE SCIPsetProbDeltrans(SCIP *scip, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
Definition: scip.c:9139
#define SCIP_DECL_BRANCHINIT(x)
Definition: type_branch.h:68
int npresolchgvartypes
Definition: struct_stat.h:195
#define SCIP_DECL_DISPINIT(x)
Definition: type_disp.h:78
SCIP_RETCODE SCIPincludePricerBasic(SCIP *scip, SCIP_PRICER **pricerptr, const char *name, const char *desc, int priority, SCIP_Bool delay, SCIP_DECL_PRICERREDCOST((*pricerredcost)), SCIP_DECL_PRICERFARKAS((*pricerfarkas)), SCIP_PRICERDATA *pricerdata)
Definition: scip.c:4796
SCIP_RETCODE SCIPreoptGetSolsRun(SCIP_REOPT *reopt, int run, SCIP_SOL **sols, int solssize, int *nsols)
Definition: reopt.c:4339
SCIP_RETCODE SCIPgetBinvarRepresentative(SCIP *scip, SCIP_VAR *var, SCIP_VAR **repvar, SCIP_Bool *negated)
Definition: scip.c:17233
SCIP_Bool SCIPsignificantVarPscostDifference(SCIP *scip, SCIP_VAR *varx, SCIP_Real fracx, SCIP_VAR *vary, SCIP_Real fracy, SCIP_BRANCHDIR dir, SCIP_CONFIDENCELEVEL clevel, SCIP_Bool onesided)
Definition: scip.c:23433
SCIP_RETCODE SCIPnodeFocus(SCIP_NODE **node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_CONFLICT *conflict, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool *cutoff, SCIP_Bool exitsolve)
Definition: tree.c:4128
SCIP_RETCODE SCIPsetPresolExitpre(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
Definition: scip.c:6306
int SCIPconshdlrGetNDelConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4661
SCIP_MEM * mem
Definition: struct_scip.h:56
SCIP_Bool SCIPsetIsSumLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5447
SCIP_RETCODE SCIPreoptSaveOpenNodes(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE **leaves, int nleaves, SCIP_NODE **childs, int nchilds, SCIP_NODE **siblings, int nsiblings)
Definition: reopt.c:5271
SCIP_CONSHDLR * SCIPsetFindConshdlr(SCIP_SET *set, const char *name)
Definition: set.c:3381
SCIP_Real SCIPhistoryGetPseudocostVariance(SCIP_HISTORY *history, SCIP_BRANCHDIR direction)
Definition: history.c:437
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip)
Definition: scip.c:24342
SCIP_Real SCIPvarGetImplRedcost(SCIP_VAR *var, SCIP_SET *set, SCIP_Bool varfixing, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_LP *lp)
Definition: var.c:12723
int SCIPgetNConss(SCIP *scip)
Definition: scip.c:11736
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41585
SCIP_Bool SCIPtreeProbing(SCIP_TREE *tree)
Definition: tree.c:7839
SCIP_RETCODE SCIPprobPerformVarDeletions(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand)
Definition: prob.c:1022
int nsiblings
Definition: struct_tree.h:203
SCIP_Bool SCIPvarIsOriginal(SCIP_VAR *var)
Definition: var.c:16572
SCIP_RETCODE SCIPcopyParamSettings(SCIP *sourcescip, SCIP *targetscip)
Definition: scip.c:3164
#define SCIP_DECL_RELAXEXIT(x)
Definition: type_relax.h:71
static SCIP_RETCODE copyVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool original, SCIP_Bool global)
Definition: scip.c:2010
SCIP_RETCODE SCIPsetIncludeHeur(SCIP_SET *set, SCIP_HEUR *heur)
Definition: set.c:3788
SCIP_RETCODE SCIPgetNLPNlRowsData(SCIP *scip, SCIP_NLROW ***nlrows, int *nnlrows)
Definition: scip.c:28586
SCIP_RETCODE SCIPchgRowRhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newrhs)
Definition: scip.c:31876
void SCIPconshdlrSetExitsol(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
Definition: cons.c:4037
SCIP_RETCODE SCIPresetParam(SCIP *scip, const char *name)
Definition: scip.c:4317
SCIP_RETCODE SCIPsetChgIntParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, int value)
Definition: set.c:2759
SCIP_RETCODE SCIPreadProb(SCIP *scip, const char *filename, const char *extension)
Definition: scip.c:9236
void SCIPpropSetExit(SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
Definition: prop.c:789
SCIP_Real barrierzeroittime
Definition: struct_stat.h:103
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
Definition: var.c:16585
SCIP_Real lb
Definition: struct_lp.h:126
static void printConstraintTimingStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39491
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:25560
SCIP_Bool SCIPsetIsParamFixed(SCIP_SET *set, const char *name)
Definition: set.c:2572
int cutoffdepth
Definition: struct_tree.h:209
SCIP_RETCODE SCIPgetVarCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR *sourcevar, SCIP_VAR **targetvar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *success)
Definition: scip.c:1781
SCIP_RETCODE SCIProwCatchEvent(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: lp.c:7480
SCIP_RETCODE SCIPvarsGetProbvarBinary(SCIP_VAR ***vars, SCIP_Bool **negatedarr, int nvars)
Definition: var.c:11541
enum SCIP_Confidencelevel SCIP_CONFIDENCELEVEL
Definition: type_misc.h:44
int lastnpresolfixedvars
Definition: struct_stat.h:203
SCIP_Real SCIPgetAvgDualbound(SCIP *scip)
Definition: scip.c:38331
SCIP_RETCODE SCIPvarChgBranchPriority(SCIP_VAR *var, int branchpriority)
Definition: var.c:10953
void SCIPnodeUpdateLowerbound(SCIP_NODE *node, SCIP_STAT *stat, SCIP_SET *set, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_Real newbound)
Definition: tree.c:2258
SCIP_Real SCIPvarGetPseudocost(SCIP_VAR *var, SCIP_STAT *stat, SCIP_Real solvaldelta)
Definition: var.c:13708
SCIP_RETCODE SCIPresetRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip.c:15198
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
Definition: scip.c:15442
#define SCIP_DECL_CONSPRINT(x)
Definition: type_cons.h:682
SCIP_RETCODE SCIPprobRemoveVarName(SCIP_PROB *prob, SCIP_VAR *var)
Definition: prob.c:878
void SCIPrelaxSetFree(SCIP_RELAX *relax, SCIP_DECL_RELAXFREE((*relaxfree)))
Definition: relax.c:386
SCIP_Longint SCIPconshdlrGetNCutoffs(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4511
void SCIPprobSetObjsense(SCIP_PROB *prob, SCIP_OBJSENSE objsense)
Definition: prob.c:1370
void SCIPeventhdlrSetInitsol(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINITSOL((*eventinitsol)))
Definition: event.c:353
SCIP_RETCODE SCIPcutpoolDelRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_ROW *row)
Definition: cutpool.c:641
SCIP_RETCODE SCIPconshdlrGetDiveBoundChanges(SCIP_CONSHDLR *conshdlr, SCIP_SET *set, SCIP_DIVESET *diveset, SCIP_SOL *sol, SCIP_Bool *success, SCIP_Bool *infeasible)
Definition: cons.c:3242
SCIP_RETCODE SCIPnlpAddVars(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, int nvars, SCIP_VAR **vars)
Definition: nlp.c:5302
SCIP_RETCODE SCIPconstructLP(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:26395
int SCIPpropGetNPresolCalls(SCIP_PROP *prop)
Definition: prop.c:1212
SCIP_RETCODE SCIPconsEnablePropagation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6581
SCIP_Bool SCIPsetIsSumRelGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6255
#define SCIP_DECL_CONFLICTINITSOL(x)
Definition: type_conflict.h:87
SCIP_Real SCIPsolGetObj(SCIP_SOL *sol, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: sol.c:1438
SCIP_Longint npssolsfound
Definition: struct_stat.h:78
int SCIPconshdlrGetNChgSides(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4701
SCIP_RETCODE SCIPfreeBoolarray(SCIP *scip, SCIP_BOOLARRAY **boolarray)
Definition: scip.c:42792
SCIP_RETCODE SCIPchgNlRowConstant(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real constant)
Definition: scip.c:29540
SCIP_RETCODE SCIPrelaxationCreate(SCIP_RELAXATION **relaxation)
Definition: relax.c:573
void SCIPpricerSetCopy(SCIP_PRICER *pricer, SCIP_DECL_PRICERCOPY((*pricercopy)))
Definition: pricer.c:484
SCIP_Real SCIPgetDualbound(SCIP *scip)
Definition: scip.c:38372
int SCIPgetNCutsFound(SCIP *scip)
Definition: scip.c:37997
#define SCIP_PRESOLTIMING_MEDIUM
Definition: type_timing.h:44
SCIP_RETCODE SCIPlpStartDive(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:17660
SCIP_RETCODE SCIPincludeBranchruleBasic(SCIP *scip, SCIP_BRANCHRULE **branchruleptr, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_BRANCHRULEDATA *branchruledata)
Definition: scip.c:8253
SCIP_RETCODE SCIPsetSetSubscipsOff(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: set.c:3039
SCIP_Bool probingobjchanged
Definition: struct_tree.h:223
SCIP_Longint SCIPconflictGetNInfeasibleLPConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:6309
SCIP_Real sbdown
Definition: struct_lp.h:141
static void printPropagatorStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39539
SCIP_RETCODE SCIPclearCuts(SCIP *scip)
Definition: scip.c:31502
git hash methods
int SCIPpricestoreGetNVarsApplied(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:665
SCIP_RETCODE SCIPcheckSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *feasible)
Definition: scip.c:36424
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:41984
SCIP_RETCODE SCIProwChgLhs(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_Real lhs)
Definition: lp.c:5429
static void printSolutionStatistics(SCIP *scip, FILE *file)
Definition: scip.c:40065
void SCIPsetSetPriorityNlpi(SCIP_SET *set, SCIP_NLPI *nlpi, int priority)
Definition: set.c:4295
void SCIPsetReinsertConshdlrSepaPrio(SCIP_SET *set, SCIP_CONSHDLR *conshdlr, int oldpriority)
Definition: set.c:3296
int misc_permutationseed
Definition: struct_set.h:315
#define SCIP_DECL_BRANCHCOPY(x)
Definition: type_branch.h:52
SCIP_RETCODE SCIPcopy(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip.c:3254
SCIP_Longint SCIPgetNDualResolveLPs(SCIP *scip)
Definition: scip.c:37693
SCIP_RETCODE SCIPbranchcandGetExternCands(SCIP_BRANCHCAND *branchcand, SCIP_VAR ***externcands, SCIP_Real **externcandssol, SCIP_Real **externcandsscore, int *nexterncands, int *nprioexterncands, int *nprioexternbins, int *nprioexternints, int *nprioexternimpls)
Definition: branch.c:419
SCIP_NODE * SCIPgetRootNode(SCIP *scip)
Definition: scip.c:36798
#define SCIP_DECL_CONFLICTEXEC(x)
SCIP_Real mincopytime
Definition: struct_stat.h:105
SCIP_RETCODE SCIPrelaxCreate(SCIP_RELAX **relax, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int freq, SCIP_DECL_RELAXCOPY((*relaxcopy)), SCIP_DECL_RELAXFREE((*relaxfree)), SCIP_DECL_RELAXINIT((*relaxinit)), SCIP_DECL_RELAXEXIT((*relaxexit)), SCIP_DECL_RELAXINITSOL((*relaxinitsol)), SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), SCIP_DECL_RELAXEXEC((*relaxexec)), SCIP_RELAXDATA *relaxdata)
Definition: relax.c:87
int SCIPpropGetNAddHoles(SCIP_PROP *prop)
Definition: prop.c:1152
#define SCIP_DECL_CONSDELVARS(x)
Definition: type_cons.h:668
SCIP_PRICER * SCIPfindPricer(SCIP *scip, const char *name)
Definition: scip.c:4980
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:41709
SCIP_RETCODE SCIPeventfilterAdd(SCIP_EVENTFILTER *eventfilter, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: event.c:1715
SCIP_RETCODE SCIPsetCopyPlugins(SCIP_SET *sourceset, SCIP_SET *targetset, SCIP_Bool copyreaders, SCIP_Bool copypricers, SCIP_Bool copyconshdlrs, SCIP_Bool copyconflicthdlrs, SCIP_Bool copypresolvers, SCIP_Bool copyrelaxators, SCIP_Bool copyseparators, SCIP_Bool copypropagators, SCIP_Bool copyheuristics, SCIP_Bool copyeventhdlrs, SCIP_Bool copynodeselectors, SCIP_Bool copybranchrules, SCIP_Bool copydisplays, SCIP_Bool copydialogs, SCIP_Bool copynlpis, SCIP_Bool *allvalid)
Definition: set.c:802
int npresolroundsmed
Definition: struct_stat.h:191
SCIP_RETCODE SCIPchgCutoffboundDive(SCIP *scip, SCIP_Real newcutoffbound)
Definition: scip.c:31669
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
Definition: scip.c:17075
SCIP_Bool SCIProwIsModifiable(SCIP_ROW *row)
Definition: lp.c:19034
void SCIPmessagehdlrSetLogfile(SCIP_MESSAGEHDLR *messagehdlr, const char *filename)
Definition: message.c:377
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
Definition: cons.c:7879
SCIP_CONSHDLR ** SCIPgetConshdlrs(SCIP *scip)
Definition: scip.c:5891
SCIP_RETCODE SCIPgetNlRowPseudoFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudofeasibility)
Definition: scip.c:29990
SCIP_RETCODE SCIPlpWriteMip(SCIP_LP *lp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *fname, SCIP_Bool genericnames, SCIP_Bool origobj, SCIP_OBJSENSE objsense, SCIP_Real objscale, SCIP_Real objoffset, SCIP_Bool lazyconss)
Definition: lp.c:18194
SCIP_Bool SCIPisSumLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41832
SCIP_RETCODE SCIPvarChgUbLazy(SCIP_VAR *var, SCIP_SET *set, SCIP_Real lazyub)
Definition: var.c:6987
SCIP_RETCODE SCIPsetChgBoolParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, SCIP_Bool value)
Definition: set.c:2707
SCIP_CONSHDLR ** conshdlrs_enfo
Definition: struct_set.h:67
SCIP_RETCODE SCIPcutpoolAddNewRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_ROW *row)
Definition: cutpool.c:517
int lastnpresoladdholes
Definition: struct_stat.h:207
void SCIPvarMergeHistories(SCIP_VAR *targetvar, SCIP_VAR *othervar, SCIP_STAT *stat)
Definition: var.c:4191
int prevrunnvars
Definition: struct_stat.h:173
int SCIPgetNSepaRounds(SCIP *scip)
Definition: scip.c:37979
SCIP_DIALOG * SCIPdialoghdlrGetRoot(SCIP_DIALOGHDLR *dialoghdlr)
Definition: dialog.c:425
int SCIPreoptGetFirstRestarts(SCIP_REOPT *reopt)
Definition: reopt.c:3866
SCIP_Real SCIPgetPrimalRayVal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:36516
internal methods for storing and manipulating the main problem
SCIP_RETCODE SCIPwriteParams(SCIP *scip, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: scip.c:4295
SCIP_RETCODE SCIPchgVarObjDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip.c:31699
SCIP_RETCODE SCIPchgVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:20049
SCIP_Real SCIPsetLpfeastol(SCIP_SET *set)
Definition: set.c:5104
void SCIPmessagePrintError(const char *formatstr,...)
Definition: message.c:775
SCIP_RETCODE SCIPconsResprop(SCIP_CONS *cons, SCIP_SET *set, SCIP_VAR *infervar, int inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd, SCIP_RESULT *result)
Definition: cons.c:7266
#define SCIPerrorMessage
Definition: pub_message.h:45
void SCIPmessagePrintVerbInfo(SCIP_MESSAGEHDLR *messagehdlr, SCIP_VERBLEVEL verblevel, SCIP_VERBLEVEL msgverblevel, const char *formatstr,...)
Definition: message.c:662
SCIP_RETCODE SCIPconsTransform(SCIP_CONS *origcons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_CONS **transcons)
Definition: cons.c:6060
SCIP_Longint SCIPsepaGetNCalls(SCIP_SEPA *sepa)
Definition: sepa.c:750
SCIP_NODESEL ** SCIPgetNodesels(SCIP *scip)
Definition: scip.c:8137
int SCIPcutpoolGetNCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:854
SCIP_Real SCIPgetVarAvgCutoffsCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:24105
SCIP_Real SCIPgetVarConflictlengthScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23707
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
Definition: lp.c:18925
#define SCIP_DECL_PRESOLFREE(x)
Definition: type_presol.h:54
SCIP_EVENTFILTER * eventfilter
Definition: struct_scip.h:72
SCIP_Bool SCIPisRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42335
SCIP_RETCODE SCIPgetNLPStatistics(SCIP *scip, SCIP_NLPSTATISTICS *statistics)
Definition: scip.c:28837
SCIP_RETCODE SCIPpresolExec(SCIP_PRESOL *presol, SCIP_SET *set, SCIP_PRESOLTIMING timing, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: presol.c:342
SCIP_RETCODE SCIPprobExitSolve(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_Bool restart)
Definition: prob.c:1823
SCIP_Bool SCIPvarPscostThresholdProbabilityTest(SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_Real frac, SCIP_Real threshold, SCIP_BRANCHDIR dir, SCIP_CONFIDENCELEVEL clevel)
Definition: var.c:14131
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
Definition: scip.c:19526
SCIP_INTERRUPT * interrupt
Definition: struct_scip.h:58
SCIP_Bool SCIPisSumPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:41883
SCIP_RETCODE SCIPsetProbInitsol(SCIP *scip, SCIP_DECL_PROBINITSOL((*probinitsol)))
Definition: scip.c:9160
SCIP_Real SCIPbranchGetBranchingPoint(SCIP_SET *set, SCIP_TREE *tree, SCIP_VAR *var, SCIP_Real suggestion)
Definition: branch.c:2184
SCIP_Longint lpcount
Definition: struct_stat.h:141
SCIP_RETCODE SCIPsetPresolInit(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLINIT((*presolinit)))
Definition: scip.c:6258
SCIP_Real SCIPcalcNodeselPriority(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR branchdir, SCIP_Real targetvalue)
Definition: scip.c:33651
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
Definition: scip.c:25300
SCIP_RETCODE SCIPfixParam(SCIP *scip, const char *name)
Definition: scip.c:3857
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:2476
int SCIPreoptGetNRestartsGlobal(SCIP_REOPT *reopt)
Definition: reopt.c:3836
SCIP_CONS * SCIPprobFindCons(SCIP_PROB *prob, const char *name)
Definition: prob.c:2016
SCIP_RETCODE SCIPtryCurrentSol(SCIP *scip, SCIP_HEUR *heur, SCIP_Bool printreason, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip.c:36380
SCIP_RETCODE SCIPinitConssLP(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_SEPASTORE *sepastore, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool root, SCIP_Bool firstsubtreeinit, SCIP_Bool *cutoff)
Definition: solve.c:1032
#define SCIP_DECL_PRICERFARKAS(x)
Definition: type_pricer.h:165
SCIP_Longint nbestsolsfound
Definition: struct_primal.h:41
SCIP_RETCODE SCIPpropCreate(SCIP_PROP **prop, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming, SCIP_DECL_PROPCOPY((*propcopy)), SCIP_DECL_PROPFREE((*propfree)), SCIP_DECL_PROPINIT((*propinit)), SCIP_DECL_PROPEXIT((*propexit)), SCIP_DECL_PROPINITPRE((*propinitpre)), SCIP_DECL_PROPEXITPRE((*propexitpre)), SCIP_DECL_PROPINITSOL((*propinitsol)), SCIP_DECL_PROPEXITSOL((*propexitsol)), SCIP_DECL_PROPPRESOL((*proppresol)), SCIP_DECL_PROPEXEC((*propexec)), SCIP_DECL_PROPRESPROP((*propresprop)), SCIP_PROPDATA *propdata)
Definition: prop.c:109
SCIP_READER * SCIPfindReader(SCIP *scip, const char *name)
Definition: scip.c:4689
SCIP_Real SCIPgetLowerboundRoot(SCIP *scip)
Definition: scip.c:38438
SCIP_Bool SCIPisObjIntegral(SCIP *scip)
Definition: scip.c:10310
SCIP_Longint SCIPconflictGetNBoundexceedingLPReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:6409
SCIP_RETCODE SCIPstatFree(SCIP_STAT **stat, BMS_BLKMEM *blkmem)
Definition: stat.c:100
SCIP_RETCODE SCIPvarChgObj(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue, SCIP_Real newobj)
Definition: var.c:5764
SCIP_RETCODE SCIPcheckReoptRestart(SCIP *scip, SCIP_NODE *node, SCIP_Bool *restart)
Definition: scip.c:15541
#define SCIP_DECL_COMPRCOPY(x)
Definition: type_compr.h:49
SCIP_Bool misc_resetstat
Definition: struct_set.h:319
SCIP_RETCODE SCIPsetWriteParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: set.c:2977
#define SCIP_DECL_CONSPARSE(x)
Definition: type_cons.h:758
methods for block memory pools and memory buffers
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
Definition: type_nlpi.h:69
SCIP_RETCODE SCIPprintDualSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:35558
SCIP_Real SCIPgetAvgInferences(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:39035
SCIP_Bool SCIPrelaxationIsSolZero(SCIP_RELAXATION *relaxation)
Definition: relax.c:610
SCIP_COL ** cols
Definition: struct_lp.h:215
SCIP_Bool misc_printreason
Definition: struct_set.h:324
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:199
SCIP_Bool SCIPtreeInRepropagation(SCIP_TREE *tree)
Definition: tree.c:7930
SCIP_RETCODE SCIPsolCreateCurrentSol(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_HEUR *heur)
Definition: sol.c:645
SCIP_Real SCIPvarGetAggrScalar(SCIP_VAR *var)
Definition: var.c:16803
SCIP_Bool SCIPisInRestart(SCIP *scip)
Definition: scip.c:15700
SCIP_RETCODE SCIPmergeVariableStatistics(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR **sourcevars, SCIP_VAR **targetvars, int nvars)
Definition: scip.c:2260
SCIP_RETCODE SCIPsetConflicthdlrExit(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTEXIT((*conflictexit)))
Definition: scip.c:6042
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:41996
SCIP_RETCODE SCIPaddDialogEntry(SCIP *scip, SCIP_DIALOG *dialog, SCIP_DIALOG *subdialog)
Definition: scip.c:8910
SCIP_RETCODE SCIPdelDelayedPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31360
SCIP_Bool SCIPsetIsSumRelEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6167
SCIP_RETCODE SCIPpropCons(SCIP *scip, SCIP_CONS *cons, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition: scip.c:26042
SCIP_Longint SCIPgetNStrongbranchLPIterations(SCIP *scip)
Definition: scip.c:37857
SCIP_Longint nconflictlpiterations
Definition: struct_stat.h:63
SCIP_RETCODE SCIPnlpGetRealPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, SCIP_Real *dval)
Definition: nlp.c:6008
SCIP_RETCODE SCIPboolarrayCreate(SCIP_BOOLARRAY **boolarray, BMS_BLKMEM *blkmem)
Definition: misc.c:3096
int SCIPgetNPrioExternBranchBins(SCIP *scip)
Definition: scip.c:33313
SCIP_Real * SCIPgetNLPVarsUbDualsol(SCIP *scip)
Definition: scip.c:28564
SCIP_RETCODE SCIPsetConsRemovable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool removable)
Definition: scip.c:25250
SCIP_RETCODE SCIPcheckCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
Definition: scip.c:25870
SCIP_Bool SCIPsetIsRelEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6057
SCIP_RETCODE SCIPeventqueueCreate(SCIP_EVENTQUEUE **eventqueue)
Definition: event.c:2001
int SCIPgetNPoolCuts(SCIP *scip)
Definition: scip.c:31121
int npresolchgsides
Definition: struct_stat.h:202
SCIP_RETCODE SCIPaddReoptDualBndchg(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound, SCIP_Real oldbound)
Definition: scip.c:14865
#define SCIP_DECL_CONSDEACTIVE(x)
Definition: type_cons.h:621
SCIP_CLOCK * pseudosoltime
Definition: struct_stat.h:127
SCIP_RETCODE SCIPenfopsCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
Definition: scip.c:25898
SCIP_RETCODE SCIPvarRelease(SCIP_VAR **var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: var.c:2752
SCIP_RETCODE SCIPconsProp(SCIP_CONS *cons, SCIP_SET *set, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition: cons.c:7226
SCIP_RETCODE SCIPwriteMIP(SCIP *scip, const char *filename, SCIP_Bool genericnames, SCIP_Bool origobj, SCIP_Bool lazyconss)
Definition: scip.c:27189
SCIP_COL ** SCIPlpGetCols(SCIP_LP *lp)
Definition: lp.c:19168
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:3897
int SCIPcalcHashtableSize(int minsize)
Definition: misc.c:1157
int SCIPgetProbingDepth(SCIP *scip)
Definition: scip.c:32223
SCIP_Bool SCIPdoNotAggr(SCIP *scip)
Definition: scip.c:23050
SCIP_RETCODE SCIPsetSetSeparating(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: set.c:3092
#define SCIP_DECL_PRESOLEXIT(x)
Definition: type_presol.h:70
SCIP_Real SCIPepsilon(SCIP *scip)
Definition: scip.c:41118
SCIP_Bool SCIPsetIsDualfeasIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5934
SCIP_RETCODE SCIPremoveInefficaciousCuts(SCIP *scip)
Definition: scip.c:31521
SCIP_RETCODE SCIPprintBranchingStatistics(SCIP *scip, FILE *file)
Definition: scip.c:40508
void SCIPinterruptRelease(SCIP_INTERRUPT *interrupt)
Definition: interrupt.c:128
int lastnpresolchgbds
Definition: struct_stat.h:206
SCIP_RETCODE SCIPconsDeactive(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:7406
int SCIPgetNPrioExternBranchImpls(SCIP *scip)
Definition: scip.c:33354
SCIP_RETCODE SCIPnlrowGetPseudoActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *pseudoactivity)
Definition: nlp.c:3017
int repropdepth
Definition: struct_tree.h:210
SCIP_Bool SCIPisRelLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42296
int SCIPgetMaxDepth(SCIP *scip)
Definition: scip.c:38214
SCIP_Real SCIPgetVarAvgInferences(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23823
SCIP_Longint SCIPconflictGetNPseudoReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:6961
SCIP_RETCODE SCIPvarChgObjDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newobj)
Definition: var.c:5951
SCIP_RETCODE SCIPaddQuadElementToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_QUADELEM quadelem)
Definition: scip.c:29711
int SCIPsolGetRunnum(SCIP_SOL *sol)
Definition: sol.c:2222
SCIP_Bool misc_allowobjprop
Definition: struct_set.h:333
static SCIP_RETCODE presolve(SCIP *scip, SCIP_Bool *unbounded, SCIP_Bool *infeasible)
Definition: scip.c:13490
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
Definition: scip.c:28407
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41598
unsigned int sbupvalid
Definition: struct_lp.h:178
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
Definition: scip.c:17163
SCIP_Real SCIPrealarrayGetVal(SCIP_REALARRAY *realarray, int idx)
Definition: misc.c:2603
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
Definition: scip.c:5527
SCIP_RETCODE SCIPsepalpCons(SCIP *scip, SCIP_CONS *cons, SCIP_RESULT *result)
Definition: scip.c:25985
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28151
SCIP_Longint nsbupdomchgs
Definition: struct_stat.h:91
SCIP_RETCODE SCIPmarkRelaxSolValid(SCIP *scip)
Definition: scip.c:17861
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:34002
SCIP_HEUR * firstprimalheur
Definition: struct_stat.h:138
char sepa_cutselsubscip
Definition: struct_set.h:426
int SCIPgetNReoptnodes(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:15010
#define SCIP_DECL_BRANCHINITSOL(x)
Definition: type_branch.h:87
SCIP_RETCODE SCIPaddPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31062
SCIP_Real SCIPadjustedVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real ub)
Definition: scip.c:19717
SCIP_Real SCIPvarGetPseudocostCurrentRun(SCIP_VAR *var, SCIP_STAT *stat, SCIP_Real solvaldelta)
Definition: var.c:13757
#define HASHTABLESIZE_FACTOR
Definition: scip.c:1473
#define SCIP_DECL_EVENTINIT(x)
Definition: type_event.h:172
int SCIPnlpGetNNlRows(SCIP_NLP *nlp)
Definition: nlp.c:5888
int SCIPintarrayGetMaxIdx(SCIP_INTARRAY *intarray)
Definition: misc.c:3085
void SCIPstrCopySection(const char *str, char startchar, char endchar, char *token, int size, char **endptr)
Definition: misc.c:8275
SCIP_Real SCIPnlpGetObjval(SCIP_NLP *nlp)
Definition: nlp.c:5538
SCIP_Longint SCIPconshdlrGetNCheckCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4491
SCIP_RETCODE SCIPsolSetVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_VAR *var, SCIP_Real val)
Definition: sol.c:980
#define SCIP_DECL_PROPEXITSOL(x)
Definition: type_prop.h:127
SCIP_RETCODE SCIPreaderCreate(SCIP_READER **reader, const char *name, const char *desc, const char *extension, SCIP_DECL_READERCOPY((*readercopy)), SCIP_DECL_READERFREE((*readerfree)), SCIP_DECL_READERREAD((*readerread)), SCIP_DECL_READERWRITE((*readerwrite)), SCIP_READERDATA *readerdata)
Definition: reader.c:61
SCIP_Real SCIPconshdlrGetCheckTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4431
SCIP_CONSHDLR ** conshdlrs
Definition: struct_set.h:65
SCIP_RETCODE SCIPlpSumRows(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real *weights, SCIP_REALARRAY *sumcoef, SCIP_Real *sumlhs, SCIP_Real *sumrhs)
Definition: lp.c:9459
void SCIPretcodePrintError(SCIP_RETCODE retcode)
Definition: retcode.c:100
const char * SCIPconsGetName(SCIP_CONS *cons)
Definition: cons.c:7620
internal methods for presolvers
SCIP_Longint SCIPconflictGetNAppliedLocalConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:2432
int SCIPcolGetNStrongbranchs(SCIP_COL *col)
Definition: lp.c:18816
SCIP_Longint ninitlpiterations
Definition: struct_stat.h:57
SCIP_Real lhs
Definition: struct_lp.h:192
SCIP_RETCODE SCIPsetNLPInitialGuess(SCIP *scip, SCIP_Real *initialguess)
Definition: scip.c:28708
SCIP_NODE * SCIPgetBestSibling(SCIP *scip)
Definition: scip.c:37018
SCIP_CLOCK * solvingtimeoverall
Definition: struct_stat.h:116
void SCIPsetSortComprs(SCIP_SET *set)
Definition: set.c:3906
int SCIPsepastoreGetNCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1357
SCIP_RETCODE SCIPsetInitsolPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4592
SCIP_RETCODE SCIPvarGetTransformed(SCIP_VAR *origvar, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **transvar)
Definition: var.c:3358
SCIP_NLROW ** SCIPnlpGetNlRows(SCIP_NLP *nlp)
Definition: nlp.c:5878
#define SCIP_DECL_PROPCOPY(x)
Definition: type_prop.h:47
#define SCIPdebugPrintCons(x, y, z)
Definition: pub_message.h:83
SCIP_RETCODE SCIPparseVar(SCIP *scip, SCIP_VAR **var, const char *str, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARCOPY((*varcopy)), SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_VARDATA *vardata, char **endptr, SCIP_Bool *success)
Definition: scip.c:16097
SCIP_RETCODE SCIPincludePresol(SCIP *scip, const char *name, const char *desc, int priority, int maxrounds, SCIP_PRESOLTIMING timing, SCIP_DECL_PRESOLCOPY((*presolcopy)), SCIP_DECL_PRESOLFREE((*presolfree)), SCIP_DECL_PRESOLINIT((*presolinit)), SCIP_DECL_PRESOLEXIT((*presolexit)), SCIP_DECL_PRESOLINITPRE((*presolinitpre)), SCIP_DECL_PRESOLEXITPRE((*presolexitpre)), SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
Definition: scip.c:6148
SCIP_RETCODE SCIPsetSetIntParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, int value)
Definition: set.c:2782
SCIP_RELAX * SCIPsetFindRelax(SCIP_SET *set, const char *name)
Definition: set.c:3572
SCIP_OBJSENSE SCIPgetObjsense(SCIP *scip)
Definition: scip.c:9997
SCIP_RETCODE SCIPnlrowGetSolFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: nlp.c:3148
#define SCIP_DECL_BRANCHEXECLP(x)
Definition: type_branch.h:119
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41907
SCIP_PARAM * SCIPgetParam(SCIP *scip, const char *name)
Definition: scip.c:3724
SCIP_OBJSENSE objsense
Definition: struct_prob.h:76
SCIP_RETCODE SCIPreaderResetReadingTime(SCIP_READER *reader)
Definition: reader.c:581
char branch_firstsbchild
Definition: struct_set.h:145
SCIP_Real SCIPsetBarrierconvtol(SCIP_SET *set)
Definition: set.c:5125
int SCIPsetGetNParams(SCIP_SET *set)
Definition: set.c:3115
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
Definition: var.c:16598
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
Definition: lp.c:19126
SCIP_RETCODE SCIPdialoghdlrCreate(SCIP_SET *set, SCIP_DIALOGHDLR **dialoghdlr)
Definition: dialog.c:328
SCIP_CONFLICTHDLR * SCIPsetFindConflicthdlr(SCIP_SET *set, const char *name)
Definition: set.c:3425
SCIP_CUT ** SCIPgetPoolCuts(SCIP *scip)
Definition: scip.c:31103
#define BMSallocMemory(ptr)
Definition: memory.h:74
SCIP_RETCODE SCIPreoptCreate(SCIP_REOPT **reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: reopt.c:3977
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:41758
int SCIPgetNPrioExternBranchCands(SCIP *scip)
Definition: scip.c:33293
void SCIPreaderSetRead(SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: reader.c:488
int SCIPgetNOrigBinVars(SCIP *scip)
Definition: scip.c:11165
SCIP_RETCODE SCIPsetRelaxInit(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXINIT((*relaxinit)))
Definition: scip.c:6489
SCIP_RETCODE SCIPsetChgRealParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, SCIP_Real value)
Definition: set.c:2849
SCIP_RETCODE SCIPenableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:25672
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
Definition: lp.c:19024
SCIP_RETCODE SCIPsepastoreRemoveInefficaciousCuts(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_Bool root, SCIP_EFFICIACYCHOICE efficiacychoice)
Definition: sepastore.c:1297
struct SCIP_EventData SCIP_EVENTDATA
Definition: type_event.h:146
SCIP_RETCODE SCIPbranchExtern(SCIP *scip, SCIP_RESULT *result)
Definition: scip.c:33942
SCIP_RETCODE SCIPgetNlRowSolFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: scip.c:30132
void SCIPeventhdlrSetExit(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXIT((*eventexit)))
Definition: event.c:342
SCIP_Real SCIPconflictGetBoundexceedingLPTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:6359
SCIP_Bool SCIPsetExistsDialog(SCIP_SET *set, SCIP_DIALOG *dialog)
Definition: set.c:4216
SCIP_RETCODE SCIPinferBinvarCons(SCIP *scip, SCIP_VAR *var, SCIP_Bool fixedval, SCIP_CONS *infercons, int inferinfo, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:20669
SCIP_RETCODE SCIPbranchcandGetPseudoCands(SCIP_BRANCHCAND *branchcand, SCIP_SET *set, SCIP_PROB *prob, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
Definition: branch.c:740
SCIP_RETCODE SCIPgetNLPVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars)
Definition: scip.c:28444
SCIP_Real SCIPgetVarAvgConflictlengthCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23795
SCIP_RETCODE SCIPsepastoreCreate(SCIP_SEPASTORE **sepastore)
Definition: sepastore.c:79
SCIP_RETCODE SCIPenfolpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: scip.c:25929
SCIP_Bool SCIPsetIsSumRelLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6189
SCIP_VAR * transvar
Definition: struct_var.h:168
SCIP_RETCODE SCIPsetNlRowExprtree(SCIP *scip, SCIP_NLROW *nlrow, SCIP_EXPRTREE *exprtree)
Definition: scip.c:29794
SCIP_REOPT * reopt
Definition: struct_scip.h:69
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:428
SCIP_NODE * SCIPtreeGetBestSibling(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:6758
int SCIPgetNSiblings(SCIP *scip)
Definition: scip.c:36914
internal methods for NLP management
SCIP_RETCODE SCIPprintBestTransSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:35873
SCIP_Real SCIPgetVarMultaggrUbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21463
SCIP_PRESOL * SCIPfindPresol(SCIP *scip, const char *name)
Definition: scip.c:6322
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:2075
SCIP_RETCODE SCIPupdateNodeDualbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
Definition: scip.c:12341
SCIP_RETCODE SCIPnlpSetIntPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, int ival)
Definition: nlp.c:5992
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
Definition: scip.c:5503
SCIP_Real SCIPsetFeasCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5758
void SCIPheurSetCopy(SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: heur.c:1081
void SCIPbranchruleSetInit(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINIT((*branchinit)))
Definition: branch.c:1798
void SCIPsetSetLimitChanged(SCIP_SET *set)
Definition: set.c:4898
SCIP_RETCODE SCIPgetPseudoBranchCands(SCIP *scip, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
Definition: scip.c:33464
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:4457
SCIP_RETCODE SCIPsetPresolPriority(SCIP *scip, SCIP_PRESOL *presol, int priority)
Definition: scip.c:6359
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
Definition: message.c:411
SCIP_RETCODE SCIPchgNlRowRhs(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real rhs)
Definition: scip.c:29517
SCIP_Bool SCIPsetIsRelLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6101
SCIP_Bool SCIPisScalingIntegral(SCIP *scip, SCIP_Real val, SCIP_Real scalar)
Definition: scip.c:41733
void SCIPconshdlrSetEnable(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
Definition: cons.c:4165
int SCIPprobGetNObjVars(SCIP_PROB *prob, SCIP_SET *set)
Definition: prob.c:1911
SCIP_RETCODE SCIPbranchcandGetLPCands(SCIP_BRANCHCAND *branchcand, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Definition: branch.c:384
SCIP_RETCODE SCIPconsChgName(SCIP_CONS *cons, BMS_BLKMEM *blkmem, const char *name)
Definition: cons.c:5770
SCIP_RETCODE SCIPincludeConflicthdlrBasic(SCIP *scip, SCIP_CONFLICTHDLR **conflicthdlrptr, const char *name, const char *desc, int priority, SCIP_DECL_CONFLICTEXEC((*conflictexec)), SCIP_CONFLICTHDLRDATA *conflicthdlrdata)
Definition: scip.c:5962
void SCIProwDelaySort(SCIP_ROW *row)
Definition: lp.c:5912
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
Definition: lpi_clp.cpp:2634
SCIP_Real cutoffbound
Definition: struct_lp.h:270
SCIP_Real SCIProwGetPseudoFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6214
SCIP_Longint nsbdivinglpiterations
Definition: struct_stat.h:60
SCIP_Bool SCIPallVarsInProb(SCIP *scip)
Definition: scip.c:11450
SCIP_RETCODE SCIPsetChgLongintParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, SCIP_Longint value)
Definition: set.c:2811
SCIP_RETCODE SCIPlpAddRow(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_ROW *row, int depth)
Definition: lp.c:9022
internal miscellaneous methods
#define SCIP_DECL_NODESELFREE(x)
Definition: type_nodesel.h:56
SCIP_RETCODE SCIPboolarrayClear(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:3311
SCIP_RETCODE SCIPwriteCliqueGraph(SCIP *scip, const char *fname, SCIP_Bool writenodeweights)
Definition: scip.c:22217
SCIP_RETCODE SCIPgetSolVarsData(SCIP *scip, SCIP_SOL *sol, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:11327
void SCIPvarGetClosestVub(SCIP_VAR *var, SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *closestvub, int *closestvubidx)
Definition: var.c:13451
#define SCIP_DECL_RELAXCOPY(x)
Definition: type_relax.h:47
SCIP_RETCODE SCIPrecalcNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:29864
SCIP_RETCODE SCIPvarFlattenAggregationGraph(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: var.c:4133
SCIP_RETCODE SCIPpropagateProbingImplications(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:32658
SCIP_RETCODE SCIPevalExprtreeGlobalBounds(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val)
Definition: scip.c:30329
SCIP_Real SCIPgetLPRootColumnObjval(SCIP *scip)
Definition: scip.c:26630
SCIP_Real SCIPlpGetObjNorm(SCIP_LP *lp)
Definition: lp.c:19283
SCIP_RETCODE SCIPgetLPBInvARow(SCIP *scip, int r, SCIP_Real *binvrow, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:26965
SCIP_Real SCIPsetDualfeasCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5969
SCIP_Longint nprimalresolvelpiterations
Definition: struct_stat.h:53
SCIP_RETCODE SCIPsumLPRows(SCIP *scip, SCIP_Real *weights, SCIP_REALARRAY *sumcoef, SCIP_Real *sumlhs, SCIP_Real *sumrhs)
Definition: scip.c:27032
SCIP_RETCODE SCIPsolPrint(SCIP_SOL *sol, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PROB *transprob, FILE *file, SCIP_Bool printzeros)
Definition: sol.c:1925
SCIP_Bool SCIPsetIsDualfeasFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5945
SCIP_Longint SCIPconflictGetNStrongbranchReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:6727
SCIP_RETCODE SCIPvarSetRelaxSol(SCIP_VAR *var, SCIP_SET *set, SCIP_RELAXATION *relaxation, SCIP_Real solval, SCIP_Bool updateobj)
Definition: var.c:13116
SCIP_RETCODE SCIPprintTransSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:35458
SCIP_COL * SCIPvarGetCol(SCIP_VAR *var)
Definition: var.c:16771
int nrelaxs
Definition: struct_set.h:97
SCIP_Real SCIPsepaGetSetupTime(SCIP_SEPA *sepa)
Definition: sepa.c:730
SCIP_RETCODE SCIPchgConsName(SCIP *scip, SCIP_CONS *cons, const char *name)
Definition: scip.c:25000
int nseparounds
Definition: struct_stat.h:181
void SCIPrelaxSetInitsol(SCIP_RELAX *relax, SCIP_DECL_RELAXINITSOL((*relaxinitsol)))
Definition: relax.c:419
SCIP_RETCODE SCIPconsCopy(SCIP_CONS **cons, SCIP_SET *set, const char *name, SCIP *sourcescip, SCIP_CONSHDLR *sourceconshdlr, SCIP_CONS *sourcecons, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool global, SCIP_Bool *success)
Definition: cons.c:5607
SCIP_Bool SCIPsetIsDualfeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5857
SCIP_BOUNDTYPE * SCIPvarGetImplTypes(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17367
void SCIPrelaxSetExitsol(SCIP_RELAX *relax, SCIP_DECL_RELAXEXITSOL((*relaxexitsol)))
Definition: relax.c:430
SCIP_RETCODE SCIPincludeNodesel(SCIP *scip, const char *name, const char *desc, int stdpriority, int memsavepriority, SCIP_DECL_NODESELCOPY((*nodeselcopy)), SCIP_DECL_NODESELFREE((*nodeselfree)), SCIP_DECL_NODESELINIT((*nodeselinit)), SCIP_DECL_NODESELEXIT((*nodeselexit)), SCIP_DECL_NODESELINITSOL((*nodeselinitsol)), SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)), SCIP_DECL_NODESELSELECT((*nodeselselect)), SCIP_DECL_NODESELCOMP((*nodeselcomp)), SCIP_NODESELDATA *nodeseldata)
Definition: scip.c:7948
SCIP_HISTORY * glbhistory
Definition: struct_stat.h:134
SCIP_Bool SCIPconsIsGlobal(SCIP_CONS *cons)
Definition: cons.c:7829
SCIP_RETCODE SCIPdelVar(SCIP *scip, SCIP_VAR *var, SCIP_Bool *deleted)
Definition: scip.c:10496
static void printNLPStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39985
SCIP_Bool userinterrupt
Definition: struct_stat.h:224
SCIP_Real SCIPsetFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5400
SCIP_RETCODE SCIPconsInitlp(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:7118
SCIP_RETCODE SCIPsetIncludePricer(SCIP_SET *set, SCIP_PRICER *pricer)
Definition: set.c:3167
SCIP_RETCODE SCIPvarGetProbvarBinary(SCIP_VAR **var, SCIP_Bool *negated)
Definition: var.c:11573
SCIP_SEPA * SCIPsetFindSepa(SCIP_SET *set, const char *name)
Definition: set.c:3646
#define SCIP_DECL_CONSDISABLE(x)
Definition: type_cons.h:651
SCIP_RETCODE SCIPprobSetName(SCIP_PROB *prob, const char *name)
Definition: prob.c:1873
SCIP_NLPI ** SCIPgetNlpis(SCIP *scip)
Definition: scip.c:8672
SCIP_RETCODE SCIPmessagehdlrRelease(SCIP_MESSAGEHDLR **messagehdlr)
Definition: message.c:332
int SCIPexprtreeGetNVars(SCIP_EXPRTREE *tree)
Definition: expr.c:8452
SCIP_RETCODE SCIPgetCharParam(SCIP *scip, const char *name, char *value)
Definition: scip.c:3816
SCIP_Bool SCIPsetIsRelGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6123
SCIP_Real unchangedobj
Definition: struct_var.h:202
void SCIPenableNLP(SCIP *scip)
Definition: scip.c:28392
void SCIPconshdlrSetExit(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
Definition: cons.c:4015
SCIP_RETCODE SCIPincludeHeur(SCIP *scip, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, unsigned int timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEURCOPY((*heurcopy)), SCIP_DECL_HEURFREE((*heurfree)), SCIP_DECL_HEURINIT((*heurinit)), SCIP_DECL_HEUREXIT((*heurexit)), SCIP_DECL_HEURINITSOL((*heurinitsol)), SCIP_DECL_HEUREXITSOL((*heurexitsol)), SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
Definition: scip.c:7202
SCIP_Longint nconflictlps
Definition: struct_stat.h:161
SCIP_RETCODE SCIPcreateProb(SCIP *scip, const char *name, SCIP_DECL_PROBDELORIG((*probdelorig)), SCIP_DECL_PROBTRANS((*probtrans)), SCIP_DECL_PROBDELTRANS((*probdeltrans)), SCIP_DECL_PROBINITSOL((*probinitsol)), SCIP_DECL_PROBEXITSOL((*probexitsol)), SCIP_DECL_PROBCOPY((*probcopy)), SCIP_PROBDATA *probdata)
Definition: scip.c:9019
internal methods for node selectors and node priority queues
SCIP_Longint SCIPcutpoolGetNCutsFound(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:894
#define SCIP_PROPTIMING_ALWAYS
Definition: type_timing.h:62
SCIP_Real SCIPgetVectorEfficacyNorm(SCIP *scip, SCIP_Real *vals, int nvals)
Definition: scip.c:30891
SCIP_VAR ** SCIPvarGetMultaggrVars(SCIP_VAR *var)
Definition: var.c:16837
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
Definition: scip.c:26750
SCIP_Bool SCIPprobIsObjIntegral(SCIP_PROB *prob)
Definition: prob.c:2128
internal methods for variable pricers
SCIP_RETCODE SCIPsetHeurPriority(SCIP *scip, SCIP_HEUR *heur, int priority)
Definition: scip.c:7430
int SCIPvarGetNLocksUp(SCIP_VAR *var)
Definition: var.c:3204
SCIP_RETCODE SCIPvarFix(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
Definition: var.c:3559
SCIP_Bool SCIPgetBoolarrayVal(SCIP *scip, SCIP_BOOLARRAY *boolarray, int idx)
Definition: scip.c:42844
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:35020
SCIP_RETCODE SCIPsetProbCopy(SCIP *scip, SCIP_DECL_PROBCOPY((*probcopy)))
Definition: scip.c:9203
SCIP_RETCODE SCIPcreateRowUnspec(SCIP *scip, SCIP_ROW **row, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip.c:27536
SCIP_Bool SCIPisDualfeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42093
void SCIPaddSquareSecant(SCIP *scip, SCIP_Real sqrcoef, SCIP_Real lb, SCIP_Real ub, SCIP_Real refpoint, SCIP_Real *lincoef, SCIP_Real *linconstant, SCIP_Bool *success)
Definition: scip.c:30522
SCIP_RETCODE SCIPvarAddVlb(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_CLIQUETABLE *cliquetable, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *vlbvar, SCIP_Real vlbcoef, SCIP_Real vlbconstant, SCIP_Bool transitive, SCIP_Bool *infeasible, int *nbdchgs)
Definition: var.c:9484
SCIP_Real SCIPinfinity(SCIP *scip)
Definition: scip.c:41637
const char * SCIPlpiGetSolverName(void)
Definition: lpi_clp.cpp:433
int SCIPgetNPrioPseudoBranchInts(SCIP *scip)
Definition: scip.c:33544
int npresolchgbds
Definition: struct_stat.h:196
void SCIPreoptnodeInit(SCIP_REOPTNODE *reoptnode, SCIP_SET *set)
Definition: reopt.c:6295
SCIP_Real SCIPgetGlobalPseudoObjval(SCIP *scip)
Definition: scip.c:26543
SCIP_Longint SCIPconflictGetNStrongbranchConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:6717
SCIP_NODE * SCIPgetBestNode(SCIP *scip)
Definition: scip.c:37050
SCIP_RETCODE SCIPsolCreateOriginal(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_HEUR *heur)
Definition: sol.c:306
int SCIPptrarrayGetMaxIdx(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:3794
SCIP_NODEPQ * leaves
Definition: struct_tree.h:168
void SCIPsetSortProps(SCIP_SET *set)
Definition: set.c:3740
SCIP_RETCODE SCIPpresolve(SCIP *scip)
Definition: scip.c:14342
static SCIP_RETCODE calcNonZeros(SCIP *scip, SCIP_Longint *nchecknonzeros, SCIP_Longint *nactivenonzeros, SCIP_Bool *approxchecknonzeros, SCIP_Bool *approxactivenonzeros)
Definition: scip.c:12519
struct SCIP_ConflicthdlrData SCIP_CONFLICTHDLRDATA
Definition: type_conflict.h:40
void SCIPsepaSetExitsol(SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
Definition: sepa.c:622
SCIP_Real SCIPcutpoolGetTime(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:874
internal methods for global SCIP settings
SCIP_Real SCIPvarCalcPscostConfidenceBound(SCIP_VAR *var, SCIP_SET *set, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun, SCIP_CONFIDENCELEVEL clevel)
Definition: var.c:13946
SCIP * scip
Definition: struct_cons.h:39
int SCIPgetPlungeDepth(SCIP *scip)
Definition: scip.c:38279
int npresoladdholes
Definition: struct_stat.h:197
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
Definition: scip.c:5292
SCIP_RETCODE SCIPsetSetReoptimizationParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:614
SCIP_Longint SCIPbranchruleGetNExternCalls(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2007
SCIP_RETCODE SCIPprobAddVarName(SCIP_PROB *prob, SCIP_VAR *var)
Definition: prob.c:862
SCIP_RETCODE SCIPinitRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip.c:15168
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:50
#define SCIP_HEURTIMING_DURINGPRESOLLOOP
Definition: type_timing.h:85
SCIP main data structure.
SCIP_RETCODE SCIPprobResetBounds(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: prob.c:583
#define SCIP_DECL_EVENTEXITSOL(x)
Definition: type_event.h:202
SCIP_Bool SCIPsetIsFeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5666
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
Definition: scip.c:26354
static SCIP_RETCODE printProblem(SCIP *scip, SCIP_PROB *prob, FILE *file, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:39199
int SCIPlpGetNRows(SCIP_LP *lp)
Definition: lp.c:19198
BMS_BLKMEM * setmem
Definition: struct_mem.h:38
SCIP_Real SCIPgetVarPseudocostScore(SCIP *scip, SCIP_VAR *var, SCIP_Real solval)
Definition: scip.c:23507
SCIP_RETCODE SCIPincludeConshdlrBasic(SCIP *scip, SCIP_CONSHDLR **conshdlrptr, const char *name, const char *desc, int enfopriority, int chckpriority, int eagerfreq, SCIP_Bool needscons, SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_CONSHDLRDATA *conshdlrdata)
Definition: scip.c:5192
SCIP_Bool SCIPvarsHaveCommonClique(SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
Definition: var.c:10742
SCIP_NODESEL * SCIPgetNodesel(SCIP *scip)
Definition: scip.c:8189
SCIP_RETCODE SCIPvarIncNBranchings(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_BRANCHDIR dir, SCIP_Real value, int depth)
Definition: var.c:14651
SCIP_RETCODE SCIPreaderRead(SCIP_READER *reader, SCIP_SET *set, const char *filename, const char *extension, SCIP_RESULT *result)
Definition: reader.c:136
#define SCIP_DECL_PROPINITPRE(x)
Definition: type_prop.h:85
#define BMSfreeMemory(ptr)
Definition: memory.h:100
SCIP_RETCODE SCIPreoptResetDualBndchgs(SCIP_REOPT *reopt, SCIP_NODE *node, BMS_BLKMEM *blkmem)
Definition: reopt.c:5639
SCIP_RETCODE SCIPsetEventhdlrExit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXIT((*eventexit)))
Definition: scip.c:7852
struct SCIP_ComprData SCIP_COMPRDATA
Definition: type_compr.h:40
void SCIPmessagePrintInfo(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
Definition: message.c:578
SCIP_Real SCIPconshdlrGetSetupTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4361
SCIP_RETCODE SCIPcutpoolClear(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: cutpool.c:467
#define SCIP_DECL_CONSENABLE(x)
Definition: type_cons.h:636
SCIP_Longint SCIPgetNDualLPIterations(SCIP *scip)
Definition: scip.c:37563
void SCIPlpMarkDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:19423
int SCIPvarGetBranchPriority(SCIP_VAR *var)
Definition: var.c:17229
void SCIPpropSetPresolPriority(SCIP_PROP *prop, SCIP_SET *set, int presolpriority)
Definition: prop.c:941
#define MAXNCLIQUEVARSCOMP
Definition: scip.c:21840
void SCIPreoptnodeGetPath(SCIP_REOPT *reopt, SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, int varssize, int *nbndchgs, int *nbndchgsafterdual)
Definition: reopt.c:5664
SCIP_RETCODE SCIPmakeRowIntegral(SCIP *scip, SCIP_ROW *row, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Bool usecontvars, SCIP_Bool *success)
Definition: scip.c:28003
SCIP_RETCODE SCIPtransformVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
Definition: scip.c:17025
SCIP_RETCODE SCIPsetSetLpfeastol(SCIP_SET *set, SCIP_Real lpfeastol, SCIP_Bool printnewvalue)
Definition: set.c:4834
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip.c:766
SCIP_RETCODE SCIPsetPropPresol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPPRESOL((*proppresol)), int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming)
Definition: scip.c:7073
SCIP_RETCODE SCIPsetSetPresolving(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: set.c:3074
SCIP_RETCODE SCIPcatchRowEvent(SCIP *scip, SCIP_ROW *row, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:36708
SCIP_Bool SCIPisDualfeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42080
SCIP_RETCODE SCIPconsAddLocks(SCIP_CONS *cons, SCIP_SET *set, int nlockspos, int nlocksneg)
Definition: cons.c:6950
#define SCIP_DECL_CONFLICTCOPY(x)
Definition: type_conflict.h:52
int SCIPconsGetValidDepth(SCIP_CONS *cons)
Definition: cons.c:7693
SCIP_Bool SCIPsetIsLbBetter(SCIP_SET *set, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
Definition: set.c:6004
SCIP_RETCODE SCIPconsDisable(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat)
Definition: cons.c:6489
SCIP_RETCODE SCIPnlpSetInitialGuess(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_Real *initguess)
Definition: nlp.c:5657
SCIP_Real SCIPvarGetPseudocostCount(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:13804
SCIP_RETCODE SCIPprobCreate(SCIP_PROB **prob, BMS_BLKMEM *blkmem, SCIP_SET *set, const char *name, SCIP_DECL_PROBDELORIG((*probdelorig)), SCIP_DECL_PROBTRANS((*probtrans)), SCIP_DECL_PROBDELTRANS((*probdeltrans)), SCIP_DECL_PROBINITSOL((*probinitsol)), SCIP_DECL_PROBEXITSOL((*probexitsol)), SCIP_DECL_PROBCOPY((*probcopy)), SCIP_PROBDATA *probdata, SCIP_Bool transformed)
Definition: prob.c:250
SCIP_Longint nduallpiterations
Definition: struct_stat.h:50
SCIP_Longint nbarrierzeroitlps
Definition: struct_stat.h:150
SCIP_Longint SCIPconflictGetNPseudoSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:6931
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip.c:35717
SCIP_Bool resolvelperror
Definition: struct_lp.h:352
SCIP_RETCODE SCIPsetNlRowExprtreeParams(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *paramvals)
Definition: scip.c:29841
SCIP_RETCODE SCIPcreateEmptyNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real lhs, SCIP_Real rhs)
Definition: scip.c:29400
void SCIPsetMessagehdlrQuiet(SCIP *scip, SCIP_Bool quiet)
Definition: scip.c:1236
SCIP_Longint SCIPgetNLPs(SCIP *scip)
Definition: scip.c:37435
SCIP_RETCODE SCIPintarraySetVal(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int val)
Definition: misc.c:2995
SCIP_RETCODE SCIPsetPropInitpre(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITPRE((*propinitpre)))
Definition: scip.c:7041
#define SCIP_HEURTIMING_BEFOREPRESOL
Definition: type_timing.h:84
internal methods for storing priced variables
void SCIPprintMemoryDiagnostic(SCIP *scip)
Definition: scip.c:41464
SCIP_Real SCIPgetVarLbDive(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:31937
SCIP_RETCODE SCIPgetDivesetScore(SCIP *scip, SCIP_DIVESET *diveset, SCIP_DIVETYPE divetype, SCIP_VAR *divecand, SCIP_Real divecandsol, SCIP_Real divecandfrac, SCIP_Real *candscore, SCIP_Bool *roundup)
Definition: scip.c:32901
SCIP_RETCODE SCIPnlrowCreateFromRow(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_ROW *row)
Definition: nlp.c:2177
const char * SCIProwGetName(SCIP_ROW *row)
Definition: lp.c:18974
SCIP_RETCODE SCIPinferVarUbProp(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_PROP *inferprop, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:20944
int SCIPgetNCompr(SCIP *scip)
Definition: scip.c:7653
SCIP_Bool SCIPinProbing(SCIP *scip)
Definition: scip.c:32131
internal methods for relaxators
SCIP_RETCODE SCIPsetAddIntParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: set.c:2455
SCIP_Real SCIPhistoryGetPseudocostCount(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:461
#define SCIP_DECL_READERWRITE(x)
Definition: type_reader.h:110
SCIP_Bool SCIPsetIsEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5202
void SCIPpresolSetInitpre(SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
Definition: presol.c:531
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41946
SCIP_RETCODE SCIPcreateEmptyRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip.c:27629
SCIP_RETCODE SCIPprimalRetransformSolutions(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob)
Definition: primal.c:1499
SCIP_Real vsidsweight
Definition: struct_stat.h:96
#define SCIPdebugCheckBInvRow(scip, r, coef)
Definition: debug.h:288
SCIP_RETCODE SCIPvarChgUbLocal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_Real newbound)
Definition: var.c:7581
#define SCIP_DECL_CONSENFOLP(x)
Definition: type_cons.h:313
int nsepas
Definition: struct_set.h:99
SCIP_Longint SCIPgetLastDivenode(SCIP *scip)
Definition: scip.c:32067
int SCIPgetDepthLimit(SCIP *scip)
Definition: scip.c:38190
SCIP_RETCODE SCIPdeactivatePricer(SCIP *scip, SCIP_PRICER *pricer)
Definition: scip.c:5074
SCIP_Bool SCIPsetIsHugeValue(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5191
SCIP_RETCODE SCIPgetNlRowActivityBounds(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: scip.c:30167
SCIP_RETCODE SCIPsetConflicthdlrPriority(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, int priority)
Definition: scip.c:6127
SCIP_LPI * SCIPlpGetLPI(SCIP_LP *lp)
Definition: lp.c:19350
void SCIPconshdlrSetActive(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
Definition: cons.c:4143
SCIP_Real SCIPlpGetObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:15076
SCIP_RETCODE SCIPprimalTryCurrentSol(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_HEUR *heur, SCIP_Bool printreason, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: primal.c:1394
void SCIPprobResortVars(SCIP_PROB *prob)
Definition: prob.c:610
void SCIPstatResetPrimalDualIntegral(SCIP_STAT *stat, SCIP_SET *set, SCIP_Bool partialreset)
Definition: stat.c:333
SCIP_Real SCIPdualfeasFloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:42205
SCIP_Longint SCIPcutpoolGetNCalls(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:884
SCIP_RETCODE SCIPnlpChgVarObjDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_Real coef)
Definition: nlp.c:6169
SCIP_Longint SCIPconflictGetNInfeasibleLPCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:6289
struct SCIP_ConsData SCIP_CONSDATA
Definition: type_cons.h:50
void SCIPnodeselSetInitsol(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINITSOL((*nodeselinitsol)))
Definition: nodesel.c:1127
SCIP_RETCODE SCIPchgFeastol(SCIP *scip, SCIP_Real feastol)
Definition: scip.c:41217
SCIP_Bool SCIPbranchcandContainsExternCand(SCIP_BRANCHCAND *branchcand, SCIP_VAR *var)
Definition: branch.c:664
SCIP_Real SCIPgetLPRootLooseObjval(SCIP *scip)
Definition: scip.c:26653
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: scip.c:4649
void SCIProwPrint(SCIP_ROW *row, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: lp.c:5065
SCIP_Real SCIPgetVarVSIDSCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23613
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
Definition: scip.c:12623
internal methods for storing separated cuts
int lastnpresoldelconss
Definition: struct_stat.h:208
#define SCIPfreeBufferArrayNull(scip, ptr)
Definition: scip.h:20598
SCIP_RETCODE SCIPvarPrint(SCIP_VAR *var, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: var.c:2873
void SCIPstatResetDisplay(SCIP_STAT *stat)
Definition: stat.c:490
SCIP_RETCODE SCIPnlrowChgConstant(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real constant)
Definition: nlp.c:2762
SCIP_RETCODE SCIPreaderWrite(SCIP_READER *reader, SCIP_PROB *prob, SCIP_SET *set, FILE *file, const char *extension, SCIP_Bool genericnames, SCIP_RESULT *result)
Definition: reader.c:222
void SCIPsetSortPropsPresol(SCIP_SET *set)
Definition: set.c:3756
SCIP_RETCODE SCIPmultiaggregateVar(SCIP *scip, SCIP_VAR *var, int naggvars, SCIP_VAR **aggvars, SCIP_Real *scalars, SCIP_Real constant, SCIP_Bool *infeasible, SCIP_Bool *aggregated)
Definition: scip.c:23020
SCIP_Real SCIPgetAvgConflictScoreCurrentRun(SCIP *scip)
Definition: scip.c:38962
SCIP_RETCODE SCIPsetRelaxFree(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXFREE((*relaxfree)))
Definition: scip.c:6473
SCIP_RETCODE SCIPnlpChgVarBoundsDive(SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: nlp.c:6228
SCIP_RETCODE SCIPaddStringParam(SCIP *scip, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip.c:3684
SCIP_RETCODE SCIPgetDiveBoundChanges(SCIP *scip, SCIP_DIVESET *diveset, SCIP_SOL *sol, SCIP_Bool *success, SCIP_Bool *infeasible)
Definition: scip.c:32978
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
Definition: scip.c:16884
SCIP_Real SCIPgetVarAvgCutoffScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:24162
int SCIPpropGetNAggrVars(SCIP_PROP *prop)
Definition: prop.c:1122
SCIP_Bool SCIPsetIsFeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5622
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
Definition: scip.c:11929
SCIP_Bool SCIPisHugeValue(SCIP *scip, SCIP_Real val)
Definition: scip.c:41660
int SCIPgetNReoptRuns(SCIP *scip)
Definition: scip.c:37345
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:2717
SCIP_Bool SCIProwIsSolEfficacious(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Bool root)
Definition: lp.c:6587
void SCIPsetSortPresolsName(SCIP_SET *set)
Definition: set.c:3533
SCIP_RETCODE SCIPincludeConflicthdlr(SCIP *scip, const char *name, const char *desc, int priority, SCIP_DECL_CONFLICTCOPY((*conflictcopy)), SCIP_DECL_CONFLICTFREE((*conflictfree)), SCIP_DECL_CONFLICTINIT((*conflictinit)), SCIP_DECL_CONFLICTEXIT((*conflictexit)), SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)), SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)), SCIP_DECL_CONFLICTEXEC((*conflictexec)), SCIP_CONFLICTHDLRDATA *conflicthdlrdata)
Definition: scip.c:5919
SCIP_Longint nprimalresolvelps
Definition: struct_stat.h:151
SCIP_RETCODE SCIPcreateFiniteSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol, SCIP_Bool *success)
Definition: scip.c:34369
SCIP_RETCODE SCIPincludeSepa(SCIP *scip, const char *name, const char *desc, int priority, int freq, SCIP_Real maxbounddist, SCIP_Bool usessubscip, SCIP_Bool delay, SCIP_DECL_SEPACOPY((*sepacopy)), SCIP_DECL_SEPAFREE((*sepafree)), SCIP_DECL_SEPAINIT((*sepainit)), SCIP_DECL_SEPAEXIT((*sepaexit)), SCIP_DECL_SEPAINITSOL((*sepainitsol)), SCIP_DECL_SEPAEXITSOL((*sepaexitsol)), SCIP_DECL_SEPAEXECLP((*sepaexeclp)), SCIP_DECL_SEPAEXECSOL((*sepaexecsol)), SCIP_SEPADATA *sepadata)
Definition: scip.c:6612
SCIP_RETCODE SCIPextendIntarray(SCIP *scip, SCIP_INTARRAY *intarray, int minidx, int maxidx)
Definition: scip.c:42658
SCIP_RETCODE SCIPaddVarImplication(SCIP *scip, SCIP_VAR *var, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype, SCIP_Real implbound, SCIP_Bool *infeasible, int *nbdchgs)
Definition: scip.c:21682
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:98
SCIP_RETCODE SCIPlpStartStrongbranch(SCIP_LP *lp)
Definition: lp.c:3986
int SCIPpropGetNAddConss(SCIP_PROP *prop)
Definition: prop.c:1172
SCIP_CLOCK * divinglptime
Definition: struct_stat.h:123
SCIP_Longint nprobboundchgs
Definition: struct_stat.h:88
SCIP_CLOCK * presolvingtimeoverall
Definition: struct_stat.h:118
SCIP_READER * SCIPsetFindReader(SCIP_SET *set, const char *name)
Definition: set.c:3147
SCIP_RETCODE SCIPsetConshdlrDisable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDISABLE((*consdisable)))
Definition: scip.c:5726
SCIP_VERBLEVEL SCIPgetVerbLevel(SCIP *scip)
Definition: scip.c:1322
SCIP_Longint SCIPrelaxGetNCalls(SCIP_RELAX *relax)
Definition: relax.c:527
int SCIPpropGetNChgVarTypes(SCIP_PROP *prop)
Definition: prop.c:1132
SCIP_RETCODE SCIPrecalcRowPseudoActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28169
void SCIPsolRecomputeObj(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob)
Definition: sol.c:1830
void SCIPsetSortRelaxs(SCIP_SET *set)
Definition: set.c:3592
#define SCIP_DECL_CONSSEPALP(x)
Definition: type_cons.h:239
SCIP_RETCODE SCIPpricestoreFree(SCIP_PRICESTORE **pricestore)
Definition: pricestore.c:125
SCIP_RETCODE SCIProwRelease(SCIP_ROW **row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: lp.c:5118
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:12080
SCIP_BRANCHRULE ** SCIPgetBranchrules(SCIP *scip)
Definition: scip.c:8451
SCIP_RETCODE SCIPsetPricerInit(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICERINIT((*pricerinit)))
Definition: scip.c:4892
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:160
SCIP_RETCODE SCIPpriceLoop(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_PRICESTORE *pricestore, SCIP_SEPASTORE *sepastore, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool pretendroot, SCIP_Bool displayinfo, int maxpricerounds, int *npricedcolvars, SCIP_Bool *mustsepa, SCIP_Bool *lperror, SCIP_Bool *aborted)
Definition: solve.c:1819
#define SCIP_DECL_COMPRINITSOL(x)
Definition: type_compr.h:84
SCIP_CUTPOOL * cutpool
Definition: struct_scip.h:87
SCIP_BRANCHRULE ** branchrules
Definition: struct_set.h:79
SCIP_Real SCIPtreeGetAvgLowerbound(SCIP_TREE *tree, SCIP_Real cutoffbound)
Definition: tree.c:6919
SCIP_Longint nduallps
Definition: struct_stat.h:146
SCIP_RETCODE SCIPcutpoolAddRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_ROW *row)
Definition: cutpool.c:493
SCIP_COL ** SCIPgetLPCols(SCIP *scip)
Definition: scip.c:26707
#define SCIP_DECL_PROBTRANS(x)
Definition: type_prob.h:74
void SCIPbranchruleSetMaxdepth(SCIP_BRANCHRULE *branchrule, int maxdepth)
Definition: branch.c:1931
methods for catching the user CTRL-C interrupt
SCIP_Longint SCIPgetNRootStrongbranchLPIterations(SCIP *scip)
Definition: scip.c:37893
void SCIPtreeClearDiveBoundChanges(SCIP_TREE *tree)
Definition: tree.c:6078
void SCIPsepaSetCopy(SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
Definition: sepa.c:567
SCIP_CLIQUETABLE * cliquetable
Definition: struct_scip.h:81
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
Definition: scip.c:17116
SCIP_RETCODE SCIPgetActiveVars(SCIP *scip, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize)
Definition: scip.c:17465
SCIP_RETCODE SCIPtreeCreatePresolvingRoot(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_CONFLICT *conflict, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable)
Definition: tree.c:4771
SCIP_Real SCIProwGetSolActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6230
SCIP_Real SCIPgetUpperbound(SCIP *scip)
Definition: scip.c:38534
SCIP_RETCODE SCIPtightenVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:21150
SCIP_RETCODE SCIPsetSetLongintParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Longint value)
Definition: set.c:2834
SCIP_RETCODE SCIPdisableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:25700
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41611
static SCIP_RETCODE checkStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
Definition: scip.c:125
SCIP_Bool SCIPisRootLPRelax(SCIP *scip)
Definition: scip.c:26586
SCIP_RETCODE SCIPmemCreate(SCIP_MEM **mem)
Definition: mem.c:33
int SCIPgetNPrioPseudoBranchBins(SCIP *scip)
Definition: scip.c:33526
SCIP_RETCODE SCIPprimalSetCutoffbound(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_Real cutoffbound, SCIP_Bool useforobjlimit)
Definition: primal.c:188
int SCIPreoptGetNTotalFeasNodes(SCIP_REOPT *reopt)
Definition: reopt.c:3896
SCIP_RETCODE SCIPclearRelaxSolVals(SCIP *scip)
Definition: scip.c:17685
#define SCIP_COPYRIGHT
Definition: def.h:91
SCIP_RETCODE SCIPincludePricer(SCIP *scip, const char *name, const char *desc, int priority, SCIP_Bool delay, SCIP_DECL_PRICERCOPY((*pricercopy)), SCIP_DECL_PRICERFREE((*pricerfree)), SCIP_DECL_PRICERINIT((*pricerinit)), SCIP_DECL_PRICEREXIT((*pricerexit)), SCIP_DECL_PRICERINITSOL((*pricerinitsol)), SCIP_DECL_PRICEREXITSOL((*pricerexitsol)), SCIP_DECL_PRICERREDCOST((*pricerredcost)), SCIP_DECL_PRICERFARKAS((*pricerfarkas)), SCIP_PRICERDATA *pricerdata)
Definition: scip.c:4738
data structures and methods for collecting reoptimization information
internal methods for problem variables
SCIP_Real sepa_feastolfac
Definition: struct_set.h:418
SCIP_COMPR * SCIPsetFindCompr(SCIP_SET *set, const char *name)
Definition: set.c:3886
SCIP_RETCODE SCIPstatCreate(SCIP_STAT **stat, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: stat.c:43
SCIP_RETCODE SCIPsetIncludeProp(SCIP_SET *set, SCIP_PROP *prop)
Definition: set.c:3696
SCIP_Bool SCIPisSumNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:41895
void SCIPbranchruleSetExecLp(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
Definition: branch.c:1844
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23119
SCIP_RETCODE SCIPnlpWrite(SCIP_NLP *nlp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *fname)
Definition: nlp.c:5690
int SCIPpropGetPresolPriority(SCIP_PROP *prop)
Definition: prop.c:917
#define SCIP_DECL_CONSGETVARS(x)
Definition: type_cons.h:780
SCIP_Real SCIPboundchgGetNewbound(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16340
SCIP_RETCODE SCIPsetConshdlrDelvars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELVARS((*consdelvars)))
Definition: scip.c:5749
SCIP_RETCODE SCIPchgVarType(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
Definition: scip.c:22681
SCIP_RETCODE SCIPvarChgBranchFactor(SCIP_VAR *var, SCIP_SET *set, SCIP_Real branchfactor)
Definition: var.c:10827
SCIP_RETCODE SCIPgetOrigVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:11063
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:20193
SCIP_RETCODE SCIPvarTryAggregateVars(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_CLIQUETABLE *cliquetable, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *aggregated)
Definition: var.c:4914
SCIP_SOL * SCIPgetReoptLastOptSol(SCIP *scip)
Definition: scip.c:14883
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:16850
void SCIPbranchruleSetPriority(SCIP_BRANCHRULE *branchrule, SCIP_SET *set, int priority)
Definition: branch.c:1907
#define SCIP_DECL_CONSEXIT(x)
Definition: type_cons.h:94
SCIP_Real SCIPgetNodeLowerbound(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:12228
#define SCIP_UNKNOWN
Definition: def.h:148
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:17123
struct SCIP_ReaderData SCIP_READERDATA
Definition: type_reader.h:37
SCIP_Bool userrestart
Definition: struct_stat.h:225
int SCIPpropGetNChgBds(SCIP_PROP *prop)
Definition: prop.c:1142
SCIP_RETCODE SCIPlpGetBasisInd(SCIP_LP *lp, int *basisind)
Definition: lp.c:9328
SCIP_Bool SCIPisTransformed(SCIP *scip)
Definition: scip.c:997
SCIP_Bool SCIPsetIsIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5325
SCIP_Real SCIPbranchruleGetTime(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1987
SCIP_SEPASTORE * sepastore
Definition: struct_scip.h:86
SCIP_RETCODE SCIPaddLinearCoefsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:29587
unsigned int vartype
Definition: struct_var.h:271
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
Definition: lpi_clp.cpp:3707
SCIP_Longint SCIPgetNDivingLPs(SCIP *scip)
Definition: scip.c:37803
unsigned int SCIP_EVENTTYPE
Definition: type_event.h:125
static SCIP_RETCODE printDualSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:35501
SCIP_Bool reopt_sepabestsol
Definition: struct_set.h:400
SCIP_RETCODE SCIPdialogCreate(SCIP_DIALOG **dialog, SCIP_DECL_DIALOGCOPY((*dialogcopy)), SCIP_DECL_DIALOGEXEC((*dialogexec)), SCIP_DECL_DIALOGDESC((*dialogdesc)), SCIP_DECL_DIALOGFREE((*dialogfree)), const char *name, const char *desc, SCIP_Bool issubmenu, SCIP_DIALOGDATA *dialogdata)
Definition: dialog.c:810
SCIP_NLROW ** SCIPgetNLPNlRows(SCIP *scip)
Definition: scip.c:28614
void SCIPnodePropagateAgain(SCIP_NODE *node, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree)
Definition: tree.c:1164
SCIP_RETCODE SCIPvarIncCutoffSum(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Real weight)
Definition: var.c:14819
SCIP_Bool SCIPisDualfeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:42181
SCIP_RETCODE SCIPconsGetNVars(SCIP_CONS *cons, SCIP_SET *set, int *nvars, SCIP_Bool *success)
Definition: cons.c:5972
SCIP_RETCODE SCIPrelaxationFree(SCIP_RELAXATION **relaxation)
Definition: relax.c:587
int SCIPgetNPresols(SCIP *scip)
Definition: scip.c:6348
void SCIPsepaSetInitsol(SCIP_SEPA *sepa, SCIP_DECL_SEPAINITSOL((*sepainitsol)))
Definition: sepa.c:611
SCIP_RETCODE SCIPsetPropResprop(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: scip.c:7106
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
Definition: scip.c:5479
SCIP_RETCODE SCIPsetSetHeuristics(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: set.c:3056
SCIP_Real SCIPlpGetRootLooseObjval(SCIP_LP *lp)
Definition: lp.c:19340
SCIP_Bool SCIPisPresolveFinished(SCIP *scip)
Definition: scip.c:1034
SCIP_RETCODE SCIPcreateCons(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
Definition: scip.c:24772
SCIP_RETCODE SCIPchgVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:19828
SCIP_Bool SCIPisSumLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41819
SCIP_RETCODE SCIPstopSolvingTime(SCIP *scip)
Definition: scip.c:40934
int SCIPgetPtrarrayMinIdx(SCIP *scip, SCIP_PTRARRAY *ptrarray)
Definition: scip.c:43007
SCIP_RETCODE SCIPsepastoreAddCut(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool root, SCIP_Bool *infeasible)
Definition: sepastore.c:554
SCIP_SOL * SCIPreoptGetLastBestSol(SCIP_REOPT *reopt)
Definition: reopt.c:4508
SCIP_RETCODE SCIPnlpEndDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:6108
SCIP_RETCODE SCIPaddClique(SCIP *scip, SCIP_VAR **vars, SCIP_Bool *values, int nvars, SCIP_Bool isequation, SCIP_Bool *infeasible, int *nbdchgs)
Definition: scip.c:21810
internal methods for user interface dialog
int SCIPreoptnodeGetNChildren(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:4654
void SCIPgetDiveBoundChangeData(SCIP *scip, SCIP_VAR ***variables, SCIP_BRANCHDIR **directions, SCIP_Real **values, int *ndivebdchgs, SCIP_Bool preferred)
Definition: scip.c:33065
SCIP_RETCODE SCIPpricerCreate(SCIP_PRICER **pricer, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_Bool delay, SCIP_DECL_PRICERCOPY((*pricercopy)), SCIP_DECL_PRICERFREE((*pricerfree)), SCIP_DECL_PRICERINIT((*pricerinit)), SCIP_DECL_PRICEREXIT((*pricerexit)), SCIP_DECL_PRICERINITSOL((*pricerinitsol)), SCIP_DECL_PRICEREXITSOL((*pricerexitsol)), SCIP_DECL_PRICERREDCOST((*pricerredcost)), SCIP_DECL_PRICERFARKAS((*pricerfarkas)), SCIP_PRICERDATA *pricerdata)
Definition: pricer.c:99
SCIP_RETCODE SCIPconshdlrPresolve(SCIP_CONSHDLR *conshdlr, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRESOLTIMING timing, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: cons.c:3693
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
Definition: scip.c:25097
SCIP_RETCODE SCIPreoptGetChildIDs(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int *childs, int childssize, int *nchilds)
Definition: reopt.c:5158
int SCIPgetNExternalCodes(SCIP *scip)
Definition: scip.c:8753
int SCIPtreeGetEffectiveRootDepth(SCIP_TREE *tree)
Definition: tree.c:8006
#define SCIP_Bool
Definition: def.h:53
SCIP_Bool SCIPinterrupted(void)
Definition: interrupt.c:147
#define SCIP_DECL_SEPAINIT(x)
Definition: type_sepa.h:63
SCIP_RETCODE SCIPnodeselCreate(SCIP_NODESEL **nodesel, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int stdpriority, int memsavepriority, SCIP_DECL_NODESELCOPY((*nodeselcopy)), SCIP_DECL_NODESELFREE((*nodeselfree)), SCIP_DECL_NODESELINIT((*nodeselinit)), SCIP_DECL_NODESELEXIT((*nodeselexit)), SCIP_DECL_NODESELINITSOL((*nodeselinitsol)), SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)), SCIP_DECL_NODESELSELECT((*nodeselselect)), SCIP_DECL_NODESELCOMP((*nodeselcomp)), SCIP_NODESELDATA *nodeseldata)
Definition: nodesel.c:745
#define SCIP_DECL_PRICERINITSOL(x)
Definition: type_pricer.h:81
SCIP_Real SCIPreaderGetReadingTime(SCIP_READER *reader)
Definition: reader.c:560
SCIP_RETCODE SCIPfreeSolve(SCIP *scip, SCIP_Bool restart)
Definition: scip.c:15306
SCIP_Real SCIPsetSumepsilon(SCIP_SET *set)
Definition: set.c:5074
void SCIPsetSortSepasName(SCIP_SET *set)
Definition: set.c:3681
int SCIPbranchcandGetNPrioExternConts(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:507
SCIP_Longint ndualresolvelps
Definition: struct_stat.h:152
SCIP_Longint SCIPgetSolNodenum(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:35279
SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: scip.c:6961
#define SCIP_DECL_PRESOLEXITPRE(x)
Definition: type_presol.h:102
#define SCIP_DECL_PROBEXITSOL(x)
Definition: type_prob.h:110
void SCIPvarCapture(SCIP_VAR *var)
Definition: var.c:2740
SCIP_CLOCK * sbsoltime
Definition: struct_stat.h:128
#define SCIP_DECL_NODESELEXIT(x)
Definition: type_nodesel.h:72
void SCIPreaderSetWrite(SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Definition: reader.c:499
SCIP_Bool SCIPboundchgIsRedundant(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16380
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip.c:4001
SCIP_RETCODE SCIPsetSetBarrierconvtol(SCIP_SET *set, SCIP_Real barrierconvtol)
Definition: set.c:4885
SCIP_RETCODE SCIPfreeIntarray(SCIP *scip, SCIP_INTARRAY **intarray)
Definition: scip.c:42641
#define BMSreallocBlockMemorySize(mem, ptr, oldsize, newsize)
Definition: memory.h:410
SCIP_Bool SCIPprobIsPermuted(SCIP_PROB *prob)
Definition: prob.c:2098
SCIP_NODESEL * SCIPsetFindNodesel(SCIP_SET *set, const char *name)
Definition: set.c:4010
void SCIPpresolSetFree(SCIP_PRESOL *presol, SCIP_DECL_PRESOLFREE((*presolfree)))
Definition: presol.c:498
void SCIPeventhdlrSetFree(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTFREE((*eventfree)))
Definition: event.c:320
SCIP_Real SCIPretransformObj(SCIP *scip, SCIP_Real obj)
Definition: scip.c:35198
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
Definition: scip.c:1216
SCIP_CLOCK * presolvingtime
Definition: struct_stat.h:117
SCIP_RETCODE SCIPdropRowEvent(SCIP *scip, SCIP_ROW *row, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:36748
SCIP_Longint SCIPsepaGetNCutoffs(SCIP_SEPA *sepa)
Definition: sepa.c:770
int SCIPcutGetAge(SCIP_CUT *cut)
Definition: cutpool.c:369
SCIP_RETCODE SCIPaddNewRowCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_ROW *row)
Definition: scip.c:31237
SCIP_RETCODE SCIPincludePropBasic(SCIP *scip, SCIP_PROP **propptr, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, SCIP_DECL_PROPEXEC((*propexec)), SCIP_PROPDATA *propdata)
Definition: scip.c:6908
SCIP_RETCODE SCIPsetBranchruleExecExt(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECEXT((*branchexecext)))
Definition: scip.c:8404
SCIP_Real SCIPcomputeVarUbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21428
int ncontvars
Definition: struct_prob.h:64
SCIP_Real SCIPgetVarAvgCutoffs(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:24077
SCIP_RETCODE SCIPsetComprExit(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPREXIT((*comprexit)))
Definition: scip.c:7579
SCIP_RETCODE SCIPcalcCliquePartition(SCIP *const scip, SCIP_VAR **const vars, int const nvars, int *const cliquepartition, int *const ncliques)
Definition: scip.c:21859
void SCIPinterruptFree(SCIP_INTERRUPT **interrupt)
Definition: interrupt.c:89
int SCIPtreeGetDepthLimit(SCIP_TREE *tree)
Definition: tree.c:7974
SCIP_RETCODE SCIPreoptCheckRestart(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR **transvars, int ntransvars, SCIP_Bool *restart)
Definition: reopt.c:4408
SCIP_RETCODE SCIPsetBranchruleMaxdepth(SCIP *scip, SCIP_BRANCHRULE *branchrule, int maxdepth)
Definition: scip.c:8488
SCIP_RETCODE SCIPsetPresolFree(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLFREE((*presolfree)))
Definition: scip.c:6242
void SCIPprintSysError(const char *message)
Definition: misc.c:8110
SCIP_NODE ** children
Definition: struct_tree.h:180
void SCIPdivesetUpdateStats(SCIP_DIVESET *diveset, SCIP_STAT *stat, int depth, int nprobingnodes, int nbacktracks, SCIP_Longint nsolsfound, SCIP_Longint nbestsolsfound, SCIP_Bool leavesol)
Definition: heur.c:108
int SCIPvarGetNImpls(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17335
SCIP_RETCODE SCIPconsEnfops(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
Definition: cons.c:7031
SCIP_Bool SCIPnlpHasCurrentNodeNLP(SCIP_NLP *nlp)
Definition: nlp.c:5234
SCIP_Bool SCIPpropDoesPresolve(SCIP_PROP *prop)
Definition: prop.c:1232
SCIP_COMPR * SCIPfindCompr(SCIP *scip, const char *name)
Definition: scip.c:7627
int nbinvars
Definition: struct_prob.h:61
SCIP_Longint SCIPconshdlrGetNEnfoLPCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4461
enum SCIP_Objsense SCIP_OBJSENSE
Definition: type_prob.h:41
SCIP_Longint SCIPgetNConflictConssFound(SCIP *scip)
Definition: scip.c:38057
SCIP_RETCODE SCIPlpFree(SCIP_LP **lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter)
Definition: lp.c:8890
enum SCIP_Status SCIP_STATUS
Definition: type_stat.h:57
static const char * paramname[]
Definition: lpi_msk.c:4201
#define SCIP_DECL_DISPFREE(x)
Definition: type_disp.h:70
SCIP_RETCODE SCIPsetConshdlrGetDiveBdChgs(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)))
Definition: scip.c:5864
SCIP_NLPSOLSTAT SCIPnlpGetSolstat(SCIP_NLP *nlp)
Definition: nlp.c:5928
void SCIPconsSetModifiable(SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: cons.c:6310
SCIP_Bool SCIPconflictApplicable(SCIP_SET *set)
Definition: conflict.c:2497
SCIP_VAR ** origobjvars
Definition: struct_tree.h:50
SCIP_Longint SCIPconshdlrGetNRespropCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4501
int npresolrounds
Definition: struct_stat.h:189
#define SCIP_DECL_PROPFREE(x)
Definition: type_prop.h:55
SCIP_RETCODE SCIPwriteImplicationConflictGraph(SCIP *scip, const char *filename)
Definition: scip.c:40681
SCIP_RETCODE SCIPlinkCurrentSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:34753
SCIP_Real SCIPgetAvgConflictlengthScoreCurrentRun(SCIP *scip)
Definition: scip.c:39012
SCIP_STAGE SCIPgetStage(SCIP *scip)
Definition: scip.c:801
SCIP_Real SCIPgetVarConflictScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23645
SCIP_RETCODE SCIPsolIncVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_VAR *var, SCIP_Real incval)
Definition: sol.c:1169
SCIP_Real SCIPsolGetOrigObj(SCIP_SOL *sol)
Definition: sol.c:2189
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
Definition: cons.c:7859
SCIP_RETCODE SCIPtreeCreateRoot(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:4726
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
Definition: scip.c:3709
SCIP_RETCODE SCIPconsRelease(SCIP_CONS **cons, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: cons.c:5857
SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
Definition: scip.c:6702
SCIP_Real SCIPgetAvgCutoffsCurrentRun(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:39141
SCIP_EVENTHDLR ** SCIPgetEventhdlrs(SCIP *scip)
Definition: scip.c:7921
SCIP_CONSHDLR * conshdlr
Definition: struct_cons.h:43
SCIP_RETCODE SCIPsetEventhdlrExitsol(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXITSOL((*eventexitsol)))
Definition: scip.c:7880
SCIP_RETCODE SCIPprintRay(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:35632
SCIP_Real SCIPgetRowPseudoFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28205
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
Definition: scip.c:4563
SCIP_RETCODE SCIPsetSepaExitsol(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
Definition: scip.c:6782
void SCIPconshdlrSetDelete(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
Definition: cons.c:4099
SCIP_Real lastlowerbound
Definition: struct_stat.h:113
union SCIP_Node::@9 data
SCIP_RETCODE SCIPsolCreate(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_HEUR *heur)
Definition: sol.c:274
SCIP_RETCODE SCIPnlpAddNlRow(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLROW *nlrow)
Definition: nlp.c:5391
SCIP_RETCODE SCIPaddRowProbing(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:32840
void SCIPtreeGetDiveBoundChangeData(SCIP_TREE *tree, SCIP_VAR ***variables, SCIP_BRANCHDIR **directions, SCIP_Real **values, int *ndivebdchgs, SCIP_Bool preferred)
Definition: tree.c:6055
SCIP_Bool SCIPisDualfeasFracIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:42193
SCIP_RETCODE SCIPaddSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *stored)
Definition: scip.c:36032
SCIP_RETCODE SCIPgetExprtreeTransformedVars(SCIP *scip, SCIP_EXPRTREE *tree)
Definition: scip.c:30235
void SCIPnodeselSetMemsavePriority(SCIP_NODESEL *nodesel, SCIP_SET *set, int priority)
Definition: nodesel.c:1046
internal methods for input file readers
SCIP_RETCODE SCIPlpGetBInvRow(SCIP_LP *lp, int r, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9362
void SCIPconshdlrSetInit(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
Definition: cons.c:4004
int mem_arraygrowinit
Definition: struct_set.h:305
SCIP_RETCODE SCIPchgNlRowLinearCoef(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real coef)
Definition: scip.c:29624
SCIP_Longint SCIPsolGetNodenum(SCIP_SOL *sol)
Definition: sol.c:2232
SCIP_Real SCIPgetFirstLPLowerboundRoot(SCIP *scip)
Definition: scip.c:38483
SCIP_Real SCIPvarGetWorstBoundGlobal(SCIP_VAR *var)
Definition: var.c:17100
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:175
int SCIPgetNConflicthdlrs(SCIP *scip)
Definition: scip.c:6116
SCIP_RETCODE SCIPrealarrayFree(SCIP_REALARRAY **realarray)
Definition: misc.c:2403
SCIP_Real SCIPgetPseudoObjval(SCIP *scip)
Definition: scip.c:26568
SCIP_RETCODE SCIPclearBoolarray(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:42828
SCIP_Bool SCIPhaveVarsCommonClique(SCIP *scip, SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
Definition: scip.c:22165
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
Definition: scip.c:4382
SCIP_RETCODE SCIPvarChgUbDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newbound)
Definition: var.c:7822
SCIP_RETCODE SCIPsetGetIntParam(SCIP_SET *set, const char *name, int *value)
Definition: set.c:2608
SCIP_RETCODE SCIPnlpFlush(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:5474
SCIP_RETCODE SCIPprintReoptStatistics(SCIP *scip, FILE *file)
Definition: scip.c:40436
SCIP_RETCODE SCIPcopyVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global)
Definition: scip.c:2179
SCIP_HEUR ** heurs
Definition: struct_set.h:74
SCIP_Bool SCIPlpDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:19413
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:27811
SCIP_RETCODE SCIPsetRelaxInitsol(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXINITSOL((*relaxinitsol)))
Definition: scip.c:6521
SCIP_CONS * SCIPfindCons(SCIP *scip, const char *name)
Definition: scip.c:11641
SCIP_Bool branch_roundsbsol
Definition: struct_set.h:156
SCIP_RETCODE SCIPsetIncludeExternalCode(SCIP_SET *set, const char *name, const char *description)
Definition: set.c:4309
SCIP_Longint nrepropcutoffs
Definition: struct_stat.h:76
void SCIPmessagehdlrSetQuiet(SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: message.c:395
#define SCIP_DECL_CONSEXITPRE(x)
Definition: type_cons.h:138
SCIP_Real SCIPgetVarFarkasCoef(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:17585
int probingsumchgdobjs
Definition: struct_tree.h:212
#define MAX(x, y)
Definition: tclique_def.h:75
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
Definition: misc.c:8245
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip.c:24369
SCIP_RETCODE SCIPsolRetransform(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_Bool *hasinfval)
Definition: sol.c:1705
void SCIPprobSetTrans(SCIP_PROB *prob, SCIP_DECL_PROBTRANS((*probtrans)))
Definition: prob.c:339
SCIP_Real SCIPgetLocalDualbound(SCIP *scip)
Definition: scip.c:12172
SCIP_RETCODE SCIPgetTransformedConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip.c:25490
void SCIPsetSortNlpis(SCIP_SET *set)
Definition: set.c:4281
SCIP_Real SCIPgetLocalLowerbound(SCIP *scip)
Definition: scip.c:12191
int nreaders
Definition: struct_set.h:86
SCIP_Real SCIPpricerGetTime(SCIP_PRICER *pricer)
Definition: pricer.c:624
SCIP_RETCODE SCIPsetCopyParams(SCIP_SET *sourceset, SCIP_SET *targetset, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:1005
int SCIPgetNPrioPseudoBranchImpls(SCIP *scip)
Definition: scip.c:33562
SCIP_RETCODE SCIPflattenVarAggregationGraph(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:17329
#define SCIP_DECL_PRESOLINIT(x)
Definition: type_presol.h:62
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
Definition: scip.c:34271
SCIP_Real SCIPfeasRound(SCIP *scip, SCIP_Real val)
Definition: scip.c:42056
SCIP_RETCODE SCIPchgBarrierconvtol(SCIP *scip, SCIP_Real barrierconvtol)
Definition: scip.c:41286
SCIP_Real SCIPsetDualfeasFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5991
#define SCIP_CALL_QUIET(x)
Definition: def.h:241
int SCIPnlrowGetNQuadVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3265
SCIP_Longint SCIPbranchruleGetNChildren(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2069
int SCIPgetNPricevarsApplied(SCIP *scip)
Definition: scip.c:37963
SCIP_Longint SCIPgetNResolveLPIterations(SCIP *scip)
Definition: scip.c:37637
methods for debugging
SCIP_Bool * SCIPcliqueGetValues(SCIP_CLIQUE *clique)
Definition: implics.c:3123
SCIP_Bool SCIPisRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42322
SCIP_Real SCIPgetTransGap(SCIP *scip)
Definition: scip.c:38694
void SCIPheurSetFree(SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: heur.c:1092
int SCIPreoptGetNTotalCutoffReoptnodes(SCIP_REOPT *reopt)
Definition: reopt.c:3936
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
Definition: cons.c:7869
SCIP_RETCODE SCIPaddConsLocks(SCIP *scip, SCIP_CONS *cons, int nlockspos, int nlocksneg)
Definition: scip.c:25840
SCIP_Bool SCIPconsIsAdded(SCIP_CONS *cons)
Definition: cons.c:7969
SCIP_RETCODE SCIPprobCheckObjIntegral(SCIP_PROB *transprob, SCIP_PROB *origprob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue)
Definition: prob.c:1430
SCIP_Longint SCIPgetNNodeLPs(SCIP *scip)
Definition: scip.c:37731
SCIP_Longint lastdivenode
Definition: struct_stat.h:82
SCIP_RETCODE SCIPtreeStartProbing(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp, SCIP_Bool strongbranching)
Definition: tree.c:6177
SCIP_Bool SCIPallowObjProp(SCIP *scip)
Definition: scip.c:23093
SCIP_Real SCIPgetTotalTime(SCIP *scip)
Definition: scip.c:40982
void SCIPnodeselSetExit(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXIT((*nodeselexit)))
Definition: nodesel.c:1116
SCIP_RETCODE SCIPsepastoreFree(SCIP_SEPASTORE **sepastore)
Definition: sepastore.c:105
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
Definition: cons.c:7739
SCIP_Bool SCIPsetIsRelLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6079
#define SCIP_DECL_PROPINITSOL(x)
Definition: type_prop.h:115
int lastnpresolchgcoefs
Definition: struct_stat.h:211
int SCIPpresolGetNAggrVars(SCIP_PRESOL *presol)
Definition: presol.c:681
void SCIPcolSetStrongbranchData(SCIP_COL *col, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_Real lpobjval, SCIP_Real primsol, SCIP_Real sbdown, SCIP_Real sbup, SCIP_Bool sbdownvalid, SCIP_Bool sbupvalid, SCIP_Longint iter, int itlim)
Definition: lp.c:4016
SCIP_Bool SCIPisDualfeasNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:42169
SCIP_Real SCIPsetDualfeasRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5980
void SCIPconsSetRemovable(SCIP_CONS *cons, SCIP_Bool removable)
Definition: cons.c:6332
SCIP_Real SCIPvarGetMultaggrUbGlobal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:8115
SCIP_RETCODE SCIPsetRelaxSolVals(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:17757
void SCIPpresolSetInit(SCIP_PRESOL *presol, SCIP_DECL_PRESOLINIT((*presolinit)))
Definition: presol.c:509
SCIP_RETCODE SCIPchgVarBranchFactor(SCIP *scip, SCIP_VAR *var, SCIP_Real branchfactor)
Definition: scip.c:22400
SCIP_RETCODE SCIPsetBranchrulePriority(SCIP *scip, SCIP_BRANCHRULE *branchrule, int priority)
Definition: scip.c:8473
SCIP_Bool SCIPprobAllColsInLP(SCIP_PROB *prob, SCIP_SET *set, SCIP_LP *lp)
Definition: prob.c:2140
SCIP_RETCODE SCIPprobRemoveConsName(SCIP_PROB *prob, SCIP_CONS *cons)
Definition: prob.c:1212
SCIP_Real SCIPclockGetTimeOfDay(void)
Definition: clock.c:600
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
Definition: scip.c:41396
SCIP_RETCODE SCIPconshdlrSetPresol(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
Definition: cons.c:4070
SCIP_Real SCIPbarrierconvtol(SCIP *scip)
Definition: scip.c:41188
int SCIPgetNCliques(SCIP *scip)
Definition: scip.c:22108
SCIP_RETCODE SCIPsetComprCopy(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRCOPY((*comprcopy)))
Definition: scip.c:7531
SCIP_RETCODE SCIPcutpoolCreate(SCIP_CUTPOOL **cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, int agelimit, SCIP_Bool globalcutpool)
Definition: cutpool.c:404
SCIP_RETCODE SCIPnlrowGetNLPActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *activity)
Definition: nlp.c:2915
SCIP_Bool SCIPisRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42309
SCIP_Real SCIPgetLPColumnObjval(SCIP *scip)
Definition: scip.c:26500
SCIP_Longint SCIPconflictGetNStrongbranchConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:6707
const char * SCIPcomprGetName(SCIP_COMPR *compr)
Definition: compr.c:409
SCIP_RETCODE SCIPaddVarVlb(SCIP *scip, SCIP_VAR *var, SCIP_VAR *vlbvar, SCIP_Real vlbcoef, SCIP_Real vlbconstant, SCIP_Bool *infeasible, int *nbdchgs)
Definition: scip.c:21563
SCIP_RETCODE SCIPfixVarProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval)
Definition: scip.c:32415
SCIP_RETCODE SCIPscaleVarBranchFactor(SCIP *scip, SCIP_VAR *var, SCIP_Real scale)
Definition: scip.c:22428
SCIP_RETCODE SCIPpricestoreAddVar(SCIP_PRICESTORE *pricestore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_VAR *var, SCIP_Real score, SCIP_Bool root)
Definition: pricestore.c:170
SCIP_Real SCIPgetColRedcost(SCIP *scip, SCIP_COL *col)
Definition: scip.c:27402
SCIP_RETCODE SCIPpropagateDomains(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CONFLICT *conflict, SCIP_CLIQUETABLE *cliquetable, int depth, int maxproprounds, SCIP_PROPTIMING timingmask, SCIP_Bool *cutoff)
Definition: solve.c:566
static SCIP_RETCODE checkSolOrig(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *feasible, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool checkmodifiable)
Definition: scip.c:12420
SCIP_RETCODE SCIPsetPresolExit(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
Definition: scip.c:6274
SCIP_RETCODE SCIPtransformCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
Definition: scip.c:25360
SCIP_RETCODE SCIPlinkNLPSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:34674
SCIP_RETCODE SCIPcopyOrigConss(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool enablepricing, SCIP_Bool *valid)
Definition: scip.c:2690
SCIP_Real SCIPvarGetAvgInferencesCurrentRun(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15320
SCIP_Bool SCIPtreeHasCurrentNodeLP(SCIP_TREE *tree)
Definition: tree.c:7984
SCIP_RETCODE SCIPaddConflictRelaxedLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedlb)
Definition: scip.c:24403
SCIP_Real SCIPgetAvgCutoffs(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:39121
int SCIPboolarrayGetMinIdx(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:3431
SCIP_RETCODE SCIPdialoghdlrSetRoot(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
Definition: dialog.c:402
int SCIPgetNHeurs(SCIP *scip)
Definition: scip.c:7419
SCIP_Longint SCIPgetNPrimalResolveLPs(SCIP *scip)
Definition: scip.c:37655
#define SCIP_PRESOLTIMING_ALWAYS
Definition: type_timing.h:48
SCIP_Real limit_memory
Definition: struct_set.h:232
SCIP_RETCODE SCIPlpCreate(SCIP_LP **lp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, const char *name)
Definition: lp.c:8657
int SCIPpresolGetNFixedVars(SCIP_PRESOL *presol)
Definition: presol.c:671
int SCIPvarGetMultaggrNVars(SCIP_VAR *var)
Definition: var.c:16825
SCIP_RETCODE SCIPsetSetDefaultBoolParam(SCIP_SET *set, const char *name, SCIP_Bool defaultvalue)
Definition: set.c:2744
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
Definition: scip.c:32153
SCIP_RETCODE SCIPnlrowChgExprtree(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_EXPRTREE *exprtree)
Definition: nlp.c:2678
SCIP_Real SCIPgetVarPseudocostCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23300
SCIP_PARAM ** SCIPgetParams(SCIP *scip)
Definition: scip.c:4477
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
Definition: scip.c:5611
SCIP_Longint SCIPgetNRootStrongbranchs(SCIP *scip)
Definition: scip.c:37875
int SCIPgetNRuns(SCIP *scip)
Definition: scip.c:37318
SCIP_Longint SCIPgetNPrimalResolveLPIterations(SCIP *scip)
Definition: scip.c:37675
void SCIPmarkRowNotRemovableLocal(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28027
#define SCIPreallocMemoryArray(scip, ptr, newnum)
Definition: scip.h:20534
SCIP_RETCODE SCIPsetAddStringParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: set.c:2550
#define BMScopyMemoryArray(ptr, source, num)
Definition: memory.h:89
SCIP_RETCODE SCIPsetNodeselFree(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELFREE((*nodeselfree)))
Definition: scip.c:8044
SCIP_RETCODE SCIPchgVarBranchPriority(SCIP *scip, SCIP_VAR *var, int branchpriority)
Definition: scip.c:22487
#define SCIP_DECL_DIALOGFREE(x)
Definition: type_dialog.h:61
int SCIPgetVarNStrongbranchs(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19366
#define SCIP_DECL_COMPREXIT(x)
Definition: type_compr.h:73
SCIP_RETCODE SCIPsetSetCharParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, char value)
Definition: set.c:2910
SCIP_Bool SCIPsetIsSumNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5523
SCIP_RETCODE SCIPaddLinearCoefToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:29563
SCIP_RETCODE SCIPprintOrigProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:39265
SCIP_Real maxcopytime
Definition: struct_stat.h:104
int SCIPnlpGetNVars(SCIP_NLP *nlp)
Definition: nlp.c:5751
int SCIPconflictGetNConflicts(SCIP_CONFLICT *conflict)
Definition: conflict.c:2362
SCIP_Real * SCIPvarGetMultaggrScalars(SCIP_VAR *var)
Definition: var.c:16849
SCIP_HEUR * SCIPsetFindHeur(SCIP_SET *set, const char *name)
Definition: set.c:3812
SCIP_Longint SCIPconflictGetNBoundexceedingLPCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:6369
SCIP_RETCODE SCIPsetHeurExitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
Definition: scip.c:7377
void SCIPgmlWriteNodeWeight(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor, SCIP_Real weight)
Definition: misc.c:343
SCIP_Longint SCIPsetGetMemExternEstim(SCIP_SET *set)
Definition: set.c:4758
SCIP_RETCODE SCIPendProbing(SCIP *scip)
Definition: scip.c:32285
SCIP_RETCODE SCIPconflictInit(SCIP_CONFLICT *conflict, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob)
Definition: conflict.c:2635
SCIP_RETCODE SCIPseparateSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool pretendroot, SCIP_Bool onlydelayed, SCIP_Bool *delayed, SCIP_Bool *cutoff)
Definition: scip.c:31435
SCIP_Longint SCIPdivesetGetNLPIterations(SCIP_DIVESET *diveset)
Definition: heur.c:445
#define SCIP_PROPTIMING_BEFORELP
Definition: type_timing.h:54
SCIP_RETCODE SCIPseparationRound(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_SEPASTORE *sepastore, SCIP_SOL *sol, int actdepth, SCIP_Bool onlydelayed, SCIP_Bool *delayed, SCIP_Bool *cutoff)
Definition: solve.c:1768
reoptsols primal heuristic
SCIP_Real SCIPbranchGetScoreMultiple(SCIP_SET *set, SCIP_VAR *var, int nchildren, SCIP_Real *gains)
Definition: branch.c:2146
SCIP_RETCODE SCIPnlrowGetActivityBounds(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: nlp.c:3169
SCIP_ROW ** SCIPgetCuts(SCIP *scip)
Definition: scip.c:31467
SCIP_SEPA * SCIPfindSepa(SCIP *scip, const char *name)
Definition: scip.c:6798
internal methods for storing cuts in a cut pool
char sepa_efficacynorm
Definition: struct_set.h:423
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:5577
void SCIPpresolSetExit(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
Definition: presol.c:520
static SCIP_Real getLowerbound(SCIP *scip)
Definition: scip.c:462
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:4431
SCIP_DISP * SCIPsetFindDisp(SCIP_SET *set, const char *name)
Definition: set.c:4174
Constraint handler for linear constraints in their most general form, .
SCIP_RETCODE SCIPvarCopy(SCIP_VAR **var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP *sourcescip, SCIP_VAR *sourcevar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global)
Definition: var.c:2081
void SCIPbranchruleSetExecPs(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECPS((*branchexecps)))
Definition: branch.c:1866
SCIP_Real SCIPvarGetRelaxSol(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:13177
SCIP_RETCODE SCIPchgStringParam(SCIP *scip, SCIP_PARAM *param, const char *value)
Definition: scip.c:4191
int nconflicthdlrs
Definition: struct_set.h:93
SCIP_Real SCIPfrac(SCIP *scip, SCIP_Real val)
Definition: scip.c:41794
SCIP_RETCODE SCIPcopyOrigVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap)
Definition: scip.c:2233
static void printTimingStatistics(SCIP *scip, FILE *file)
Definition: scip.c:40263
SCIP_Real SCIPgetBranchingPoint(SCIP *scip, SCIP_VAR *var, SCIP_Real suggestion)
Definition: scip.c:33628
SCIP_Real SCIProwGetSolEfficacy(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6544
SCIP_RETCODE SCIPsetIncludeNodesel(SCIP_SET *set, SCIP_NODESEL *nodesel)
Definition: set.c:3979
#define SCIP_DECL_SEPAEXITSOL(x)
Definition: type_sepa.h:93
#define SCIP_DECL_SEPAEXECSOL(x)
Definition: type_sepa.h:138
SCIP_RETCODE SCIPgetLongintParam(SCIP *scip, const char *name, SCIP_Longint *value)
Definition: scip.c:3778
static void printPresolverStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39337
SCIP_Bool SCIPisNLPEnabled(SCIP *scip)
Definition: scip.c:28369
int reopt_savesols
Definition: struct_set.h:396
SCIP_RETCODE SCIPchgVarObjDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real coef)
Definition: scip.c:29240
int SCIPconshdlrGetMaxNActiveConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4591
SCIP_Real ub
Definition: struct_lp.h:127
void SCIPpricerSetInitsol(SCIP_PRICER *pricer, SCIP_DECL_PRICERINITSOL((*pricerinitsol)))
Definition: pricer.c:528
SCIP_Longint SCIPhistoryGetNBranchings(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:616
SCIP_RETCODE SCIPsetSepaPriority(SCIP *scip, SCIP_SEPA *sepa, int priority)
Definition: scip.c:6835
SCIP_Bool cutoffdelayed
Definition: struct_tree.h:216
SCIP_RETCODE SCIPpricerActivate(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:305
SCIP_RETCODE SCIPincludeCompr(SCIP *scip, const char *name, const char *desc, int priority, int minnnodes, SCIP_DECL_COMPRCOPY((*comprcopy)), SCIP_DECL_COMPRFREE((*comprfree)), SCIP_DECL_COMPRINIT((*comprinit)), SCIP_DECL_COMPREXIT((*comprexit)), SCIP_DECL_COMPRINITSOL((*comprinitsol)), SCIP_DECL_COMPREXITSOL((*comprexitsol)), SCIP_DECL_COMPREXEC((*comprexec)), SCIP_COMPRDATA *comprdata)
Definition: scip.c:7450
SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5600
void SCIPprobPrintStatistics(SCIP_PROB *prob, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: prob.c:2057
SCIP_RETCODE SCIPcliquetableAdd(SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR **vars, SCIP_Bool *values, int nvars, SCIP_Bool isequation, SCIP_Bool *infeasible, int *nbdchgs)
Definition: implics.c:2240
SCIP_RETCODE SCIPprimalHeuristics(SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_NODE *nextnode, SCIP_HEURTIMING heurtiming, SCIP_Bool nodeinfeasible, SCIP_Bool *foundsol)
Definition: solve.c:170
SCIP_PRICER ** SCIPgetPricers(SCIP *scip)
Definition: scip.c:4993
SCIP_Real SCIPgetVarRedcost(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:17497
void SCIPprobSetObjlim(SCIP_PROB *prob, SCIP_Real objlim)
Definition: prob.c:1407
int SCIPconshdlrGetNUpgdConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4681
SCIP_Longint SCIPconflictGetNBoundexceedingLPReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:6419
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
Definition: scip.c:36779
SCIP_RETCODE SCIPincSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real incval)
Definition: scip.c:34940
SCIP_RETCODE SCIPsetBranchruleExitsol(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXITSOL((*branchexitsol)))
Definition: scip.c:8370
SCIP_RETCODE SCIPsetPropInitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
Definition: scip.c:7009
SCIP_Bool SCIPsetIsSumEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5411
SCIP_RETCODE SCIPvarIncNActiveConflicts(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Real length)
Definition: var.c:14391
SCIP_Real SCIPnodeGetEstimate(SCIP_NODE *node)
Definition: tree.c:7046
int SCIPgetDepth(SCIP *scip)
Definition: scip.c:38140
SCIP_Real SCIPgetRelaxSolVal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:17904
int nfixedvars
Definition: struct_prob.h:67
#define SCIP_DECL_CONSENFOPS(x)
Definition: type_cons.h:356
int SCIPpresolGetNChgVarTypes(SCIP_PRESOL *presol)
Definition: presol.c:691
void SCIPrelaxationSetSolObj(SCIP_RELAXATION *relaxation, SCIP_Real obj)
Definition: relax.c:641
int SCIPdivesetGetMinSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:415
SCIP_RETCODE SCIPnlrowGetSolActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *activity)
Definition: nlp.c:3063
int SCIPgetNDisps(SCIP *scip)
Definition: scip.c:8584
void SCIPconshdlrSetGetNVars(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
Definition: cons.c:4231
SCIP_RETCODE SCIPsetGetCharParam(SCIP_SET *set, const char *name, char *value)
Definition: set.c:2650
int SCIPgetNPrioExternBranchInts(SCIP *scip)
Definition: scip.c:33334
SCIP_RETCODE SCIProwDropEvent(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: lp.c:7504
SCIP_RETCODE SCIPlinkLPSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:34648
SCIP_Bool SCIPhasPrimalRay(SCIP *scip)
Definition: scip.c:36498
SCIP_RETCODE SCIPsolPrintRay(SCIP_SOL *sol, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PROB *transprob, FILE *file, SCIP_Bool printzeros)
Definition: sol.c:2034
SCIP * scip
Definition: struct_var.h:199
int SCIPgetNBranchrules(SCIP *scip)
Definition: scip.c:8462
int SCIPdivesetGetMaxDepth(SCIP_DIVESET *diveset)
Definition: heur.c:395
SCIP_RETCODE SCIPgetChildren(SCIP *scip, SCIP_NODE ***children, int *nchildren)
Definition: scip.c:36851
void SCIPstoreSolutionGap(SCIP *scip)
Definition: scip.c:637
static SCIP_RETCODE freeSolve(SCIP *scip, SCIP_Bool restart)
Definition: scip.c:13913
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
Definition: sol.c:2179
SCIP_Real SCIPgetVarPseudocostCount(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23326
SCIP_RETCODE SCIPparseVarsPolynomial(SCIP *scip, const char *str, SCIP_VAR ****monomialvars, SCIP_Real ***monomialexps, SCIP_Real **monomialcoefs, int **monomialnvars, int *nmonomials, char **endptr, SCIP_Bool *success)
Definition: scip.c:16442
SCIP_Real SCIPtransformObj(SCIP *scip, SCIP_Real obj)
Definition: scip.c:35173
SCIP_RETCODE SCIPconshdlrCreate(SCIP_CONSHDLR **conshdlr, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int sepapriority, int enfopriority, int checkpriority, int sepafreq, int propfreq, int eagerfreq, int maxprerounds, SCIP_Bool delaysepa, SCIP_Bool delayprop, SCIP_Bool needscons, SCIP_PROPTIMING proptiming, SCIP_PRESOLTIMING presoltiming, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSFREE((*consfree)), SCIP_DECL_CONSINIT((*consinit)), SCIP_DECL_CONSEXIT((*consexit)), SCIP_DECL_CONSINITPRE((*consinitpre)), SCIP_DECL_CONSEXITPRE((*consexitpre)), SCIP_DECL_CONSINITSOL((*consinitsol)), SCIP_DECL_CONSEXITSOL((*consexitsol)), SCIP_DECL_CONSDELETE((*consdelete)), SCIP_DECL_CONSTRANS((*constrans)), SCIP_DECL_CONSINITLP((*consinitlp)), SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSPROP((*consprop)), SCIP_DECL_CONSPRESOL((*conspresol)), SCIP_DECL_CONSRESPROP((*consresprop)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_DECL_CONSACTIVE((*consactive)), SCIP_DECL_CONSDEACTIVE((*consdeactive)), SCIP_DECL_CONSENABLE((*consenable)), SCIP_DECL_CONSDISABLE((*consdisable)), SCIP_DECL_CONSDELVARS((*consdelvars)), SCIP_DECL_CONSPRINT((*consprint)), SCIP_DECL_CONSCOPY((*conscopy)), SCIP_DECL_CONSPARSE((*consparse)), SCIP_DECL_CONSGETVARS((*consgetvars)), SCIP_DECL_CONSGETNVARS((*consgetnvars)), SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)), SCIP_CONSHDLRDATA *conshdlrdata)
Definition: cons.c:1980
#define SCIPallocClearMemoryArray(scip, ptr, num)
Definition: scip.h:20530
void SCIPsetEnableOrDisablePluginClocks(SCIP_SET *set, SCIP_Bool enabled)
Definition: set.c:741
void SCIPconshdlrSetParse(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
Definition: cons.c:4209
int SCIPnlpiGetPriority(SCIP_NLPI *nlpi)
Definition: nlpi.c:760
SCIP_PROP ** SCIPgetProps(SCIP *scip)
Definition: scip.c:7136
SCIP_PARAM * SCIPsetGetParam(SCIP_SET *set, const char *name)
Definition: set.c:2583
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip.c:1298
SCIP_RETCODE SCIPsolAdjustImplicitSolVals(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_Bool uselprows)
Definition: sol.c:423
SCIP_RETCODE SCIPgetVarClosestVub(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvub, int *closestvubidx)
Definition: scip.c:21534
SCIP_RETCODE SCIPcreateWallClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:40750
SCIP_CLOCK * lexduallptime
Definition: struct_stat.h:121
SCIP_RETCODE SCIPbranchcandFree(SCIP_BRANCHCAND **branchcand)
Definition: branch.c:171
int SCIPgetNCutsApplied(SCIP *scip)
Definition: scip.c:38033
SCIP_RETCODE SCIPbranchLP(SCIP *scip, SCIP_RESULT *result)
Definition: scip.c:33918
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
Definition: scip.c:7345
SCIP_Longint nnodesbeforefirst
Definition: struct_stat.h:92
void SCIPbranchruleSetInitsol(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINITSOL((*branchinitsol)))
Definition: branch.c:1820
SCIP_RETCODE SCIPincludeDialog(SCIP *scip, SCIP_DIALOG **dialog, SCIP_DECL_DIALOGCOPY((*dialogcopy)), SCIP_DECL_DIALOGEXEC((*dialogexec)), SCIP_DECL_DIALOGDESC((*dialogdesc)), SCIP_DECL_DIALOGFREE((*dialogfree)), const char *name, const char *desc, SCIP_Bool issubmenu, SCIP_DIALOGDATA *dialogdata)
Definition: scip.c:8798
SCIP_CONFLICTHDLR * SCIPfindConflicthdlr(SCIP *scip, const char *name)
Definition: scip.c:6090
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41624
SCIP_RETCODE SCIPchgVarLbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:19898
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: scip.c:7329
SCIP_Longint SCIPconvertRealToLongint(SCIP *scip, SCIP_Real real)
Definition: scip.c:42431
SCIP_Longint SCIPpropGetNCalls(SCIP_PROP *prop)
Definition: prop.c:1042
#define SCIP_DECL_READERCOPY(x)
Definition: type_reader.h:46
SCIP_RETCODE SCIPptrarrayClear(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:3664
SCIP_Real SCIPsetFeasFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5780
static SCIP_RETCODE writeProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool transformed, SCIP_Bool genericnames)
Definition: scip.c:9395
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
enum SCIP_ParamEmphasis SCIP_PARAMEMPHASIS
Definition: type_paramset.h:70
SCIP_RETCODE SCIPnlpSolve(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat)
Definition: nlp.c:5511
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
Definition: var.c:17431
int SCIPgetNTotalVars(SCIP *scip)
Definition: scip.c:11275
SCIP_RETCODE SCIPlpReset(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter)
Definition: lp.c:8934
SCIP_RETCODE SCIPwriteVarsLinearsum(SCIP *scip, FILE *file, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Bool type)
Definition: scip.c:15966
SCIP_RETCODE SCIPcolGetStrongbranches(SCIP_COL **cols, int ncols, SCIP_Bool integral, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_LP *lp, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Bool *lperror)
Definition: lp.c:4264
SCIP_Bool SCIPsetIsDualfeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5912
int SCIPgetNPrioExternBranchConts(SCIP *scip)
Definition: scip.c:33374
int SCIPpropGetNFixedVars(SCIP_PROP *prop)
Definition: prop.c:1112
SCIP_RETCODE SCIPinferVarLbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:20469
SCIP_Real SCIProwGetMaxActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6371
SCIP_RETCODE SCIPgetLPBasisInd(SCIP *scip, int *basisind)
Definition: scip.c:26866
int SCIPparamGetInt(SCIP_PARAM *param)
Definition: paramset.c:706
SCIP_Bool reopt_sepaglbinfsubtrees
Definition: struct_set.h:399
SCIP_RETCODE SCIPinferVarFixCons(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:20400
SCIP_Real rhs
Definition: struct_lp.h:193
SCIP_RETCODE SCIPsetGetRealParam(SCIP_SET *set, const char *name, SCIP_Real *value)
Definition: set.c:2636
static SCIP_RETCODE solveProbingLP(SCIP *scip, int itlim, SCIP_Bool pricing, SCIP_Bool pretendroot, SCIP_Bool displayinfo, int maxpricerounds, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:32679
SCIP_Longint SCIPconflictGetNPseudoCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:6921
int SCIPconshdlrGetNPresolCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4711
SCIP_RETCODE SCIPchgLpfeastol(SCIP *scip, SCIP_Real lpfeastol, SCIP_Bool printnewvalue)
Definition: scip.c:41235
SCIP_Longint nrootlpiterations
Definition: struct_stat.h:47
void SCIPprintVersion(SCIP *scip, FILE *file)
Definition: scip.c:595
SCIP_Bool SCIPisSumRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42348
SCIP_CLIQUE ** SCIPgetCliques(SCIP *scip)
Definition: scip.c:22135
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:36668
SCIP_Real SCIPgetRowPseudoActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28188
#define SCIP_DECL_VARDELORIG(x)
Definition: type_var.h:107
SCIP_RETCODE SCIPaddObjoffset(SCIP *scip, SCIP_Real addval)
Definition: scip.c:10040
SCIP_RETCODE SCIPtreeFree(SCIP_TREE **tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:4619
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
Definition: scip.c:5565
int SCIPpropGetNChgCoefs(SCIP_PROP *prop)
Definition: prop.c:1192
SCIP_Real SCIPlpGetLooseObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:15115
internal methods for return codes for SCIP methods
SCIP_Real SCIPhistoryGetCutoffSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:655
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:11477
SCIP_RETCODE SCIPchgVarObjProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip.c:32471
SCIP_COMPR ** comprs
Definition: struct_set.h:75
SCIP_RETCODE SCIPreadParams(SCIP *scip, const char *filename)
Definition: scip.c:4254
SCIP_RETCODE SCIPvarAddToRow(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_PROB *prob, SCIP_LP *lp, SCIP_ROW *row, SCIP_Real val)
Definition: var.c:13523
SCIP_CLOCK * strongbranchtime
Definition: struct_stat.h:124
SCIP_RETCODE SCIPprimalAddOrigSolFree(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_SOL **sol, SCIP_Bool *stored)
Definition: primal.c:1150
SCIP_RETCODE SCIPaddQuadVarToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var)
Definition: scip.c:29652
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip.c:14503
SCIP_Real SCIPconshdlrGetPropTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4411
SCIP_RETCODE SCIPparamCheckChar(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, const char value)
Definition: paramset.c:4158
SCIP_Real SCIPgetTransObjscale(SCIP *scip)
Definition: scip.c:10162
SCIP_Bool SCIPisLPRelax(SCIP *scip)
Definition: scip.c:26460
#define SCIP_DECL_DIALOGEXEC(x)
Definition: type_dialog.h:87
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
Definition: var.c:16608
SCIP_Bool SCIPsetIsSumPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5512
void SCIPrelaxationSetSolZero(SCIP_RELAXATION *relaxation, SCIP_Bool iszero)
Definition: relax.c:599
SCIP_RETCODE SCIPsolLinkRelaxSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_RELAXATION *relaxation)
Definition: sol.c:832
void SCIPstatResetCurrentRun(SCIP_STAT *stat, SCIP_Bool solved)
Definition: stat.c:450
SCIP_RETCODE SCIPsetConshdlrInitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITSOL((*consinitsol)))
Definition: scip.c:5431
SCIP_Real SCIPsetFeasFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5747
#define SCIP_VERSION
Definition: def.h:89
SCIP_RETCODE SCIPcreateCurrentSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:34157
SCIP_RETCODE SCIPsetHeuristics(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:4405
#define SCIPdebugReset(set)
Definition: debug.h:249
SCIP_RETCODE SCIPextendPtrarray(SCIP *scip, SCIP_PTRARRAY *ptrarray, int minidx, int maxidx)
Definition: scip.c:42941
SCIP_Longint SCIPgetNResolveLPs(SCIP *scip)
Definition: scip.c:37617
SCIP_RETCODE SCIPchgRealParam(SCIP *scip, SCIP_PARAM *param, SCIP_Real value)
Definition: scip.c:4083
SCIP_Real firstsolgap
Definition: struct_stat.h:99
int SCIPsepastoreGetNCutsFound(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1367
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
Definition: scip.c:41770
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip.h:20585
SCIP_Bool misc_exactsolve
Definition: struct_set.h:314
SCIP_Real SCIPgetVarPseudocostScoreCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real solval)
Definition: scip.c:23545
void SCIPpropSetInit(SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
Definition: prop.c:778
SCIP_Real SCIPconflictGetInfeasibleLPTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:6279
SCIP_Real SCIPgetSolTime(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:35225
SCIP_RETCODE SCIPconflictCreate(SCIP_CONFLICT **conflict, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: conflict.c:2513
int SCIPpricerGetNVarsFound(SCIP_PRICER *pricer)
Definition: pricer.c:604
SCIP_Bool SCIPisSumEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41806
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
Definition: var.c:17057
void SCIPbranchruleSetExecExt(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECEXT((*branchexecext)))
Definition: branch.c:1855
#define SCIP_VARTYPE_IMPLINT_CHAR
Definition: def.h:100
int SCIPtreeGetNSiblings(SCIP_TREE *tree)
Definition: tree.c:7792
#define SCIP_DECL_DISPEXITSOL(x)
Definition: type_disp.h:108
void SCIPsetSortBranchrules(SCIP_SET *set)
Definition: set.c:4112
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip.c:692
void SCIPsepaSetPriority(SCIP_SEPA *sepa, SCIP_SET *set, int priority)
Definition: sepa.c:663
int SCIPgetIntarrayMaxIdx(SCIP *scip, SCIP_INTARRAY *intarray)
Definition: scip.c:42760
int npricers
Definition: struct_set.h:88
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:36588
SCIP_RETCODE SCIPrepropagateNode(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:37136
SCIP_RETCODE SCIPprimalAddSolFree(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_SOL **sol, SCIP_Bool *stored)
Definition: primal.c:1054
SCIP_Bool SCIProwIsLPEfficacious(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_Bool root)
Definition: lp.c:6528
SCIP_Bool SCIPtreeProbingObjChanged(SCIP_TREE *tree)
Definition: tree.c:8028
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:2395
void BMSprintBufferMemory(BMS_BUFMEM *buffer)
Definition: memory.c:3059
int SCIPgetNFixedVars(SCIP *scip)
Definition: scip.c:11015
SCIP_RETCODE SCIPtreeBranchVarNary(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *var, SCIP_Real val, int n, SCIP_Real minwidth, SCIP_Real widthfactor, int *nchildren)
Definition: tree.c:5658
int SCIPpropGetNChgSides(SCIP_PROP *prop)
Definition: prop.c:1202
SCIP_Real SCIPgetVarAvgCutoffScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:24131
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
Definition: scip.c:5772
SCIP_RETCODE SCIPreadSol(SCIP *scip, const char *filename)
Definition: scip.c:36002
SCIP_RETCODE SCIPcreateMessagehdlrDefault(SCIP_MESSAGEHDLR **messagehdlr, SCIP_Bool bufferedoutput, const char *filename, SCIP_Bool quiet)
SCIP_RETCODE SCIPgetLPBInvACol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:26999
int nactiveconss
Definition: struct_stat.h:186
BMS_BLKMEM * probmem
Definition: struct_mem.h:39
void SCIPconsCapture(SCIP_CONS *cons)
Definition: cons.c:5845
struct SCIP_RelaxData SCIP_RELAXDATA
Definition: type_relax.h:38
SCIP_Longint SCIPconflictGetNBoundexceedingLPSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:6379
#define SCIP_DECL_RELAXEXEC(x)
Definition: type_relax.h:118
unsigned int SCIP_PROPTIMING
Definition: type_timing.h:64
int SCIPpricestoreGetNVarsFound(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:655
SCIP_Real SCIPhistoryGetInferenceSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:629
SCIP_RETCODE SCIPbranchVarHole(SCIP *scip, SCIP_VAR *var, SCIP_Real left, SCIP_Real right, SCIP_NODE **downchild, SCIP_NODE **upchild)
Definition: scip.c:33775
SCIP_Real SCIProwGetMinActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6350
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:27834
struct SCIP_ProbData SCIP_PROBDATA
Definition: type_prob.h:44
void SCIPnodeselSetStdPriority(SCIP_NODESEL *nodesel, SCIP_SET *set, int priority)
Definition: nodesel.c:1022
char ** extcodenames
Definition: struct_set.h:84
SCIP_RETCODE SCIPdisableCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:25647
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
Definition: scip.c:10014
SCIP_Bool nlpenabled
Definition: struct_prob.h:79
SCIP_RETCODE SCIPsetComprInit(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRINIT((*comprinit)))
Definition: scip.c:7563
SCIP_NLPIPROBLEM * SCIPnlpGetNLPIProblem(SCIP_NLP *nlp)
Definition: nlp.c:5908
SCIP_RETCODE SCIPptrarrayFree(SCIP_PTRARRAY **ptrarray)
Definition: misc.c:3495
SCIP_Bool misc_catchctrlc
Definition: struct_set.h:310
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Definition: scip.c:4673
SCIP_RETCODE SCIPreleaseNlRow(SCIP *scip, SCIP_NLROW **nlrow)
Definition: scip.c:29472
SCIP_Real SCIPheurGetSetupTime(SCIP_HEUR *heur)
Definition: heur.c:1325
SCIP_Real SCIPgetAvgPseudocost(SCIP *scip, SCIP_Real solvaldelta)
Definition: scip.c:38811
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
Definition: scip.c:25072
internal methods for conflict analysis
SCIP_RETCODE SCIPaddReoptnodeCons(SCIP *scip, SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, int nvars, REOPT_CONSTYPE constype)
Definition: scip.c:15116
void SCIPmessageVFPrintDialog(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr, va_list ap)
Definition: message.c:533
SCIP_RETCODE SCIPgetNlRowSolActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_SOL *sol, SCIP_Real *activity)
Definition: scip.c:30098
SCIP_RETCODE SCIPlpSetCutoffbound(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real cutoffbound)
Definition: lp.c:12476
static const SCIP_Real scalars[]
Definition: lp.c:5506
SCIP_RETCODE SCIPsetComprExitsol(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPREXITSOL((*comprexitsol)))
Definition: scip.c:7611
SCIP_RETCODE SCIPvarMultiaggregate(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_CLIQUETABLE *cliquetable, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, int naggvars, SCIP_VAR **aggvars, SCIP_Real *scalars, SCIP_Real constant, SCIP_Bool *infeasible, SCIP_Bool *aggregated)
Definition: var.c:5063
void SCIPsetSortPresols(SCIP_SET *set)
Definition: set.c:3518
SCIP_NODE * SCIPtreeGetRootNode(SCIP_TREE *tree)
Definition: tree.c:8017
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip.c:1281
SCIP_RELAX ** SCIPgetRelaxs(SCIP *scip)
Definition: scip.c:6567
internal methods for tree compressions
SCIP_RETCODE SCIPstartDiveNLP(SCIP *scip)
Definition: scip.c:29186
SCIP_RETCODE SCIPincludeComprBasic(SCIP *scip, SCIP_COMPR **compr, const char *name, const char *desc, int priority, int minnnodes, SCIP_DECL_COMPREXEC((*comprexec)), SCIP_COMPRDATA *comprdata)
Definition: scip.c:7493
#define REALABS(x)
Definition: def.h:151
SCIP_Longint SCIPgetNSolsFound(SCIP *scip)
Definition: scip.c:38746
SCIP_Bool SCIPprimalUpperboundIsSol(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: primal.c:465
SCIP_RETCODE SCIPheurCreate(SCIP_HEUR **heur, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, unsigned int timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEURCOPY((*heurcopy)), SCIP_DECL_HEURFREE((*heurfree)), SCIP_DECL_HEURINIT((*heurinit)), SCIP_DECL_HEUREXIT((*heurexit)), SCIP_DECL_HEURINITSOL((*heurinitsol)), SCIP_DECL_HEUREXITSOL((*heurexitsol)), SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
Definition: heur.c:643
internal methods for main solving loop and node processing
void SCIPsetSortRelaxsName(SCIP_SET *set)
Definition: set.c:3607
size_t BMSgetNUsedBufferMemory(BMS_BUFMEM *buffer)
Definition: memory.c:3031
SCIP_RETCODE SCIPsetResetParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name)
Definition: set.c:2993
void SCIPmessageVFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr, va_list ap)
Definition: message.c:617
static SCIP_Bool takeCut(SCIP *scip, SCIP_CUT *cut, char cutsel)
Definition: scip.c:1339
SCIP_RETCODE SCIPbranchPseudo(SCIP *scip, SCIP_RESULT *result)
Definition: scip.c:33966
SCIP_VERBLEVEL disp_verblevel
Definition: struct_set.h:218
SCIP_Real SCIPgetVarAvgInferenceCutoffScoreCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real cutoffweight)
Definition: scip.c:24238
SCIP_RETCODE SCIPsetChgParamFixed(SCIP_SET *set, const char *name, SCIP_Bool fixed)
Definition: set.c:2678
int nactivepricers
Definition: struct_set.h:89
SCIP_Real SCIPgetRelaxSolObj(SCIP *scip)
Definition: scip.c:17933
void SCIPsetSortConflicthdlrs(SCIP_SET *set)
Definition: set.c:3445
SCIP_RETCODE SCIPsetRelaxExit(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXEXIT((*relaxexit)))
Definition: scip.c:6505
SCIP_RETCODE SCIPnodeAddBoundchg(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Real newbound, SCIP_BOUNDTYPE boundtype, SCIP_Bool probingchange)
Definition: tree.c:1978
#define SCIP_VARTYPE_CONTINUOUS_CHAR
Definition: def.h:101
#define SCIP_DECL_EVENTINITSOL(x)
Definition: type_event.h:191
SCIP_Bool SCIPconsIsLockedNeg(SCIP_CONS *cons)
Definition: cons.c:7929
#define SCIP_DECL_SEPAEXIT(x)
Definition: type_sepa.h:71
SCIP_RETCODE SCIPparamCheckLongint(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Longint value)
Definition: paramset.c:4168
SCIP_Longint SCIPconshdlrGetNCutsFound(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4521
SCIP_RETCODE SCIPendDive(SCIP *scip)
Definition: scip.c:31618
SCIP_RETCODE SCIPeventfilterFree(SCIP_EVENTFILTER **eventfilter, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: event.c:1675
SCIP_RETCODE SCIPreoptAddOptSol(SCIP_REOPT *reopt, SCIP_SOL *sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal)
Definition: reopt.c:4208
SCIP_RETCODE SCIPnlpFree(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: nlp.c:5134
SCIP_RETCODE SCIPsetRelaxExitsol(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXEXITSOL((*relaxexitsol)))
Definition: scip.c:6537
void SCIPbranchruleSetExitsol(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXITSOL((*branchexitsol)))
Definition: branch.c:1831
SCIP_RETCODE SCIPsetIncludeBranchrule(SCIP_SET *set, SCIP_BRANCHRULE *branchrule)
Definition: set.c:4068
#define SCIP_DECL_CONSFREE(x)
Definition: type_cons.h:74
SCIP_RETCODE SCIPsolCreateLPSol(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_HEUR *heur)
Definition: sol.c:558
SCIP_Real SCIPvarGetLbOriginal(SCIP_VAR *var)
Definition: var.c:17003
SCIP_RETCODE SCIPintarrayExtend(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:2788
SCIP_CONS ** SCIPgetConss(SCIP *scip)
Definition: scip.c:11782
int SCIPgetNIntVars(SCIP *scip)
Definition: scip.c:10788
SCIP_RETCODE SCIPptrarraySetVal(SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, void *val)
Definition: misc.c:3716
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: scip.c:33580
SCIP_RETCODE SCIPtreeMarkProbingNodeHasLP(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_LP *lp)
Definition: tree.c:6324
int SCIPgetNPricevarsFound(SCIP *scip)
Definition: scip.c:37945
SCIP_RETCODE SCIPvarGetActiveRepresentatives(SCIP_SET *set, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
Definition: var.c:3729
SCIP_NODE * SCIPtreeGetCurrentNode(SCIP_TREE *tree)
Definition: tree.c:7940
SCIP_CLOCK * solvingtime
Definition: struct_stat.h:115
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:41721
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_Longint nbarrierlps
Definition: struct_stat.h:149
void SCIPconshdlrSetDisable(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDISABLE((*consdisable)))
Definition: cons.c:4176
SCIP_RETCODE SCIPreoptnodeAddBndchg(SCIP_REOPTNODE *reoptnode, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE boundtype)
Definition: reopt.c:6360
SCIP_RETCODE SCIPaddConsAge(SCIP *scip, SCIP_CONS *cons, SCIP_Real deltaage)
Definition: scip.c:25531
SCIP_RETCODE SCIPcheckLongintParam(SCIP *scip, SCIP_PARAM *param, SCIP_Longint value)
Definition: scip.c:4064
void SCIPheurSetExit(SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
Definition: heur.c:1114
SCIP_Longint nprimalzeroitlps
Definition: struct_stat.h:145
SCIP_RETCODE SCIPconshdlrCheck(SCIP_CONSHDLR *conshdlr, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
Definition: cons.c:3465
SCIP_RETCODE SCIPsetProbExitsol(SCIP *scip, SCIP_DECL_PROBEXITSOL((*probexitsol)))
Definition: scip.c:9182
SCIP_RETCODE SCIPretransformSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:35945
SCIP_CLOCK * primallptime
Definition: struct_stat.h:119
SCIP_Longint SCIPpropGetNCutoffs(SCIP_PROP *prop)
Definition: prop.c:1062
#define SCIP_DECL_DISPEXIT(x)
Definition: type_disp.h:86
SCIP_RETCODE SCIPprobCopy(SCIP_PROB **prob, BMS_BLKMEM *blkmem, SCIP_SET *set, const char *name, SCIP *sourcescip, SCIP_PROB *sourceprob, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global)
Definition: prob.c:184
int SCIPgetNCheckConss(SCIP *scip)
Definition: scip.c:11878
int nconss
Definition: struct_prob.h:72
int SCIPgetMaxTotalDepth(SCIP *scip)
Definition: scip.c:38238
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
Definition: scip.c:38510
#define SCIP_DECL_SEPAINITSOL(x)
Definition: type_sepa.h:82
int SCIPbranchcandGetNPrioPseudoBins(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:822
#define SCIP_DECL_PROPRESPROP(x)
Definition: type_prop.h:243
SCIP_Bool SCIPvarSignificantPscostDifference(SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *varx, SCIP_Real fracx, SCIP_VAR *vary, SCIP_Real fracy, SCIP_BRANCHDIR dir, SCIP_CONFIDENCELEVEL clevel, SCIP_Bool onesided)
Definition: var.c:14064
SCIP_RETCODE SCIPreoptnodeReset(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:6328
#define SCIP_DECL_HEUREXIT(x)
Definition: type_heur.h:84
SCIP_Bool SCIPisDualfeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42119
SCIP_Real SCIPgetNodeDualbound(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:12211
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
Definition: lp.c:18871
SCIP_SET * set
Definition: struct_scip.h:57
#define SCIPduplicateBufferArray(scip, ptr, source, num)
Definition: scip.h:20593
void SCIPprintReal(SCIP *scip, FILE *file, SCIP_Real val, int width, int precision)
Definition: scip.c:41316
SCIP_RETCODE SCIPcreateOrigSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:34218
SCIP_Bool misc_transsolsorig
Definition: struct_set.h:327
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
Definition: scip.c:5455
SCIP_RETCODE SCIPnlrowRecalcNLPActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp)
Definition: nlp.c:2838
static SCIP_RETCODE transformSols(SCIP *scip)
Definition: scip.c:13717
SCIP_RETCODE SCIPprintNlRow(SCIP *scip, SCIP_NLROW *nlrow, FILE *file)
Definition: scip.c:30191
SCIP_RETCODE SCIPsepastoreApplyCuts(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool root, SCIP_EFFICIACYCHOICE efficiacychoice, SCIP_Bool *cutoff)
Definition: sepastore.c:1117
SCIP_PROP ** props
Definition: struct_set.h:73
SCIP_RETCODE SCIPchgVarUbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:32352
SCIP_RETCODE SCIPdialoghdlrAddHistory(SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, const char *command, SCIP_Bool escapecommand)
Definition: dialog.c:711
SCIP_RETCODE SCIPboolarrayFree(SCIP_BOOLARRAY **boolarray)
Definition: misc.c:3140
#define SCIP_DECL_HEURINIT(x)
Definition: type_heur.h:76
SCIP_Longint SCIPgetNBarrierLPs(SCIP *scip)
Definition: scip.c:37581
static void printConflictStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39591
SCIP_RETCODE SCIPpropSetPresol(SCIP_PROP *prop, SCIP_DECL_PROPPRESOL((*proppresol)), int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming)
Definition: prop.c:846
SCIP_Bool SCIPareSolsEqual(SCIP *scip, SCIP_SOL *sol1, SCIP_SOL *sol2)
Definition: scip.c:35334
void SCIPprobUpdateDualbound(SCIP_PROB *prob, SCIP_Real newbound)
Definition: prob.c:1510
void SCIPpresolSetCopy(SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
Definition: presol.c:487
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41933
#define SCIP_DECL_CONSINIT(x)
Definition: type_cons.h:84
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
Definition: scip.c:19453
SCIP_Real upperbound
Definition: struct_primal.h:44
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: scip.c:7313
int SCIPvarGetProbindex(SCIP_VAR *var)
Definition: var.c:16750
SCIP_RETCODE SCIPchgVarUbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:19931
SCIP_Bool SCIPsetIsSumRelLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6211
static SCIP_RETCODE performStrongbranchWithPropagation(SCIP *scip, SCIP_VAR *var, SCIP_Bool down, SCIP_Bool firstchild, SCIP_Bool propagate, SCIP_Real newbound, int itlim, int maxproprounds, SCIP_Real *value, SCIP_Bool *valid, SCIP_Longint *ndomreductions, SCIP_Bool *conflict, SCIP_Bool *lperror, SCIP_VAR **vars, int nvars, SCIP_Real *newlbs, SCIP_Real *newubs, SCIP_Bool *foundsol, SCIP_Bool *cutoff)
Definition: scip.c:18274
#define SCIP_DECL_PROPPRESOL(x)
Definition: type_prop.h:179
SCIP_RETCODE SCIPapplyReopt(SCIP *scip, SCIP_REOPTNODE *reoptnode, unsigned int id, SCIP_Real estimate, SCIP_NODE **childnodes, int *ncreatedchilds, int *naddedconss, int childnodessize, SCIP_Bool *success)
Definition: scip.c:15261
SCIP_RETCODE SCIPsetPricerCopy(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICERCOPY((*pricercopy)))
Definition: scip.c:4844
SCIP_NODE * SCIPgetPrioChild(SCIP *scip)
Definition: scip.c:36970
SCIP_Real SCIPcomprGetTime(SCIP_COMPR *compr)
Definition: compr.c:503
void SCIPprobSetDelorig(SCIP_PROB *prob, SCIP_DECL_PROBDELORIG((*probdelorig)))
Definition: prob.c:328
SCIP_RETCODE SCIPfreeRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip.c:15227
SCIP_RETCODE SCIPwriteOrigProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:9507
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
Definition: scip.c:8436
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
Definition: message.c:602
SCIP_Real SCIPsepaGetTime(SCIP_SEPA *sepa)
Definition: sepa.c:740
SCIP_RETCODE SCIPsolveCIP(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_MEM *mem, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_RELAXATION *relaxation, SCIP_PRICESTORE *pricestore, SCIP_SEPASTORE *sepastore, SCIP_CUTPOOL *cutpool, SCIP_CUTPOOL *delayedcutpool, SCIP_BRANCHCAND *branchcand, SCIP_CONFLICT *conflict, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool *restart)
Definition: solve.c:4275
int ncomprs
Definition: struct_set.h:105
static void printRelaxatorStatistics(SCIP *scip, FILE *file)
Definition: scip.c:40004
SCIP_Real SCIProwGetLPFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:6018
void SCIPfreeParseVarsPolynomialData(SCIP *scip, SCIP_VAR ****monomialvars, SCIP_Real ***monomialexps, SCIP_Real **monomialcoefs, int **monomialnvars, int nmonomials)
Definition: scip.c:16794
SCIP_RETCODE SCIPconflictAddRelaxedBound(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd)
Definition: conflict.c:3043
SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5256
SCIP_RETCODE SCIPsetAddLongintParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Longint *valueptr, SCIP_Bool isadvanced, SCIP_Longint defaultvalue, SCIP_Longint minvalue, SCIP_Longint maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: set.c:2479
SCIP_Real SCIPgetRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx)
Definition: scip.c:42542
SCIP_RETCODE SCIPprimalAddSol(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_SOL *sol, SCIP_Bool *stored)
Definition: primal.c:996
SCIP_Real SCIPreoptGetSimilarity(SCIP_REOPT *reopt, SCIP_SET *set, int run1, int run2, SCIP_VAR **transvars, int ntransvars)
Definition: reopt.c:4489
SCIP_Real sepa_minactivityquot
Definition: struct_set.h:420
#define SCIPdebugSolDisable(scip)
Definition: debug.h:267
enum SCIP_DispStatus SCIP_DISPSTATUS
Definition: type_disp.h:50
SCIP_Bool misc_transorigsols
Definition: struct_set.h:326
SCIP_RETCODE SCIPcreateRelaxSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:34107
SCIP_MESSAGEHDLR * messagehdlr
Definition: struct_scip.h:60
SCIP_RETCODE SCIPcolGetStrongbranch(SCIP_COL *col, SCIP_Bool integral, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_LP *lp, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Bool *lperror)
Definition: lp.c:4105
SCIP_RETCODE SCIPreleaseDialog(SCIP *scip, SCIP_DIALOG **dialog)
Definition: scip.c:8863
SCIP_RETCODE SCIPtightenVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:21260
void SCIPmarkLimitChanged(SCIP *scip)
Definition: scip.c:41305
default user interface dialog
SCIP_Real SCIPpresolGetSetupTime(SCIP_PRESOL *presol)
Definition: presol.c:651
int SCIPconshdlrGetNCheckConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4308
SCIP_RETCODE SCIPconsAddAge(SCIP_CONS *cons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_Real deltaage)
Definition: cons.c:6709
SCIP_RETCODE SCIPunmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:25812
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
Definition: scip.c:26322
SCIP_Longint SCIPcolGetStrongbranchNode(SCIP_COL *col)
Definition: lp.c:18806
SCIP_RETCODE SCIPconsSetInitial(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool initial)
Definition: cons.c:6110
void SCIPconshdlrSetResprop(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
Definition: cons.c:4132
int SCIPgetBoolarrayMinIdx(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:42878
#define SCIP_Real
Definition: def.h:127
SCIP_RETCODE SCIPgetNLPVarsNonlinearity(SCIP *scip, int *nlcount)
Definition: scip.c:28518
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
Definition: cons.c:7799
internal methods for problem statistics
SCIP_Real SCIPgetObjlimit(SCIP *scip)
Definition: scip.c:10251
#define SCIP_EVENTTYPE_VARCHANGED
Definition: type_event.h:104
void SCIPaddBilinLinearization(SCIP *scip, SCIP_Real bilincoef, SCIP_Real refpointx, SCIP_Real refpointy, SCIP_Real *lincoefx, SCIP_Real *lincoefy, SCIP_Real *linconstant, SCIP_Bool *success)
Definition: scip.c:30572
SCIP_RETCODE SCIPsolCheck(SCIP_SOL *sol, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *feasible)
Definition: sol.c:1474
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)
Definition: scip.c:25047
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
Definition: scip.c:32190
SCIP_VAR ** vars
Definition: struct_prob.h:54
void SCIPstatUpdatePrimalDualIntegral(SCIP_STAT *stat, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_Real upperbound, SCIP_Real lowerbound)
Definition: stat.c:359
SCIP_RETCODE SCIPsetIncludeReader(SCIP_SET *set, SCIP_READER *reader)
Definition: set.c:3125
SCIP_Real SCIPgetConflictVarLb(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:24635
SCIP_PRICER ** pricers
Definition: struct_set.h:64
SCIP_RETCODE SCIPmemFree(SCIP_MEM **mem)
Definition: mem.c:59
SCIP_RETCODE SCIPaddCharParam(SCIP *scip, const char *name, const char *desc, char *valueptr, SCIP_Bool isadvanced, char defaultvalue, const char *allowedvalues, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip.c:3657
SCIP_Real SCIPheurGetTime(SCIP_HEUR *heur)
Definition: heur.c:1335
enum SCIP_Stage SCIP_STAGE
Definition: type_set.h:48
int SCIPgetNCuts(SCIP *scip)
Definition: scip.c:31485
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:32318
void SCIPheurSetInit(SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: heur.c:1103
SCIP_Longint SCIPcomprGetNFound(SCIP_COMPR *compr)
Definition: compr.c:473
SCIP_RETCODE SCIPflushLP(SCIP *scip)
Definition: scip.c:26419
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:20299
struct SCIP_PropData SCIP_PROPDATA
Definition: type_prop.h:38
int SCIPvarGetNCliques(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17409
SCIP_BRANCHRULE * SCIPsetFindBranchrule(SCIP_SET *set, const char *name)
Definition: set.c:4092
SCIP_Real SCIPgetAvgInferenceScoreCurrentRun(SCIP *scip)
Definition: scip.c:39098
SCIP_Bool SCIPlpIsSolved(SCIP_LP *lp)
Definition: lp.c:19383
SCIP_Bool SCIPisSumRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42400
SCIP_Real firstprimaltime
Definition: struct_stat.h:98
SCIP_RETCODE SCIPsetConsModifiable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: scip.c:25200
SCIP_RETCODE SCIPsetPropExit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
Definition: scip.c:6993
void SCIPconshdlrSetProp(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING timingmask)
Definition: cons.c:3959
#define MIN(x, y)
Definition: memory.c:67
SCIP_RETCODE SCIPfreeCutpool(SCIP *scip, SCIP_CUTPOOL **cutpool)
Definition: scip.c:31194
SCIP_RETCODE SCIPsetConsChecked(SCIP *scip, SCIP_CONS *cons, SCIP_Bool check)
Definition: scip.c:25122
SCIP_Bool SCIPsetIsFeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5699
SCIP_Bool reopt_commontimelimit
Definition: struct_set.h:401
SCIP_RETCODE SCIPrealarrayExtend(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:2417
void SCIPmessageVFPrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr, va_list ap)
Definition: message.c:449
SCIP_RETCODE SCIPcopyImplicationsCliques(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *infeasible, int *nbdchgs, int *ncopied)
Definition: scip.c:2980
SCIP_RETCODE SCIPcreatePtrarray(SCIP *scip, SCIP_PTRARRAY **ptrarray)
Definition: scip.c:42907
#define SCIP_DECL_EVENTCOPY(x)
Definition: type_event.h:156
SCIP_Real SCIPsetDualfeastol(SCIP_SET *set)
Definition: set.c:5094
SCIP_RETCODE SCIPtreeLoadProbingLPState(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:6251
#define SCIP_DECL_NODESELCOPY(x)
Definition: type_nodesel.h:47
int SCIPgetNUpgrConss(SCIP *scip)
Definition: scip.c:11694
SCIP_RETCODE SCIPsepasolCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_RESULT *result)
Definition: scip.c:26012
SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip.c:27600
SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint nrepropboundchgs
Definition: struct_stat.h:75
SCIP_Longint SCIPconflictGetNStrongbranchCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:6687
SCIP_Longint SCIPconflictGetNInfeasibleLPIterations(SCIP_CONFLICT *conflict)
Definition: conflict.c:6349
SCIP_Real SCIPconflictGetVarLb(SCIP_CONFLICT *conflict, SCIP_VAR *var)
Definition: conflict.c:3267
SCIP_RETCODE SCIPconsPresol(SCIP_CONS *cons, SCIP_SET *set, int nrounds, SCIP_PRESOLTIMING timing, int nnewfixedvars, int nnewaggrvars, int nnewchgvartypes, int nnewchgbds, int nnewholes, int nnewdelconss, int nnewaddconss, int nnewupgdconss, int nnewchgcoefs, int nnewchgsides, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: cons.c:7308
void SCIPsetSortPricers(SCIP_SET *set)
Definition: set.c:3210
int SCIPsepastoreGetNCutsFoundRound(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1377
SCIP_RETCODE SCIPcreateLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:34044
SCIP_RETCODE SCIPextendBoolarray(SCIP *scip, SCIP_BOOLARRAY *boolarray, int minidx, int maxidx)
Definition: scip.c:42809
SCIP_Real SCIPconshdlrGetEnfoPSTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4401
SCIP_NLP * nlp
Definition: struct_scip.h:76
SCIP_Real firstprimalbound
Definition: struct_stat.h:97
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
Definition: scip.c:28334
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
Definition: scip.c:11392
#define SCIP_DECL_CONSSEPASOL(x)
Definition: type_cons.h:271
SCIP_Longint ntotalinternalnodes
Definition: struct_stat.h:67
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41959
void SCIPconshdlrSetDelvars(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELVARS((*consdelvars)))
Definition: cons.c:4187
#define SCIP_DECL_READERREAD(x)
Definition: type_reader.h:71
#define SCIP_DECL_HEURFREE(x)
Definition: type_heur.h:68
SCIP_RETCODE SCIPchgVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:19972
#define SCIP_DECL_CONSPROP(x)
Definition: type_cons.h:421
SCIP_RETCODE SCIPconflictIsVarUsed(SCIP_CONFLICT *conflict, SCIP_VAR *var, SCIP_SET *set, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool *used)
Definition: conflict.c:3207
SCIP_RETCODE SCIPchgVarLbLazy(SCIP *scip, SCIP_VAR *var, SCIP_Real lazylb)
Definition: scip.c:20126
#define SCIPsetFreeBufferArray(set, ptr)
Definition: set.h:1795
SCIP_CONS ** conss
Definition: struct_prob.h:58
SCIP_RETCODE SCIPconsPrint(SCIP_CONS *cons, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: cons.c:5897
SCIP_RETCODE SCIPcalcNegatedCliquePartition(SCIP *const scip, SCIP_VAR **const vars, int const nvars, int *const cliquepartition, int *const ncliques)
Definition: scip.c:22008
SCIP_Real SCIPvarGetVSIDS(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:17522
#define SCIP_INVALID
Definition: def.h:147
SCIP_Longint SCIPsepaGetNConssFound(SCIP_SEPA *sepa)
Definition: sepa.c:840
int nnlpis
Definition: struct_set.h:117
void SCIPpropSetResprop(SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: prop.c:876
SCIP_RETCODE SCIPchgVarBoundsDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: scip.c:29270
SCIP_Real SCIPfeastol(SCIP *scip)
Definition: scip.c:41146
#define SCIP_DECL_CONFLICTINIT(x)
Definition: type_conflict.h:68
SCIP_Real SCIPconshdlrGetPresolTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4371
internal methods for constraints and constraint handlers
SCIP_RETCODE SCIProwChgRhs(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_Real rhs)
Definition: lp.c:5461
int nextcodes
Definition: struct_set.h:119
SCIP_NLPI * SCIPnlpGetNLPI(SCIP_NLP *nlp)
Definition: nlp.c:5898
SCIP_RETCODE SCIPclearSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:34784
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
Definition: scip.c:10194
SCIP_RETCODE SCIPvarParseTransformed(SCIP_VAR **var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, const char *str, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARCOPY((*varcopy)), SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_VARDATA *vardata, char **endptr, SCIP_Bool *success)
Definition: var.c:2455
SCIP_Longint SCIPgetNConflictConssApplied(SCIP *scip)
Definition: scip.c:38114
#define SCIP_DECL_CONSACTIVE(x)
Definition: type_cons.h:606
int SCIPconshdlrGetNChgVarTypes(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4631
SCIP_NODE * SCIPtreeGetPrioChild(SCIP_TREE *tree)
Definition: tree.c:6679
SCIP_Real primsol
Definition: struct_lp.h:136
SCIP_Bool SCIPlpIsRelax(SCIP_LP *lp)
Definition: lp.c:19373
const char * SCIPexprintGetName(void)
const char * SCIPgetProbName(SCIP *scip)
Definition: scip.c:9941
SCIP_RETCODE SCIPflushNLP(SCIP *scip)
Definition: scip.c:28682
const char * SCIPrelaxGetName(SCIP_RELAX *relax)
Definition: relax.c:441
SCIP_Longint SCIPconflictGetNAppliedGlobalLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:2412
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
Definition: scip.c:27738
SCIP_CLOCK * duallptime
Definition: struct_stat.h:120
SCIP_RETCODE SCIPsetEventhdlrFree(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTFREE((*eventfree)))
Definition: scip.c:7824
SCIP_RETCODE SCIPnlpSetStringPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, const char *sval)
Definition: nlp.c:6058
static SCIP_RETCODE tightenBounds(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
Definition: scip.c:22609
SCIP_Longint SCIPpropGetNRespropCalls(SCIP_PROP *prop)
Definition: prop.c:1052
SCIP_RETCODE SCIPprimalUpdateObjoffset(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp)
Definition: primal.c:365
SCIP_RETCODE SCIPgetNLPRealPar(SCIP *scip, SCIP_NLPPARAM type, SCIP_Real *dval)
Definition: scip.c:28997
SCIP_RETCODE SCIPcutpoolSeparate(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_SEPASTORE *sepastore, SCIP_SOL *sol, SCIP_Bool cutpoolisdelayed, SCIP_Bool root, SCIP_RESULT *result)
Definition: cutpool.c:670
SCIP_Real * SCIPgetNLPVarsLbDualsol(SCIP *scip)
Definition: scip.c:28542
void SCIPbranchruleSetMaxbounddist(SCIP_BRANCHRULE *branchrule, SCIP_Real maxbounddist)
Definition: branch.c:1953
SCIP_RETCODE SCIPprobTransform(SCIP_PROB *source, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_PROB **target)
Definition: prob.c:486
SCIP_RETCODE SCIPsetNodeselInitsol(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINITSOL((*nodeselinitsol)))
Definition: scip.c:8092
SCIP_Real SCIPgetLPLooseObjval(SCIP *scip)
Definition: scip.c:26518
void SCIPconshdlrSetGetVars(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
Definition: cons.c:4220
SCIP_RETCODE SCIPnodeAddCons(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_CONS *cons)
Definition: tree.c:1525
SCIP_RETCODE SCIPsetNLPInitialGuessSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:28735
void * SCIPgetPtrarrayVal(SCIP *scip, SCIP_PTRARRAY *ptrarray, int idx)
Definition: scip.c:42973
SCIP_Real SCIPgetVarPseudocostValCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
Definition: scip.c:23246
SCIP_RETCODE SCIPstartSolvingTime(SCIP *scip)
Definition: scip.c:40901
SCIP_CLOCK * reoptupdatetime
Definition: struct_stat.h:133
SCIP_RETCODE SCIPaddConflictRelaxedUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedub)
Definition: scip.c:24471
#define SCIP_Longint
Definition: def.h:112
SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:40716
SCIP_RETCODE SCIPincludeConshdlr(SCIP *scip, const char *name, const char *desc, int sepapriority, int enfopriority, int chckpriority, int sepafreq, int propfreq, int eagerfreq, int maxprerounds, SCIP_Bool delaysepa, SCIP_Bool delayprop, SCIP_Bool needscons, SCIP_PROPTIMING proptiming, SCIP_PRESOLTIMING presoltiming, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSFREE((*consfree)), SCIP_DECL_CONSINIT((*consinit)), SCIP_DECL_CONSEXIT((*consexit)), SCIP_DECL_CONSINITPRE((*consinitpre)), SCIP_DECL_CONSEXITPRE((*consexitpre)), SCIP_DECL_CONSINITSOL((*consinitsol)), SCIP_DECL_CONSEXITSOL((*consexitsol)), SCIP_DECL_CONSDELETE((*consdelete)), SCIP_DECL_CONSTRANS((*constrans)), SCIP_DECL_CONSINITLP((*consinitlp)), SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSPROP((*consprop)), SCIP_DECL_CONSPRESOL((*conspresol)), SCIP_DECL_CONSRESPROP((*consresprop)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_DECL_CONSACTIVE((*consactive)), SCIP_DECL_CONSDEACTIVE((*consdeactive)), SCIP_DECL_CONSENABLE((*consenable)), SCIP_DECL_CONSDISABLE((*consdisable)), SCIP_DECL_CONSDELVARS((*consdelvars)), SCIP_DECL_CONSPRINT((*consprint)), SCIP_DECL_CONSCOPY((*conscopy)), SCIP_DECL_CONSPARSE((*consparse)), SCIP_DECL_CONSGETVARS((*consgetvars)), SCIP_DECL_CONSGETNVARS((*consgetnvars)), SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)), SCIP_CONSHDLRDATA *conshdlrdata)
Definition: scip.c:5100
SCIP_RETCODE SCIPcaptureDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip.c:8846
SCIP_RETCODE SCIPsetSetDefaultIntParam(SCIP_SET *set, const char *name, int defaultvalue)
Definition: set.c:2797
SCIP_RETCODE SCIPsetSetDualfeastol(SCIP_SET *set, SCIP_Real dualfeastol)
Definition: set.c:4872
SCIP_RETCODE SCIPsetEventhdlrInitsol(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINITSOL((*eventinitsol)))
Definition: scip.c:7866
#define SCIP_DECL_PROPEXIT(x)
Definition: type_prop.h:71
SCIP_RETCODE SCIPinferBinvarProp(SCIP *scip, SCIP_VAR *var, SCIP_Bool fixedval, SCIP_PROP *inferprop, int inferinfo, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:21042
SCIP_Bool SCIPsetIsDualfeasZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5901
SCIP_RETCODE SCIPcheckBoolParam(SCIP *scip, SCIP_PARAM *param, SCIP_Bool value)
Definition: scip.c:3956
SCIP_VAR ** SCIPnlpGetVars(SCIP_NLP *nlp)
Definition: nlp.c:5741
SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value)
Definition: scip.c:3759
void SCIPbranchruleSetExit(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXIT((*branchexit)))
Definition: branch.c:1809
int SCIPgetNNlpis(SCIP *scip)
Definition: scip.c:8685
int SCIPgetNOrigConss(SCIP *scip)
Definition: scip.c:11828
SCIP_Longint nactivatednodes
Definition: struct_stat.h:70
SCIP_Real SCIPadjustedVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real lb)
Definition: scip.c:19685
SCIP_Real SCIPpropGetStrongBranchPropTime(SCIP_PROP *prop)
Definition: prop.c:1012
SCIP_RETCODE SCIPsolCreateNLPSol(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_NLP *nlp, SCIP_HEUR *heur)
Definition: sol.c:581
SCIP_Real SCIPgetBranchScoreMultiple(SCIP *scip, SCIP_VAR *var, int nchildren, SCIP_Real *gains)
Definition: scip.c:33603
SCIP_RETCODE SCIPdialogAddEntry(SCIP_DIALOG *dialog, SCIP_SET *set, SCIP_DIALOG *subdialog)
Definition: dialog.c:939
SCIP_RETCODE SCIPwriteNLP(SCIP *scip, const char *filename)
Definition: scip.c:29109
SCIP_RETCODE SCIPsetBranchruleMaxbounddist(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_Real maxbounddist)
Definition: scip.c:8503
SCIP_Longint nprimallpiterations
Definition: struct_stat.h:49
SCIP_Real SCIPgetReoptSimilarity(SCIP *scip, int run1, int run2)
Definition: scip.c:15560
SCIP_RETCODE SCIProwCalcIntegralScalar(SCIP_ROW *row, SCIP_SET *set, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Bool usecontvars, SCIP_Real *intscalar, SCIP_Bool *success)
Definition: lp.c:5510
SCIP_Longint nreprops
Definition: struct_stat.h:74
SCIP_Real SCIPvarGetAvgCutoffs(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15461
SCIP_RETCODE SCIPsetEmphasis(SCIP *scip, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
Definition: scip.c:4360
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:34885
SCIP_RETCODE SCIPextendRealarray(SCIP *scip, SCIP_REALARRAY *realarray, int minidx, int maxidx)
Definition: scip.c:42507
SCIP_Bool SCIPsetIsFeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5644
SCIP_RETCODE SCIPnodeUpdateLowerboundLP(SCIP_NODE *node, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_LP *lp)
Definition: tree.c:2298
SCIP_RETCODE SCIPrealarraySetVal(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real val)
Definition: misc.c:2624
int SCIPminorVersion(void)
Definition: scip.c:562
SCIP_Longint nsbsolsfound
Definition: struct_stat.h:79
SCIP_TREE * tree
Definition: struct_scip.h:79
SCIP_Real SCIPgetVarSol(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:17628
SCIP_RETCODE SCIPlpGetBInvARow(SCIP_LP *lp, int r, SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9410
SCIP_RETCODE SCIPsetRelaxSolValsSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:17796
void SCIPnodeselSetCopy(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELCOPY((*nodeselcopy)))
Definition: nodesel.c:1083
void SCIProwMarkNotRemovableLocal(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:7525
#define SCIP_VARTYPE_BINARY_CHAR
Definition: def.h:98
int SCIPdivesetGetNSolutionCalls(SCIP_DIVESET *diveset)
Definition: heur.c:375
SCIP_Real SCIPdualfeasCeil(SCIP *scip, SCIP_Real val)
Definition: scip.c:42217
int SCIPgetNOrigIntVars(SCIP *scip)
Definition: scip.c:11192
SCIP_RETCODE SCIPsetChgStringParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, const char *value)
Definition: set.c:2925
void SCIPconshdlrSetTrans(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
Definition: cons.c:4110
void SCIPcomprSetFree(SCIP_COMPR *compr, SCIP_DECL_COMPRFREE((*comprfree)))
Definition: compr.c:340
SCIP_RETCODE SCIPsetGetLongintParam(SCIP_SET *set, const char *name, SCIP_Longint *value)
Definition: set.c:2622
SCIP_RETCODE SCIPaddQuadVarsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars)
Definition: scip.c:29677
SCIP_RETCODE SCIPintarrayClear(SCIP_INTARRAY *intarray)
Definition: misc.c:2943
SCIP_Real SCIPvarGetMultaggrUbLocal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:7983
SCIP_RETCODE SCIPgetOpenNodesData(SCIP *scip, SCIP_NODE ***leaves, SCIP_NODE ***children, SCIP_NODE ***siblings, int *nleaves, int *nchildren, int *nsiblings)
Definition: scip.c:37080
SCIP_RETCODE SCIPsetConshdlrExit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
Definition: scip.c:5407
SCIP_RETCODE SCIPvarChgName(SCIP_VAR *var, BMS_BLKMEM *blkmem, const char *name)
Definition: var.c:2779
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
Definition: scip.c:41782
SCIP_RELAXATION * relaxation
Definition: struct_scip.h:77
SCIP_RETCODE SCIPprimalTransformSol(SCIP_PRIMAL *primal, SCIP_SOL *sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_Real *solvals, SCIP_Bool *solvalset, int solvalssize, SCIP_Bool *added)
Definition: primal.c:1524
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
Definition: scip.c:19399
SCIP_RETCODE SCIPdeleteReoptnode(SCIP *scip, SCIP_REOPTNODE **reoptnode)
Definition: scip.c:15617
SCIP_Longint SCIPbranchruleGetNCutoffs(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2027
SCIP_Real SCIPgetRowLPActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28134
SCIP_RETCODE SCIPsetConflicthdlrExitsol(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)))
Definition: scip.c:6074
SCIP_CLOCK * nodeactivationtime
Definition: struct_stat.h:129
SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:42283
SCIP_RETCODE SCIPsetNlRowExprtreeParam(SCIP *scip, SCIP_NLROW *nlrow, int paramidx, SCIP_Real paramval)
Definition: scip.c:29817
SCIP_RETCODE SCIPendStrongbranch(SCIP *scip)
Definition: scip.c:18019
void SCIPprobSetDeltrans(SCIP_PROB *prob, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
Definition: prob.c:350
void SCIPpropSetExitpre(SCIP_PROP *prop, SCIP_DECL_PROPEXITPRE((*propexitpre)))
Definition: prop.c:835
SCIP_RETCODE SCIPconsMarkPropagate(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6641
SCIP_Longint ndualzeroitlps
Definition: struct_stat.h:147
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
Definition: scip.c:3938
SCIP_Real firstlptime
Definition: struct_stat.h:106
SCIP_RETCODE SCIPsetChgCharParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, char value)
Definition: set.c:2887
SCIP_Real SCIPfeasFrac(SCIP *scip, SCIP_Real val)
Definition: scip.c:42068
SCIP_Real SCIPsetEpsilon(SCIP_SET *set)
Definition: set.c:5064
SCIP_Bool dualfeasible
Definition: struct_lp.h:340
SCIP_RETCODE SCIPenableCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:25613
SCIP_RETCODE SCIPgetSiblings(SCIP *scip, SCIP_NODE ***siblings, int *nsiblings)
Definition: scip.c:36891
SCIP_Bool SCIPisRelaxSolValid(SCIP *scip)
Definition: scip.c:17841
SCIP_Real SCIPgetRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:28245
SCIP_RETCODE SCIPnlpGetStringPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, const char **sval)
Definition: nlp.c:6041
SCIP_Real SCIPhistoryGetAvgInferences(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:642
SCIP_Real SCIProwGetMaxval(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6423
struct SCIP_PricerData SCIP_PRICERDATA
Definition: type_pricer.h:36
SCIP_RETCODE SCIPincludeDialogDefault(SCIP *scip)
SCIP_Real SCIPvarGetUbOriginal(SCIP_VAR *var)
Definition: var.c:17023
SCIP_RETCODE SCIPmarkRelaxSolInvalid(SCIP *scip)
Definition: scip.c:17883
int SCIProwGetNNonz(SCIP_ROW *row)
Definition: lp.c:18836
SCIP_Real SCIPcolGetFarkasCoef(SCIP_COL *col, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:3941
int SCIPbranchcandGetNPrioPseudoInts(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:832
void SCIPsepaSetInit(SCIP_SEPA *sepa, SCIP_DECL_SEPAINIT((*sepainit)))
Definition: sepa.c:589
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:10572
SCIP_RETCODE SCIPconsEnable(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat)
Definition: cons.c:6456
#define SCIP_DECL_CONSHDLRCOPY(x)
Definition: type_cons.h:66
enum SCIP_Vartype SCIP_VARTYPE
Definition: type_var.h:58
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
Definition: type_cons.h:49
SCIP_Real SCIProwGetLPActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:5988
SCIP_Longint SCIPconflictGetNAppliedConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:2372
SCIP_RETCODE SCIPautoselectDisps(SCIP *scip)
Definition: scip.c:8595
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:20597
int SCIPconshdlrGetNFixedVars(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4611
enum Reopt_ConsType REOPT_CONSTYPE
Definition: type_reopt.h:64
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip.c:41353
SCIP_RETCODE SCIPcopyPlugins(SCIP *sourcescip, SCIP *targetscip, SCIP_Bool copyreaders, SCIP_Bool copypricers, SCIP_Bool copyconshdlrs, SCIP_Bool copyconflicthdlrs, SCIP_Bool copypresolvers, SCIP_Bool copyrelaxators, SCIP_Bool copyseparators, SCIP_Bool copypropagators, SCIP_Bool copyheuristics, SCIP_Bool copyeventhdlrs, SCIP_Bool copynodeselectors, SCIP_Bool copybranchrules, SCIP_Bool copydisplays, SCIP_Bool copydialogs, SCIP_Bool copynlpis, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip.c:1510
#define SCIP_DECL_PRICERFREE(x)
Definition: type_pricer.h:54
int nchildren
Definition: struct_tree.h:201
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
Definition: tree.c:7036
SCIP_Real SCIPgetVarVSIDS(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23581
SCIP_Longint ninternalnodes
Definition: struct_stat.h:65
SCIP_Bool performpresol
Definition: struct_stat.h:228
SCIP_RETCODE SCIPgetReopSolsRun(SCIP *scip, int run, SCIP_SOL **sols, int solssize, int *nsols)
Definition: scip.c:15491
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
Definition: var.c:16730
SCIP_Real SCIPprobExternObjval(SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_SET *set, SCIP_Real objval)
Definition: prob.c:1953
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition: scip.c:3797
SCIP_RETCODE SCIPinitlpCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:25959
int SCIPgetNObjVars(SCIP *scip)
Definition: scip.c:10926
SCIP_Longint SCIPconshdlrGetNCutsApplied(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4531
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
Definition: scip.c:33701
SCIP_Longint SCIPconflictGetNBoundexceedingLPConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:6399
SCIP_Real SCIPtreeGetLowerbound(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:6829
SCIP_Real SCIPlpfeastol(SCIP *scip)
Definition: scip.c:41160
int SCIPcliqueGetNVars(SCIP_CLIQUE *clique)
Definition: implics.c:3101
void SCIPgmlWriteOpening(FILE *file, SCIP_Bool directed)
Definition: misc.c:481
SCIP_RETCODE SCIPaddConflictBinvar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:24573
SCIP_RETCODE SCIPaddConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_NODE *validnode)
Definition: scip.c:11999
SCIP_Bool SCIPisLPSolBasic(SCIP *scip)
Definition: scip.c:26847
SCIP_RETCODE SCIPprobAddCons(SCIP_PROB *prob, SCIP_SET *set, SCIP_STAT *stat, SCIP_CONS *cons)
Definition: prob.c:1230
void SCIPvarAdjustUb(SCIP_VAR *var, SCIP_SET *set, SCIP_Real *ub)
Definition: var.c:6031
void SCIPconshdlrSetExitpre(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
Definition: cons.c:4059
SCIP_Real SCIPgetVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23272
SCIP_RETCODE SCIPconsEnfolp(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: cons.c:7075
SCIP_Bool SCIPsetIsUbBetter(SCIP_SET *set, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
Definition: set.c:6024
void SCIPprimalAddOrigObjoffset(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_Real addval)
Definition: primal.c:431
static SCIP_RETCODE copyCuts(SCIP *sourcescip, SCIP *targetscip, SCIP_CUT **cuts, int ncuts, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip.c:1372
SCIP_Real * SCIPvarGetImplBounds(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17381
int addarraypos
Definition: struct_cons.h:49
int plungedepth
Definition: struct_stat.h:185
SCIP_RETCODE SCIPprintStage(SCIP *scip, FILE *file)
Definition: scip.c:823
SCIP_RETCODE SCIPprimalCreate(SCIP_PRIMAL **primal)
Definition: primal.c:92
SCIP_RETCODE SCIPcheckCharParam(SCIP *scip, SCIP_PARAM *param, const char value)
Definition: scip.c:4172
void SCIPeventhdlrSetDelete(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTDELETE((*eventdelete)))
Definition: event.c:375
SCIP_RETCODE SCIPboolarrayExtend(SCIP_BOOLARRAY *boolarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:3154
SCIP_RETCODE SCIPtreeCutoff(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_Real cutoffbound)
Definition: tree.c:4891
int nconshdlrs
Definition: struct_set.h:91
SCIP_RETCODE SCIPgetVarStrongbranchLast(SCIP *scip, SCIP_VAR *var, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Real *solval, SCIP_Real *lpobjval)
Definition: scip.c:19256
SCIP_Bool inrestart
Definition: struct_stat.h:226
SCIP_Longint SCIPconflictGetNPropReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:4343
SCIP_ROW * SCIPcutGetRow(SCIP_CUT *cut)
Definition: cutpool.c:359
SCIP_Bool SCIPsetIsDualfeasNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5923
SCIP_RETCODE SCIPconflictAnalyzeLP(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool *success)
Definition: conflict.c:6141
#define SCIP_DECL_RELAXEXITSOL(x)
Definition: type_relax.h:93
SCIP_RETCODE SCIPconsDisablePropagation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6611
void SCIPconsSetLocal(SCIP_CONS *cons, SCIP_Bool local)
Definition: cons.c:6297
SCIP_RETCODE SCIPvarDropEvent(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: var.c:17564
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip.c:24436
int SCIPtechVersion(void)
Definition: scip.c:573
SCIP_RETCODE SCIPsolCreatePseudoSol(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_HEUR *heur)
Definition: sol.c:624
int SCIPgetCutoffdepth(SCIP *scip)
Definition: scip.c:37155
int SCIPcalcMemGrowSize(SCIP *scip, int num)
Definition: scip.c:41422
SCIP_RETCODE SCIPprobDelVar(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *var, SCIP_Bool *deleted)
Definition: prob.c:961
int SCIPgetNNLPVars(SCIP *scip)
Definition: scip.c:28496
#define SCIP_DECL_CONSCOPY(x)
Definition: type_cons.h:723
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
Definition: misc.c:2094
SCIP_RETCODE SCIPlpGetBInvACol(SCIP_LP *lp, int c, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9435
SCIP_Real * SCIPnlpGetVarsUbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:5868
static SCIP_RETCODE copyProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool original, SCIP_Bool global, const char *name)
Definition: scip.c:1557
SCIP_RETCODE SCIPdialoghdlrExec(SCIP_DIALOGHDLR *dialoghdlr, SCIP_SET *set)
Definition: dialog.c:374
SCIP_Longint nnodelps
Definition: struct_stat.h:154
SCIP_Real SCIPconflictGetPropTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:4283
SCIP_RETCODE SCIPinitVarBranchStats(SCIP *scip, SCIP_VAR *var, SCIP_Real downpscost, SCIP_Real uppscost, SCIP_Real downvsids, SCIP_Real upvsids, SCIP_Real downconflen, SCIP_Real upconflen, SCIP_Real downinfer, SCIP_Real upinfer, SCIP_Real downcutoff, SCIP_Real upcutoff)
Definition: scip.c:23941
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
Definition: scip.c:8124
SCIP_Real SCIPgetAvgPseudocostScore(SCIP *scip)
Definition: scip.c:38889
common defines and data types used in all packages of SCIP
SCIP_Longint nnodes
Definition: struct_stat.h:64
SCIP_RETCODE SCIPenableReoptimization(SCIP *scip, SCIP_Bool enable)
Definition: scip.c:14801
SCIP_RETCODE SCIPdialoghdlrAddInputLine(SCIP_DIALOGHDLR *dialoghdlr, const char *inputline)
Definition: dialog.c:687
SCIP_RETCODE SCIPparamWrite(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: paramset.c:4474
void SCIPpricerSetExit(SCIP_PRICER *pricer, SCIP_DECL_PRICEREXIT((*pricerexit)))
Definition: pricer.c:517
SCIP_RETCODE SCIPprobExitPresolve(SCIP_PROB *prob, SCIP_SET *set)
Definition: prob.c:1779
SCIP_RETCODE SCIPlinkPseudoSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:34733
#define SCIP_DECL_DISPOUTPUT(x)
Definition: type_disp.h:117
SCIP_Real SCIPgetVarObjProbing(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:32385
SCIP_Bool misc_calcintegral
Definition: struct_set.h:328
int nrootintfixingsrun
Definition: struct_stat.h:172
static SCIP_Real getUpperbound(SCIP *scip)
Definition: scip.c:474
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:392
void SCIPcolInvalidateStrongbranchData(SCIP_COL *col, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:4070
SCIP_RETCODE SCIPnlpInclude(SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: nlp.c:4988
void SCIPcomprSetExit(SCIP_COMPR *compr, SCIP_DECL_COMPREXIT((*comprexit)))
Definition: compr.c:362
SCIP_RETCODE SCIPdialoghdlrFree(SCIP *scip, SCIP_DIALOGHDLR **dialoghdlr)
Definition: dialog.c:358
int SCIPgetNImplVars(SCIP *scip)
Definition: scip.c:10833
SCIP_Real SCIPgetVarAvgInferenceScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23877
SCIP_RETCODE SCIPvarGetProbvarSum(SCIP_VAR **var, SCIP_SET *set, SCIP_Real *scalar, SCIP_Real *constant)
Definition: var.c:11906
SCIP_Longint SCIPgetNNodeLPIterations(SCIP *scip)
Definition: scip.c:37749
SCIP_Bool SCIPreoptimizeNode(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:15577
SCIP_RETCODE SCIPincludeSepaBasic(SCIP *scip, SCIP_SEPA **sepa, const char *name, const char *desc, int priority, int freq, SCIP_Real maxbounddist, SCIP_Bool usessubscip, SCIP_Bool delay, SCIP_DECL_SEPAEXECLP((*sepaexeclp)), SCIP_DECL_SEPAEXECSOL((*sepaexecsol)), SCIP_SEPADATA *sepadata)
Definition: scip.c:6660
#define SCIP_DECL_CONFLICTFREE(x)
Definition: type_conflict.h:60
SCIP_BOUNDTYPE SCIPboundchgGetBoundtype(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16370
SCIP_RETCODE SCIPsetAddRealParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: set.c:2503
SCIP_NODE * root
Definition: struct_tree.h:167
void SCIPconshdlrSetSepa(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
Definition: cons.c:3938
void SCIPsetMessagehdlrLogfile(SCIP *scip, const char *filename)
Definition: scip.c:1224
SCIP_Real SCIPgetConflictVarUb(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:24659
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
Definition: lp.c:18685
#define SCIP_CALL_ABORT(x)
Definition: def.h:245
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:41697
SCIP_RETCODE SCIPsetNLPRealPar(SCIP *scip, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: scip.c:29025
SCIP_RETCODE SCIPsetPresolInitpre(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
Definition: scip.c:6290
SCIP_RETCODE SCIPprimalFree(SCIP_PRIMAL **primal, BMS_BLKMEM *blkmem)
Definition: primal.c:118
SCIP_RETCODE SCIPsolveDiveLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:31999
SCIP_RETCODE SCIPsetExitPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4435
internal methods for primal heuristics
SCIP_Longint SCIPgetNPrimalLPIterations(SCIP *scip)
Definition: scip.c:37527
SCIP_RETCODE SCIPnodePropagateImplics(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool *cutoff)
Definition: tree.c:2364
int SCIPgetNPrioPseudoBranchCands(SCIP *scip)
Definition: scip.c:33508
SCIP_RETCODE SCIPsetGetBoolParam(SCIP_SET *set, const char *name, SCIP_Bool *value)
Definition: set.c:2594
SCIP_Longint SCIPgetNRootFirstLPIterations(SCIP *scip)
Definition: scip.c:37491
SCIP_RETCODE SCIPgetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int *ival)
Definition: scip.c:28941
static void printBranchruleStatistics(SCIP *scip, FILE *file)
Definition: scip.c:39743
void SCIPrelaxSetExit(SCIP_RELAX *relax, SCIP_DECL_RELAXEXIT((*relaxexit)))
Definition: relax.c:408
SCIP_RETCODE SCIPgetVarSols(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:17648
SCIP_Real SCIPcalcChildEstimate(SCIP *scip, SCIP_VAR *var, SCIP_Real targetvalue)
Definition: scip.c:33678
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip.c:35767
SCIP_Longint SCIPsepaGetNCutsFound(SCIP_SEPA *sepa)
Definition: sepa.c:780
SCIP_RETCODE SCIPsetNodeselStdPriority(SCIP *scip, SCIP_NODESEL *nodesel, int priority)
Definition: scip.c:8159
SCIP_RETCODE SCIPsetPropPriority(SCIP *scip, SCIP_PROP *prop, int priority)
Definition: scip.c:7160
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip.c:3629
void SCIPprintError(SCIP_RETCODE retcode)
Definition: scip.c:627
SCIP_DISP ** disps
Definition: struct_set.h:80
SCIP_RETCODE SCIPptrarrayCreate(SCIP_PTRARRAY **ptrarray, BMS_BLKMEM *blkmem)
Definition: misc.c:3452
SCIP_RETCODE SCIPsepastoreClearCuts(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp)
Definition: sepastore.c:1249
SCIP_RETCODE SCIPchgVarUbLazy(SCIP *scip, SCIP_VAR *var, SCIP_Real lazyub)
Definition: scip.c:20159
SCIP_RETCODE SCIPsetExitprePlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4560
SCIP_ORIGINAL original
Definition: struct_var.h:221
SCIP_Real SCIPcolGetRedcost(SCIP_COL *col, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:3758
int npresols
Definition: struct_set.h:95
SCIP_RETCODE SCIPcreateSolCopyOrig(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
Definition: scip.c:34311
SCIP_LP * lp
Definition: struct_scip.h:75
int firstprimaldepth
Definition: struct_stat.h:219
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
Definition: scip.c:5841
SCIP_RETCODE SCIPtreeFreePresolvingRoot(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_CONFLICT *conflict, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable)
Definition: tree.c:4811
SCIP_Bool nlp_disable
Definition: struct_set.h:296
#define SCIP_ALLOC(x)
Definition: def.h:277
SCIP_RETCODE SCIPbranchExecExtern(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_SEPASTORE *sepastore, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_Real cutoffbound, SCIP_Bool allowaddcons, SCIP_RESULT *result)
Definition: branch.c:2486
SCIP_Real SCIPlpGetColumnObjval(SCIP_LP *lp)
Definition: lp.c:15104
void SCIProwRecalcPseudoActivity(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:6159
int lastnpresolchgsides
Definition: struct_stat.h:212
int SCIPtreeGetNNodes(SCIP_TREE *tree)
Definition: tree.c:7812
SCIP_RETCODE SCIPgetNLPI(SCIP *scip, SCIP_NLPI **nlpi, SCIP_NLPIPROBLEM **nlpiproblem)
Definition: scip.c:29146
SCIP_Real SCIPsumepsilon(SCIP *scip)
Definition: scip.c:41132
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:27864
#define SCIPdebugSolEnable(scip)
Definition: debug.h:266
#define SCIPABORT()
Definition: def.h:238
const char * SCIPexprintGetDesc(void)
SCIP_Real SCIPgetCutEfficacy(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
Definition: scip.c:30836
SCIP_Bool SCIPsetIsRelGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6145
SCIP_RETCODE SCIPdisableConsPropagation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:25757
SCIP_CONS ** SCIPconshdlrGetCheckConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4278
SCIP_LPSOLSTAT lpsolstat
Definition: struct_lp.h:326
SCIP_Longint SCIPgetNStrongbranchs(SCIP *scip)
Definition: scip.c:37839
#define SCIP_DECL_PRICERREDCOST(x)
Definition: type_pricer.h:130
SCIP_RETCODE SCIPsetAddBoolParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: set.c:2433
SCIP_RETCODE SCIPcreateNlRowFromRow(SCIP *scip, SCIP_NLROW **nlrow, SCIP_ROW *row)
Definition: scip.c:29426
#define SCIP_DECL_HEUREXITSOL(x)
Definition: type_heur.h:106
SCIP_Bool SCIPsetIsDualfeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5813
SCIP_Longint nprobholechgs
Definition: struct_stat.h:89
SCIP_RETCODE SCIPincRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx, SCIP_Real incval)
Definition: scip.c:42577
SCIP_RETCODE SCIPaddVarVub(SCIP *scip, SCIP_VAR *var, SCIP_VAR *vubvar, SCIP_Real vubcoef, SCIP_Real vubconstant, SCIP_Bool *infeasible, int *nbdchgs)
Definition: scip.c:21622
#define SCIP_EVENTTYPE_PRESOLVEROUND
Definition: type_event.h:68
#define SCIP_DECL_NODESELSELECT(x)
Definition: type_nodesel.h:109
SCIP_Real SCIPreoptGetSavingtime(SCIP_REOPT *reopt)
Definition: reopt.c:6126
SCIP_RETCODE SCIPnlrowRecalcPseudoActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:2962
SCIP_RETCODE SCIPsolveDiveNLP(SCIP *scip)
Definition: scip.c:29331
SCIP_RETCODE SCIPsetEventhdlrDelete(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTDELETE((*eventdelete)))
Definition: scip.c:7894
SCIP_Real presol_abortfac
Definition: struct_set.h:358
SCIP_Longint nlimsolsfound
Definition: struct_primal.h:39
SCIP_RETCODE SCIPcreateEmptyRow(SCIP *scip, SCIP_ROW **row, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip.c:27689
SCIP_RETCODE SCIPsetIncludeConflicthdlr(SCIP_SET *set, SCIP_CONFLICTHDLR *conflicthdlr)
Definition: set.c:3401
void SCIPsetSortSepas(SCIP_SET *set)
Definition: set.c:3666
void SCIPnodeselSetExitsol(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)))
Definition: nodesel.c:1138
void SCIPchildChgNodeselPrio(SCIP_TREE *tree, SCIP_NODE *child, SCIP_Real priority)
Definition: tree.c:2332
SCIP_Longint SCIPgetNDivingLPIterations(SCIP *scip)
Definition: scip.c:37821
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
Definition: cons.c:7789
SCIP_RETCODE SCIPclearPtrarray(SCIP *scip, SCIP_PTRARRAY *ptrarray)
Definition: scip.c:42960
SCIP_Real SCIPvarGetMultaggrLbLocal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:7917
SCIP_RETCODE SCIPsetSetBoolParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Bool value)
Definition: set.c:2729
int npresolupgdconss
Definition: struct_stat.h:200
const char * SCIPprobGetName(SCIP_PROB *prob)
Definition: prob.c:2174
SCIP_RETCODE SCIPfreeProb(SCIP *scip)
Definition: scip.c:9600
void SCIPstatMark(SCIP_STAT *stat)
Definition: stat.c:158
SCIP_Bool SCIPsetIsFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5354
SCIP_Real SCIPgetVarUbDive(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:31966
static SCIP_RETCODE displayRelevantStats(SCIP *scip)
Definition: scip.c:14153
SCIP_Real SCIPgetVarAvgInferenceCutoffScore(SCIP *scip, SCIP_VAR *var, SCIP_Real cutoffweight)
Definition: scip.c:24194
SCIP_RETCODE SCIPsetNodeselInit(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINIT((*nodeselinit)))
Definition: scip.c:8060
SCIP_READER ** SCIPgetReaders(SCIP *scip)
Definition: scip.c:4702
SCIP_RETCODE SCIPchgNlRowLhs(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real lhs)
Definition: scip.c:29494
SCIP_Bool SCIPnlpHasSolution(SCIP_NLP *nlp)
Definition: nlp.c:5965
SCIP_Longint SCIPvarGetNBranchings(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:14903
int SCIPgetEffectiveRootDepth(SCIP *scip)
Definition: scip.c:36815
int SCIPgetNPriceRounds(SCIP *scip)
Definition: scip.c:37909
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
Definition: cons.c:7819
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
Definition: scip.c:3740
SCIP_Real SCIPgetPresolvingTime(SCIP *scip)
Definition: scip.c:41073
SCIP_RETCODE SCIPtransformVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
Definition: scip.c:16985
SCIP_RETCODE SCIPincludeNlpi(SCIP *scip, SCIP_NLPI *nlpi)
Definition: scip.c:8623
#define SCIP_DECL_BRANCHEXIT(x)
Definition: type_branch.h:76
SCIP_RETCODE SCIPlpEndStrongbranch(SCIP_LP *lp)
Definition: lp.c:4001
#define SCIPdebugFreeSol(set)
Definition: debug.h:248
int lastnpresolaggrvars
Definition: struct_stat.h:204
const char * SCIPlpiGetSolverDesc(void)
Definition: lpi_clp.cpp:442
SCIP_RETCODE SCIPisConflictVarUsed(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool *used)
Definition: scip.c:24607
void SCIPconshdlrSetInitlp(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
Definition: cons.c:4121
int SCIPgetNLPRows(SCIP *scip)
Definition: scip.c:26806
SCIP_RETCODE SCIPtreeCreateProbingNode(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: tree.c:6232
void SCIPvarMarkDeleteGlobalStructures(SCIP_VAR *var)
Definition: var.c:16700
SCIP_RETCODE SCIPintarrayCreate(SCIP_INTARRAY **intarray, BMS_BLKMEM *blkmem)
Definition: misc.c:2731
int SCIPvarGetNLocksDown(SCIP_VAR *var)
Definition: var.c:3149
void SCIPlpUnmarkDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:19434
SCIP_RETCODE SCIPincludePresolBasic(SCIP *scip, SCIP_PRESOL **presolptr, const char *name, const char *desc, int priority, int maxrounds, SCIP_PRESOLTIMING timing, SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
Definition: scip.c:6191
SCIP_Bool SCIPisVarPscostRelerrorReliable(SCIP *scip, SCIP_VAR *var, SCIP_Real threshold, SCIP_CONFIDENCELEVEL clevel)
Definition: scip.c:23482
int SCIPgetNImplications(SCIP *scip)
Definition: scip.c:40653
SCIP_RETCODE SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip.c:36217
SCIP_RETCODE SCIPsetIncludeDisp(SCIP_SET *set, SCIP_DISP *disp)
Definition: set.c:4142
SCIP_RETCODE SCIPchgRowLhs(SCIP *scip, SCIP_ROW *row, SCIP_Real lhs)
Definition: scip.c:27759
SCIP_Bool SCIPinDive(SCIP *scip)
Definition: scip.c:32097
SCIP_VAR ** SCIPexprtreeGetVars(SCIP_EXPRTREE *tree)
Definition: nlp.c:101
void SCIPprobMarkPermuted(SCIP_PROB *prob)
Definition: prob.c:2108
SCIP_RETCODE SCIPnlpiSetMessageHdlr(SCIP_NLPI *nlpi, SCIP_MESSAGEHDLR *messagehdlr)
Definition: nlpi.c:717
SCIP_RETCODE SCIPconsCreate(SCIP_CONS **cons, BMS_BLKMEM *blkmem, SCIP_SET *set, const char *name, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool original, SCIP_Bool deleteconsdata)
Definition: cons.c:5463
SCIP_RETCODE SCIPvarNegate(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **negvar)
Definition: var.c:5490
SCIP_RETCODE SCIPgetReoptLeaveIDs(SCIP *scip, SCIP_NODE *node, unsigned int *ids, int idssize, int *nids)
Definition: scip.c:14985
SCIP_RETCODE SCIPparamCheckString(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, const char *value)
Definition: paramset.c:4148
SCIP_Real SCIPvarGetAvgBranchdepth(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:14991
int subscipdepth
Definition: struct_stat.h:165
SCIP_Longint SCIPgetNNodeInitLPs(SCIP *scip)
Definition: scip.c:37767
SCIP_RETCODE SCIPbranchVarVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
Definition: scip.c:33810
void SCIPresetReoptSolMarks(SCIP *scip)
Definition: scip.c:15517
int lastnpresolupgdconss
Definition: struct_stat.h:210
SCIP_CLIQUE ** SCIPcliquetableGetCliques(SCIP_CLIQUETABLE *cliquetable)
Definition: implics.c:3233
#define SCIP_DECL_SEPAFREE(x)
Definition: type_sepa.h:55
const char * SCIPpropGetName(SCIP_PROP *prop)
Definition: prop.c:887
SCIP_RETCODE SCIPsetEventhdlrCopy(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTCOPY((*eventcopy)))
Definition: scip.c:7810
SCIP_RETCODE SCIPvisualInit(SCIP_VISUAL *visual, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: visual.c:109
void SCIPtreeMarkProbingObjChanged(SCIP_TREE *tree)
Definition: tree.c:8039
SCIP_RETCODE SCIPprintBestSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:35833
SCIP_Bool SCIPinRepropagation(SCIP *scip)
Definition: scip.c:36834
SCIP_RETCODE SCIPconsCheck(SCIP_CONS *cons, SCIP_SET *set, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
Definition: cons.c:6994
SCIP_RETCODE SCIPconsSepalp(SCIP_CONS *cons, SCIP_SET *set, SCIP_RESULT *result)
Definition: cons.c:7142
SCIP_Real SCIPgetVarObjDive(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:31908
struct SCIP_SepaData SCIP_SEPADATA
Definition: type_sepa.h:38
SCIP_Longint SCIPgetNNodes(SCIP *scip)
Definition: scip.c:37372
SCIP_Bool SCIPisReoptEnabled(SCIP *scip)
Definition: scip.c:15481
SCIP_EVENTHDLR ** eventhdlrs
Definition: struct_set.h:76
SCIP_Longint ninitlps
Definition: struct_stat.h:155
SCIP_RETCODE SCIPprobAddVar(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *var)
Definition: prob.c:893
SCIP_RETCODE SCIPsepaCreate(SCIP_SEPA **sepa, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int freq, SCIP_Real maxbounddist, SCIP_Bool usessubscip, SCIP_Bool delay, SCIP_DECL_SEPACOPY((*sepacopy)), SCIP_DECL_SEPAFREE((*sepafree)), SCIP_DECL_SEPAINIT((*sepainit)), SCIP_DECL_SEPAEXIT((*sepaexit)), SCIP_DECL_SEPAINITSOL((*sepainitsol)), SCIP_DECL_SEPAEXITSOL((*sepaexitsol)), SCIP_DECL_SEPAEXECLP((*sepaexeclp)), SCIP_DECL_SEPAEXECSOL((*sepaexecsol)), SCIP_SEPADATA *sepadata)
Definition: sepa.c:88
int SCIPconshdlrGetNAggrVars(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4621
SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
Definition: scip.c:42270
int SCIPgetNNodesLeft(SCIP *scip)
Definition: scip.c:37417
int SCIPreoptGetNTotalRestartsLocal(SCIP_REOPT *reopt)
Definition: reopt.c:3856
SCIP_RETCODE SCIPupdateVarBranchPriority(SCIP *scip, SCIP_VAR *var, int branchpriority)
Definition: scip.c:22528
SCIP callable library.
SCIP_RELAX * SCIPfindRelax(SCIP *scip, const char *name)
Definition: scip.c:6554
SCIP_Longint SCIPbranchruleGetNPseudoCalls(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2017
SCIP_RETCODE SCIPprintTransProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:39309
SCIP_Bool SCIPsetIsFeasNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5710
SCIP_RETCODE SCIPclearRealarray(SCIP *scip, SCIP_REALARRAY *realarray)
Definition: scip.c:42526
SCIP_RETCODE SCIPexprtreeEval(SCIP_EXPRTREE *tree, SCIP_Real *varvals, SCIP_Real *val)
Definition: expr.c:8563
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:36554
int SCIPreoptGetNCheckedSols(SCIP_REOPT *reopt)
Definition: reopt.c:4266
SCIP_RETCODE SCIPsetStringParam(SCIP *scip, const char *name, const char *value)
Definition: scip.c:4217
void SCIPconshdlrSetGetDiveBdChgs(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)))
Definition: cons.c:4242
SCIP_RETCODE SCIPbranchcandUpdateVarBranchPriority(SCIP_BRANCHCAND *branchcand, SCIP_SET *set, SCIP_VAR *var, int branchpriority)
Definition: branch.c:1120
SCIP_Bool SCIPisExactSolve(SCIP *scip)
Definition: scip.c:1012
SCIP_Real SCIPgetVarMultaggrLbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21478
SCIP_Longint SCIPgetNPrimalLPs(SCIP *scip)
Definition: scip.c:37509
SCIP_Longint SCIPgetNLimSolsFound(SCIP *scip)
Definition: scip.c:38770
SCIP_Real SCIPvarGetPseudocostVariance(SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun)
Definition: var.c:13892
SCIP_Longint ndelayedcutoffs
Definition: struct_stat.h:73
void SCIPrelaxSetInit(SCIP_RELAX *relax, SCIP_DECL_RELAXINIT((*relaxinit)))
Definition: relax.c:397
void SCIPsetSortBranchrulesName(SCIP_SET *set)
Definition: set.c:4127
#define SCIP_DECL_READERFREE(x)
Definition: type_reader.h:55
SCIP_CLOCK * lpsoltime
Definition: struct_stat.h:126
SCIP_Real objscale
Definition: struct_prob.h:41
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:35397
SCIP_NODE * SCIPtreeGetPrioSibling(SCIP_TREE *tree)
Definition: tree.c:6705
SCIP_NODE * focusnode
Definition: struct_tree.h:172
#define SCIP_DECL_PROPINIT(x)
Definition: type_prop.h:63
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
Definition: scip.c:34607
SCIP_RETCODE SCIPsolFree(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_PRIMAL *primal)
Definition: sol.c:704
SCIP_RETCODE SCIPgetVarStrongbranchWithPropagation(SCIP *scip, SCIP_VAR *var, SCIP_Real solval, SCIP_Real lpobjval, int itlim, int maxproprounds, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Longint *ndomredsdown, SCIP_Longint *ndomredsup, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict, SCIP_Bool *lperror, SCIP_Real *newlbs, SCIP_Real *newubs)
Definition: scip.c:18633
internal methods for displaying runtime statistics
SCIP_RETCODE SCIPpresolCons(SCIP *scip, SCIP_CONS *cons, int nrounds, SCIP_PRESOLTIMING presoltiming, int nnewfixedvars, int nnewaggrvars, int nnewchgvartypes, int nnewchgbds, int nnewholes, int nnewdelconss, int nnewaddconss, int nnewupgdconss, int nnewchgcoefs, int nnewchgsides, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: scip.c:26108
SCIP_Longint SCIPgetNBestSolsFound(SCIP *scip)
Definition: scip.c:38794
int SCIPbranchcandGetNPrioExternImpls(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:497
SCIP_RETCODE SCIPbranchVarValNary(SCIP *scip, SCIP_VAR *var, SCIP_Real val, int n, SCIP_Real minwidth, SCIP_Real widthfactor, int *nchildren)
Definition: scip.c:33873
void SCIPsetSortPricersName(SCIP_SET *set)
Definition: set.c:3225
int nimplications
Definition: struct_stat.h:188
SCIP_RETCODE SCIPrealarrayClear(SCIP_REALARRAY *realarray)
Definition: misc.c:2572
#define SCIP_DECL_CONFLICTEXITSOL(x)
Definition: type_conflict.h:98
SCIP_Bool SCIPisPrimalboundSol(SCIP *scip)
Definition: scip.c:38621
SCIP_RETCODE SCIPconsSetEnforced(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool enforce)
Definition: cons.c:6179
SCIP_RETCODE SCIPcreateRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip.c:27472
SCIP_RETCODE SCIPsetPricerPriority(SCIP *scip, SCIP_PRICER *pricer, int priority)
Definition: scip.c:5028
SCIP_Longint mem_externestim
Definition: struct_set.h:300
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
Definition: scip.c:41409
SCIP_RETCODE SCIPdelRowCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_ROW *row)
Definition: scip.c:31260
SCIP_CUTPOOL * SCIPgetGlobalCutpool(SCIP *scip)
Definition: scip.c:31139
SCIP_RETCODE SCIPaddConflictBd(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx)
Definition: scip.c:24504
void SCIPpresolSetExitpre(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
Definition: presol.c:542
int SCIPreoptGetNTotalPrunedNodes(SCIP_REOPT *reopt)
Definition: reopt.c:3916
SCIP_Longint ndivinglpiterations
Definition: struct_stat.h:58
OFINS - Objective Function Induced Neighborhood Search - a primal heuristic for reoptimization.
int SCIPpricestoreGetNProbPricings(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:635
SCIP_RETCODE SCIProundSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *success)
Definition: scip.c:35909